text stringlengths 0 251 |
|---|
submitted_series = { |
"low_energy": { |
"x_field": "energy_kev", |
"y_field": "transient_excess", |
"selection": "used_in_fit", |
}, |
"high_energy": { |
"x_field": "energy_kev", |
"y_field": "transient_excess", |
"selection": "used_in_fit", |
}, |
} |
series: dict[str, dict[str, object]] = {} |
if isinstance(submitted_series, dict): |
items = submitted_series.items() |
elif isinstance(submitted_series, list): |
items = [] |
for declaration in submitted_series: |
assert isinstance(declaration, dict), ( |
"figure manifest series entries must be objects") |
submitted_name = declaration.get( |
"name", |
declaration.get("series_id"), |
) |
assert isinstance(submitted_name, str), ( |
"figure manifest series entries need a name") |
items.append((submitted_name, declaration)) |
else: |
> raise AssertionError( |
"figure manifest panel series must be an object or list") |
E AssertionError: figure manifest panel series must be an object or list |
test_outputs.py:1102: AssertionError |
_________ test_scientific_figure_matches_submitted_series_fit_and_band _________ |
def test_scientific_figure_matches_submitted_series_fit_and_band() -> None: |
_analysis, _slope_rows, _report = load_submission() |
reference = independent_reference() |
> image, manifest = load_figure() |
^^^^^^^^^^^^^ |
test_outputs.py:1938: |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
test_outputs.py:1257: in load_figure |
manifest = normalize_figure_manifest(raw_manifest) |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
test_outputs.py:1237: in normalize_figure_manifest |
normalize_panel(panel, palette) |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
panel = {'axis_labels': {'x': 'Electron Energy (keV)', 'y': 'Differential Number Intensity (cm^-2 s^-1 sr^-1 keV^-1)'}, 'axis_...ock': '#277da1', 'precursor_transient': '#2a9d8f', 'primary_transient': '#7b2cbf', 'quiet_background': '#d1495b'}, ...} |
palette = {} |
def normalize_panel( |
panel: dict[str, object], |
palette: dict[str, object], |
) -> dict[str, object]: |
panel_palette = panel.get("palette", {}) |
if not isinstance(panel_palette, dict): |
panel_palette = {} |
effective_palette = { |
**palette, |
**panel_palette, |
} |
axis_labels = panel.get("axis_labels", {}) |
if not isinstance(axis_labels, dict): |
axis_labels = {} |
normalized = { |
"title": panel.get("title"), |
"x_label": panel.get( |
"x_label", |
panel.get("x_axis_label", axis_labels.get("x")), |
), |
"y_label": panel.get( |
"y_label", |
panel.get("y_axis_label", axis_labels.get("y")), |
), |
"event_id": panel.get("event_id"), |
} |
scales = panel.get( |
"axis_scales", |
panel.get("scales", {}), |
) |
if not isinstance(scales, dict): |
scales = {} |
normalized["x_scale"] = panel.get("x_scale", scales.get("x")) |
normalized["y_scale"] = panel.get("y_scale", scales.get("y")) |
limits = panel.get( |
"axis_limits", |
panel.get("limits", {}), |
) |
if not isinstance(limits, dict): |
limits = {} |
normalized["x_limits"] = panel.get("x_limits", limits.get("x")) |
normalized["y_limits"] = panel.get("y_limits", limits.get("y")) |
bounds = panel.get( |
"pixel_bounds_top_left", |
panel.get( |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.