Repository navigation
89 increase number of pack based error testing - #90
Tedsmith100 wants to merge 13 commits into
Conversation
in `window_wf_check`
in `window_overlap_check`
to catch errors sooner
for config error catching
To look for specific errors
small bug fix in `check_save_path` in proc, similar to one used in ana
|
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
left a comment
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Why was there a factor 1/2 here?
There was a problem hiding this comment.
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] | |||
|
|
|||
There was a problem hiding this comment.
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] | |||
| overwrite = True | ||
| save_path = 'test.h5' | ||
|
|
||
| mules = 'bad' No newline at end of file |
| with raises(subprocess.CalledProcessError): | ||
| subprocess.run(run_pack, check = True) No newline at end of file |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
add a comment saying what this actually does (check the error name compared to that in the raises condition)
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).