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

Vector operations with quantities #378

Open
adrn opened this issue Feb 12, 2025 · 1 comment
Open

Vector operations with quantities #378

adrn opened this issue Feb 12, 2025 · 1 comment

Comments

@adrn
Copy link
Contributor

adrn commented Feb 12, 2025

I think we should add dispatches for some operators between vectors and quantities. For example:

vec = cx.CartesianPos3D.from_([1., 2., 3.], "kpc")
q = u.Quantity(1., "kpc")
vec / q  # CartesianPos3D with dimensionless unit 
vec * q  # CartesianPos3D with kpc**2 unit

Thoughts?

@nstarman
Copy link
Contributor

Yes. These should become CartesianGeneric3D (should probably be renamed to just Cartesian3D)

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