-
Notifications
You must be signed in to change notification settings - Fork 24
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
Moving karyotype
to anoph
#702
base: master
Are you sure you want to change the base?
Conversation
I added tests to |
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.
Hi @jonbrenas, thanks for this, a few suggestions...
if not self._inversion_tag_path: | ||
raise FileNotFoundError( | ||
"The file containing the inversion tags is missing." | ||
) |
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.
FileNotFoundError
isn't quite the right exception class here.
if not self._inversion_tag_path: | |
raise FileNotFoundError( | |
"The file containing the inversion tags is missing." | |
) | |
if self._inversion_tag_path is None: | |
raise NotImplementedError( | |
"No inversion tags are available for this data resource." | |
) |
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 have been of two minds about this one: on one hand, it is true that we have not generated the tags for Af1
and one could argue that NotImplementedError
is a more appropriate error for work that is still to be done; on the other hand, the code itself would (I think) work if the file actually existed and it is thus less an issue of missing code and more an issue of a missing input. Also, I can imagine a situation where someone created tags for an inversion and would want to try to use their local file (it is not currently possible, the path that is used is hard-coded in both Ag3
and Af1
) in which case the error would come from the path being incorrect (though, an error message referring to the actual path inputed would be more helpful if we want to offer this option).
tests/integration/test_af1.py
Outdated
if inversion == "X_x": | ||
with pytest.raises(TypeError): | ||
af1.karyotype( | ||
inversion=inversion, sample_sets="AG1000G-GH", sample_query=None | ||
) | ||
else: | ||
with pytest.raises(FileNotFoundError): | ||
af1.karyotype( | ||
inversion=inversion, | ||
sample_sets="1229-VO-GH-DADZIE-VMF00095", | ||
sample_query=None, | ||
) |
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.
All inversion
parameter values should fail with NotImplementedError
I think.
The other question here is if/how to get unit tests using the simulated data. It could be tricky because the simulated data is not guaranteed to generate data at the tag SNP positions. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Thanks @alimanfoo. I made most of the changes you recommended. As for the tests, I created another issue #700 to deal with it independently of this as I agree that it is not trivial. |
Addresses #698.
The move is done and all tests pass locally but more tests need to be added (for funestus, for example).