-
Notifications
You must be signed in to change notification settings - Fork 3
Add SWXSOC Science Filename Parsing Test for Instrument Package Compliance #6
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
base: main
Are you sure you want to change the base?
Conversation
def test_science_filename_errors_l1_b(): | ||
with pytest.raises(ValueError): | ||
# _ character in mode | ||
util.create_science_filename( | ||
"eeb", | ||
time="12345345", | ||
descriptor="eventlist", | ||
level=good_level, | ||
version=good_version, | ||
mode="o_o", | ||
) | ||
with pytest.raises(ValueError): | ||
# _ character in descriptor | ||
util.create_science_filename( | ||
"eeb", | ||
time="12345345", | ||
level=good_level, | ||
version=good_version, | ||
descriptor="blue_green", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be combined with the test above test_science_filename_errors_l1_a
Also I'd consider renaming these functions.
) | ||
|
||
|
||
def test_parse_science_filename_output(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we parameterize this?
# fmt: on | ||
|
||
|
||
def test_science_filename_output_b(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be combined with above and parameterized?
# wrong instrument name | ||
f = "hermes_www_2s_l3test_burst_20240406_120621_v2.4.5" | ||
util.parse_science_filename(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will be executed if the first part raises a ValueError
This PR refactors the
padre_sharp
instrument package to add back thecreate_science_filename
functions and oldutil
test suite so they can be managed by the instrument package team.It also adds the
test_validate_swxsoc_science_filename
test to ensure that instrument teams can define their owncreate_science_filename
implementations while maintaining compliance with the SWXSOC naming convention.The test will be added to all other instrument packages after this PR, test for reference: