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

Pytest fails due to weak_type for Quantity arrays #308

Open
TheSkyentist opened this issue Nov 26, 2024 · 2 comments
Open

Pytest fails due to weak_type for Quantity arrays #308

TheSkyentist opened this issue Nov 26, 2024 · 2 comments

Comments

@TheSkyentist
Copy link
Contributor

When a new Quantity is created, the JAX array has the property weak_type=True. This causes errors in some of the pytests, since they expect arrays without this property. I'm not sure what the pros/cons of weak_typing these arrays is, is this the desired behaviour? Based on testing done in #307.

@nstarman
Copy link
Contributor

Weak typing is great! In JAX, weak typing means it's minimizing type conversions while still following Python’s / numpy's built-in numeric types. The weak type gets resolved when promotion is required.
Now making sure that unxt consistently produces weak/strong types across tests / versions / PRs, that's important!

@TheSkyentist
Copy link
Contributor Author

Good to know! I'm glad it's the ideal behaviour in a lot of circumstances.

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

No branches or pull requests

2 participants