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 checks / tests for AFIDs coord array shape #10

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

kaitj
Copy link
Contributor

@kaitj kaitj commented Jul 17, 2023

Proposed changes
Check to make sure the number of afids (shape[0]) and the spatial dimensions (shape[1]) match what is expected from the template. This isn't strictly necessary with current code-base, but looking to future proof it if we add other species or subsets of fiducials.

Additionally adds tests to check for the invalid cases by drawing from invalid integers and asserting a substring of the error message is raised.

Closes #9.

Note: The actions checks will always fail due to failed build of the docs (which have not yet been merged and are not part of this PR)

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 kaitj added the maintenance Updates or improvements that do not change functionality of the code label Jul 17, 2023
@github-actions github-actions bot requested a review from tkkuehn July 17, 2023 16:05
@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #10 (1d659b0) into main (8562879) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 1d659b0 differs from pull request most recent head f964fd7. Consider uploading reports for the commit f964fd7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #10   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          133       156   +23     
=========================================
+ Hits           133       156   +23     
Components Coverage Δ
afids_utils/io.py 100.00% <100.00%> (ø)
afids_utils/transforms.py 100.00% <ø> (ø)

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.

This overall looks good and is a good idea, I just have a nitpick about the tests.

@kaitj kaitj force-pushed the maint/io/afids_to_fcsv branch 3 times, most recently from 35b889a to 39e277b Compare August 1, 2023 14:38
Check to make sure the number of afids (shape[0]) and the spatial
dimensions (shape[1]) match what is expected from the template. This
commit additionally adds tests to check for the invalid cases by drawing
from invalid integers and asserting a substring of the error message is
raised.
- Removed `delete=False` in tests where temp file is not explicitly
removed
@kaitj kaitj merged commit ea226cf into afids:main Aug 1, 2023
5 checks passed
@kaitj kaitj deleted the maint/io/afids_to_fcsv branch August 1, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Updates or improvements that do not change functionality of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Add check for afids_to_fcsv
2 participants