Type checking - #301
Draft
samaloney wants to merge 1 commit into
Draft
Conversation
KriSun95
approved these changes
Aug 27, 2026
KriSun95
left a comment
Collaborator
There was a problem hiding this comment.
Adding types to be explicit is a great idea. I'd imagine this is something we'll continue to edit and adopt as we keep building too.
| data_y: NDArray[np.float64], | ||
| model_x: NDArray[np.float64], | ||
| model_func: Any, | ||
| statistic_func: Callable[[NDArray[np.float64], NDArray[np.float64]], float], |
Collaborator
There was a problem hiding this comment.
How does this work if the Callable can have keyword arguments other varying inputs?
Comment on lines
+105
to
+113
| p: Any = p.default, | ||
| break_energy: Any = u.Quantity(break_energy.default, break_energy.unit), # pyright: ignore[reportArgumentType] | ||
| q: Any = q.default, | ||
| low_e_cutoff: Any = u.Quantity(low_e_cutoff.default, low_e_cutoff.unit), # pyright: ignore[reportArgumentType] | ||
| high_e_cutoff: Any = u.Quantity(high_e_cutoff.default, high_e_cutoff.unit), # pyright: ignore[reportArgumentType] | ||
| total_eflux: Any = u.Quantity(total_eflux.default, total_eflux.unit), # pyright: ignore[reportArgumentType] | ||
| integrator: Any = None, | ||
| **kwargs: Any, | ||
| ) -> None: |
Collaborator
There was a problem hiding this comment.
I think all of these in __init__ should be Astropy quantities even if dimensionless.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
If we're want to this it would be good to agree and merge sooner rather than later as touches nearly every file.
If we don't want the types inline could move them to stubs files
AI Assistance Disclosure
Help figure out some of the types and specific inline ignores and configuration
AI tools were used for: