Conversation
|
i like this. only thing id like to see is that were still backward compatible to older cfel results json without the subs info. i think all that means for this pr is that rather than replace old tests json files, we add new ones and then write tests conditionally. possibly drhip should produce a warning for older json. |
|
I like the idea of DRHIP producing a warning for an older json without the 'substitutions' field. All the other json fields are identical between old and new jsons, so backwards compatibility shouldn't be an issue. I'm happy to add old versions of the json test files + conditional tests if you'd prefer, though. |
|
yea the concern is to make sure we know rather than assume we wont err if were missing certain 'expected' fields. too easy for someone (me, 6 months from now when i dont remember this pr) to modify something that may break this assumption. other fields we may want to err if missing.. |
|
Okay, I've added some results json field validation code. If you like it, I'm happy to merge what we've got into the main branch |
|
Being explicit about required fields makes me happier, thanks. Looks like we included cfel subs in the required list though? And this doesn't really protect us against the case where someone introduces some logic that will err if the subs field is missing even if it's not explicitly declared required. But merge if you like, and I can always look at it later too. |
|
A lot of the internal code already checks to see if required fields are present before trying to calculate, for example, majority residue. If a required field isn't present for calculating a given thing, DRHIP warns the user that the required field isn't present in the results json, and that the thing isn't present in the output. For me, this covers the case where we're using old CFEL results that don't have the substitutions field - DRHIP will still produce what output it can, but it will warn that one of the required fields is missing from CFEL and skip a few fields as a result. If we wanted to be stricter, we could always force DRHIP to quit with an error if a required field isn't present in the input data, or add a |
Summary
New tests
tests/test_cfel_Beta_and_Qvalue_updates.py:CfelMethod.get_comparison_group_site_fields()tests/test_cfel_comparison_outputs.py:combined_comparison_summarytests/test_cli.pyto ensure deterministic checks (sorting output CSVs to ensure that the first gene in the output matches the first output item checked in the assertions).Version
drhip/version.pybumped to 0.1.3.