Unverified Commit 6d85d74b authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Fix weight doc generation (#5874)

parent 703f2b90
......@@ -326,7 +326,15 @@ def inject_weight_metadata(app, what, name, obj, options, lines):
lines += [f"This weight is also available as ``{obj.__name__}.DEFAULT``.", ""]
table = []
for k, v in field.meta.items():
# the `meta` dict contains another embedded `metrics` dict. To
# simplify the table generation below, we create the
# `meta_with_metrics` dict, where the metrics dict has been "flattened"
meta = field.meta
metrics = meta.pop("metrics", {})
meta_with_metrics = dict(meta, **metrics)
for k, v in meta_with_metrics.items():
if k == "categories":
continue
elif k == "recipe":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment