-
Notifications
You must be signed in to change notification settings - Fork 12
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
increase coverage to 100% (test ALL AMBER files and all of __init__) #74
Conversation
0f259fa
to
416e971
Compare
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
==========================================
+ Coverage 90.13% 99.34% +9.21%
==========================================
Files 11 11
Lines 152 152
Branches 19 19
==========================================
+ Hits 137 151 +14
+ Misses 15 1 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
- fix #49 - add custom tests (with hacked accessors) for the AMBER BACE example and invalidfiles
43d12bd
to
ef594e6
Compare
@xiki-tempula I added tests for all current AMBER files. The ones for invalid files will change with PR #71 (and my hack can then be removed) but at least we now have a clear baseline. It also documents the non-API behavior of the BACE example. |
def _load_bace_example_complex(): | ||
dset = load_bace_example() | ||
return Bunch(data=dset.data['complex'], | ||
DESCR="BACE example: complex") | ||
|
||
# class TestInvalidFiles(BaseDatasetTest): | ||
# # can't get the list of list in data | ||
# @pytest.fixture(scope="class", | ||
# params = [(load_invalidfiles, (slice(None),), (6,)), | ||
# ]) | ||
# def dataset(self, request): | ||
# return super().dataset(request) | ||
def _load_bace_example_solvated(): | ||
dset = load_bace_example() | ||
return Bunch(data=dset.data['solvated'], | ||
DESCR="BACE example: solvated") |
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.
There might be a way to reduce code duplication but I didn't see anything clean right away so I opted for clear copy&paste for what hopefully remains the single exception.
# use pytest.param to add the id for nicer pytest -v output | ||
@pytest.fixture(scope="class", | ||
params = [ | ||
pytest.param( |
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.
using param is not strictly necessary but I wanted to show how to make thr verbose output a bit clearer (instead of "dataset0" and "dataset1").
def _load_labelled_invalidfiles(): | ||
dset = load_invalidfiles() | ||
return Bunch(data={'invalid_files': dset.data[0]}, | ||
DESCR=dset.DESCR) | ||
|
||
class TestInvalidFiles(BaseDatasetTest): | ||
@pytest.fixture(scope="class", | ||
params = [(_load_labelled_invalidfiles, | ||
('invalid_files',), (6,)), | ||
]) | ||
def dataset(self, request): | ||
return super(TestInvalidFiles, self).dataset(request) |
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.
This should be superseded with PR #71 and then the load_testfiles()
can be added to the TestAMBER
class above.
- test Bunch - test __version__
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.
LGTM
for the AMBER BACE example and invalidfiles)
__init__.py
(Bunch
and__version__
)