Skip to content
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

Add IO functions #3

Merged
merged 6 commits into from
Jun 15, 2023
Merged

Add IO functions #3

merged 6 commits into from
Jun 15, 2023

Conversation

kaitj
Copy link
Contributor

@kaitj kaitj commented Jun 7, 2023

Proposed changes
Adds methods and tests for reading/writing nifti files and afids-associated files.
In addition, took advantage of this branch to make a minor change to the PR template to fix spacing.

Note: This is also being used as a test for Codecov

Types of changes
What types of changes does your code introduce? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (if none of the other choices apply)

Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!

  • Changes have been tested to ensure that fix is effective or that a feature works.
  • Changes pass the unit tests
  • Code has been run through the poe quality task
  • I have included necessary documentation or comments (as necessary)
  • Any dependent changes have been merged and published

Notes
All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.

kaitj added 3 commits June 7, 2023 16:38
- assign reviewers (currently only kaitj and tkkuehn, can add more)
- bump_version for semantic versioning
- release to publish to pypi
- test for linting and unit testing
- add .gitignore and update to ignore test generated files
- add necessary libraries for working with afids
- add test task to poe
- setup type hints for functions
- create exceptions.py to hold custom exceptions
- create io.py for handling input/output methods
- add dummy data (valid fcsv file, small nifti)
  - look into generating images in the future (look at nibabel for
possible solutions?)
- take advantage of commit to fix spacing in PR template
@kaitj kaitj force-pushed the enh/io_functions branch 4 times, most recently from 55a1f03 to 2e40e20 Compare June 7, 2023 21:22
@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@04987b8). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff            @@
##             main        #3   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         3           
  Lines           ?        83           
  Branches        ?         0           
========================================
  Hits            ?        83           
  Misses          ?         0           
  Partials        ?         0           
Components Coverage Δ
afids-utils_io ∅ <0.00%> (?)

- add step to install package
- save report as xml file in the workflow runner
- add gha to post coverage report
@kaitj kaitj self-assigned this Jun 7, 2023
@kaitj kaitj requested a review from tkkuehn June 7, 2023 21:44
@kaitj
Copy link
Contributor Author

kaitj commented Jun 7, 2023

This should be good for a first look. Still missing a few methods, but wanted to get something in so that we can configure the coverage as we want. It's currently set with a 5% threshold (e.g. it should fail if coverage falls below 95% - I think this is overall and not individual components but I might be wrong).

Copy link
Contributor

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of changes I think would be nice, and I didn't really look at the codecov stuff in depth at this point (I figure once we're getting reports for sure I can take a closer look)

afids_utils/io.py Outdated Show resolved Hide resolved
afids_utils/io.py Outdated Show resolved Hide resolved
afids_utils/io.py Outdated Show resolved Hide resolved
afids_utils/io.py Outdated Show resolved Hide resolved
afids_utils/tests/test_io.py Outdated Show resolved Hide resolved
afids_utils/tests/test_io.py Outdated Show resolved Hide resolved
afids_utils/tests/test_io.py Outdated Show resolved Hide resolved
- Renamed AFIDS_FIELDNAMES -> FCSV_FIELDNAMES
- Update 'id' column fieldname to match slicer header
- Use `usecols` in read_csv call
- Change afid_coords from a numpy array to a composite strategy using
hypothesis.extra.numpy.array
- rm assignment of get_afid in test_invalid_num_get_afid
- rm load_nii function and normalization (can use other packages like
sklearn for this)
- added fcsv template as static file under resources that can be
imported rather than called in function
@kaitj kaitj requested a review from tkkuehn June 15, 2023 14:42
@kaitj kaitj merged commit 335de62 into afids:main Jun 15, 2023
6 checks passed
@kaitj kaitj deleted the enh/io_functions branch June 15, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants