Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Future-proof test_data_quality_plugin #3403

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,17 @@ def test_data_quality_plugin(imviz_helper, tmp_path):

# check that the decomposed DQ flag is at the end of the flux label's line:
flux_label_idx = label_mouseover_text.index(expected_flux_label)
assert label_mouseover_text[flux_label_idx + len(expected_flux_label) + 1:] == '(DQ: 3)'
associated_dq_layer = dq_plugin.get_dq_layers(viewer)[0]
dq_data = associated_dq_layer.layer.get_data(associated_dq_layer.state.attribute)
dq_val = dq_data[708, 1366]
assert label_mouseover_text[flux_label_idx + len(expected_flux_label) + 1:] == f'(DQ: {dq_val:.0f})' # noqa: E501

# check that a flagged pixel that is not marked with the bit 0 has a flux in mouseover label:
label_mouseover._viewer_mouse_event(viewer,
{'event': 'mousemove', 'domain': {'x': 1371, 'y': 715}})
label_mouseover_text = label_mouseover.as_text()[0]
assert label_mouseover_text.split('+')[1].endswith('(DQ: 4)')
dq_val = dq_data[715, 1371]
assert label_mouseover_text.split('+')[1].endswith(f'(DQ: {dq_val:.0f})')

# check that a pixel without a DQ flag has no DQ mouseover label:
label_mouseover._viewer_mouse_event(viewer,
Expand Down
Loading