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

Custom type definitions #1756

Merged
merged 3 commits into from
May 8, 2024
Merged

Custom type definitions #1756

merged 3 commits into from
May 8, 2024

Conversation

dlakaplan
Copy link
Contributor

In __init__.py defining:

# Something that is a Quantity or can behave like one (with units assumed)
quantity_like = Union[float, np.ndarray, u.Quantity]
# Something that is a Time or can behave like one
time_like = Union[float, np.ndarray, u.Quantity, time.Time]
file_like = Union[str, Path, IO]

that can be used elsewhere (instead of exhaustively repeating those).

@dlakaplan
Copy link
Contributor Author

#1709

@dlakaplan dlakaplan added awaiting review This PR needs someone to review it so it can be merged enhancement labels May 7, 2024
@dlakaplan
Copy link
Contributor Author

Are there other types to add? Or is this sufficient to get started? And should those type definitions by in the top-level __init__.py or elsewhere?

@abhisrkckl
Copy link
Contributor

I think these are good enough to start with. We can add more as needed.

@dlakaplan dlakaplan changed the title WIP: custom type definitions Custom type definitions May 8, 2024
@dlakaplan
Copy link
Contributor Author

OK, probably ready to merge then. This will simplify a few other in-process PRs.

@abhisrkckl abhisrkckl merged commit a52996c into nanograv:master May 8, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review This PR needs someone to review it so it can be merged enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants