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

Use jaxtyping #351

Merged
merged 21 commits into from
Mar 21, 2024
Merged

Use jaxtyping #351

merged 21 commits into from
Mar 21, 2024

Conversation

faridyagubbayli
Copy link
Collaborator

@faridyagubbayli faridyagubbayli commented Mar 19, 2024

Closes #350

Replaces nptyping with jaxtyping. Latter is better maintained and includes up-to-date practices. Also added an alias for beartype in imports which should allow us to swap type checker quickly in the future, if we want to.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 98.93617% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 67.77%. Comparing base (0911060) to head (e7954cb).

Files Patch % Lines
kwave/utils/atten_comp.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #351   +/-   ##
=======================================
  Coverage   67.76%   67.77%           
=======================================
  Files          48       48           
  Lines        7066     7068    +2     
  Branches     1605     1605           
=======================================
+ Hits         4788     4790    +2     
- Misses       1697     1698    +1     
+ Partials      581      580    -1     
Flag Coverage Δ
3.10 67.92% <98.93%> (+<0.01%) ⬆️
3.11 67.92% <98.93%> (+<0.01%) ⬆️
3.12 67.92% <98.93%> (+<0.01%) ⬆️
3.9 67.73% <98.93%> (+<0.01%) ⬆️
ubuntu-latest 67.71% <98.93%> (+<0.01%) ⬆️
windows-latest 67.71% <98.93%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@faridyagubbayli faridyagubbayli marked this pull request as draft March 19, 2024 23:12
@waltsims
Copy link
Owner

Fast progress 🏎️

@faridyagubbayli faridyagubbayli self-assigned this Mar 20, 2024
@faridyagubbayli faridyagubbayli marked this pull request as ready for review March 20, 2024 11:22
@faridyagubbayli
Copy link
Collaborator Author

Tested example notebooks locally, didn't encounter a problem.

Copy link
Owner

@waltsims waltsims 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 to me!

Non-blocking: Should we add a test for Billy's issue?

diameter: Union[NDArray[Shape["NumElements, 2"], Float], NDArray[Shape["2, NumElements"], Float]],
amplitude: NDArray[Shape["NumElements"], Float],
phase: NDArray[Shape["NumElements"], Float],
diameter: Union[Float[np.ndarray, "NumElements 2"], Float[np.ndarray, "2 NumElements"]],
Copy link
Owner

Choose a reason for hiding this comment

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

Should we try to be consistent about typing np.ndarray vs ndarray?

@waltsims waltsims merged commit fbef132 into master Mar 21, 2024
112 checks passed
@waltsims waltsims deleted the 350-use-jaxtyping branch March 21, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use jaxtyping for typing
2 participants