Skip to content

89 increase number of pack based error testing - #90

Open
Tedsmith100 wants to merge 13 commits into
nu-ZOO:mainfrom
Tedsmith100:89-increase-number-of-pack-based-error-testing
Open

Tedsmith100 wants to merge 13 commits into
nu-ZOO:mainfrom
Tedsmith100:89-increase-number-of-pack-based-error-testing

Conversation

@Tedsmith100

Copy link
Copy Markdown
Contributor

Added config check tests for ana.
Also changed proc config check test to be error type specific (to match ana check test).
In doing this I found a slight bug in proc, which I fixed by making the save path absolute (something I had already had to do for ana save path).

@Tedsmith100
Tedsmith100 requested a review from a team October 7, 2026 12:52
@Tedsmith100

Copy link
Copy Markdown
Contributor Author

Also the first commits (remove 1/2 factors) are where I found inconsistencies between my baseline windows calculations and the tests that stop them overlapping

@jwaiton jwaiton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some light changes, and some thoughts about the PR. Overall good work!

BASELINE_RANGE_1 = window_args['BASELINE_RANGE_1']
BASELINE_RANGE_2 = window_args['BASELINE_RANGE_2']
if WINDOW_START>length or WINDOW_END>length or BASELINE_POINT_1+BASELINE_RANGE_1/2>length or BASELINE_POINT_2+BASELINE_RANGE_2>length:
if WINDOW_START>length or WINDOW_END>length or BASELINE_POINT_1+BASELINE_RANGE_1>length or BASELINE_POINT_2+BASELINE_RANGE_2>length:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was there a factor 1/2 here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worth including something in the commit description to explain why this happened, considering you're the creator that included them initially ;)

@@ -0,0 +1,20 @@
[required]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the configs that are just 'missing argument' can be generalised with a fixture, lets sit down and I can show you how to do this soon :)

@@ -0,0 +1,23 @@
[required]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in config name

overwrite = True
save_path = 'test.h5'

mules = 'bad' No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rude

Comment thread packs/tests/setup_test.py Outdated
Comment on lines +92 to +93
with raises(subprocess.CalledProcessError):
subprocess.run(run_pack, check = True) No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a good catch, as a subprocess.CalledProcessError just means 'this broke'. You want an error to be descriptive and provide information to the user about what they've screwed up.

I'd include some sort of response for missing arguments, we can brainstorm this if you like, IC has a good mechanism for doing this, maybe MULE does too! (probably not)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved later when you include a check for the type, but I believe this can instead be a requirement within the raises conditional, rather than checking for it later.

Comment thread packs/tests/setup_test.py
subprocess.run(run_pack, check = True)
with raises(subprocess.CalledProcessError) as excinfo:
subprocess.run(run_pack, check=True, capture_output=True, text=True)
assert error.__name__ in excinfo.value.stderr

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment saying what this actually does (check the error name compared to that in the raises condition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants