-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor(io): Load files with AFMReader #1031
Conversation
8f1c59e
to
0282945
Compare
I might have to think about/revise the use of |
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.
Love a PR that reduces the codebase!
This is neat and tidy, agree that using .pop
would be nice to replace with a more elegant solution in the future, perhaps by automatically removing them from the returned dictionary in AFMReader
and passing the image, pixel scaling and file version as separate returns (image, scaling, version, data) so we don't have to pop them in each stage like you mentioned we will have to.
Thanks for the review and approval.
I'm going to change this now, otherwise it will linger and get forgotten about. |
Also just noticed I van remove |
In light of switching to AFMReader to load files and consistently loading and failing with a `FileNotFoundError` when files do not exist we can parameterize the tests that check the appropriate error is raised.
0282945
to
0ef9be3
Compare
Change of heart, going to address this as part of the Swiss army knife work as I don't wish to hold up the pending version release, but have removed the redundant |
Closes #1036 With the delegation of much I/O (Input/Output) functionality to @SylviaWhittle `AFMReader` (see #1031) we have removed most of the methods to the `io.LoadScan()` class. One that slipped through was `_spm_pixel_to_nm_scaling()` and this commit removes it along with its associated test. Further the delegation of reading AFM files using `AFMReader` means `TopoStats` no longer has explicit dependencies on the `igor2`, `pySPM` or `tifffile` packages and so these have been removed from the `dependencies` section of `pyproject.toml`. These are dependencies of `AFMReader` and will still be installed in virtual environments.
Closes #1036 With the delegation of much I/O (Input/Output) functionality to @SylviaWhittle `AFMReader` (see #1031) we have removed most of the methods to the `io.LoadScan()` class. One that slipped through was `_spm_pixel_to_nm_scaling()` and this commit removes it along with its associated test. Further the delegation of reading AFM files using `AFMReader` means `TopoStats` no longer has explicit dependencies on the `igor2`, `pySPM` or `tifffile` packages and so these have been removed from the `dependencies` section of `pyproject.toml`. These are dependencies of `AFMReader` and will still be installed in virtual environments.
Closes #1036 With the delegation of much I/O (Input/Output) functionality to @SylviaWhittle `AFMReader` (see #1031) we have removed most of the methods to the `io.LoadScan()` class. One that slipped through was `_spm_pixel_to_nm_scaling()` and this commit removes it along with its associated test. Further the delegation of reading AFM files using `AFMReader` means `TopoStats` no longer has explicit dependencies on the `igor2`, `pySPM` or `tifffile` packages and so these have been removed from the `dependencies` section of `pyproject.toml`. These are dependencies of `AFMReader` and will still be installed in virtual environments. Moved `pytest-testmon` from `tests` to `dev` under optional dependencies as its not used when running the test suite, only when making commits locally.
Refactors
topostats/io.py
to useAFMReader
to load all files.Almost everything works as expected with the exception of
.ibw
where AFMReader raises anUnboundLocalError
if a file is not asimage
is created asNone
rather than raisingFileNotFound
error. This is captured in Consistently raise FileNotFound errors across each load_*() functions. #80 and for now the on test that is affected has been marked aspytest.mark.xfail()
as it is expected to fail.I was perhaps a little hasty in making a release of
AFMReader v0.0.2
which I realised early on as being required so that tests pass in Continuous Integration.Items that are Not Applicable have been
struck through.Documentation has been updated and builds. Remember to update as required...docs/configuration.md
docs/usage.md
docs/data_dictionary.md
docs/advanced.md
and new pages it should link to.New functions/methods have typehints and docstrings.New functions/methods have tests which check the intended behaviour is correct.