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 additional strategy and helpers.py #34

Merged
merged 4 commits into from
Sep 26, 2023
Merged

Conversation

kaitj
Copy link
Contributor

@kaitj kaitj commented Sep 11, 2023

Proposed changes

Tried to reduce the rewriting of common settings and generation of valid characters. To that end:

  • Added an additional strategy to generate valid characters (re: alphabets) that can be used to generate desc, ext, etc. entities. There should also be a way to do this from hypothesis strategies itself, but did not find it intuitive.
  • Created helper functions for common settings that are called for various tests, namely allowing scoped functions and changing test deadlines.

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 Sep 11, 2023
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #34 (f514956) into main (b55fdee) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #34   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9        10    +1     
  Lines          656       665    +9     
=========================================
+ Hits           656       665    +9     
Components Coverage Δ
afids_utils/afids.py ∅ <ø> (∅)
afids_utils/ext 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.

A couple of minor comments, one of which doesn't need to be addressed here necessarily.

This also needs a merge from main

afids_utils/tests/strategies.py Outdated Show resolved Hide resolved
afids_utils/tests/test_afids.py Outdated Show resolved Hide resolved
- update AfidPosition dunder to perform subtraction along spatial
  dimensions
- add compute_AFLE method to compute and return errors along each
  spatial dimension, as well as afle
- Reduce the number of lines in each test by setting hypothesis settings
by defining callable functions in helpers.py
- Simplify generation of valid characters by adding strategy for
  generating valid characters
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.

Looks good! Side note: We should add pyright to this project given that a lot of the typing is there already

@kaitj
Copy link
Contributor Author

kaitj commented Sep 26, 2023

Yes, I agree. I'll throw that into a separate PR.

@kaitj kaitj merged commit 71c3a0f into afids:main Sep 26, 2023
7 checks passed
@kaitj kaitj deleted the maint/af_st branch October 31, 2023 15:12
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.

2 participants