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

Enable mismatching dimensions in broadcast_arrays #1928

Open
njlivesey opened this issue Jan 27, 2024 Discussed in #1607 · 0 comments
Open

Enable mismatching dimensions in broadcast_arrays #1928

njlivesey opened this issue Jan 27, 2024 Discussed in #1607 · 0 comments

Comments

@njlivesey
Copy link

It's great to have broadcast_arrays working, but I'm not sure we need to require matching dimensionality. (Sorry if I should have moved this from a discussion to an issue sooner.)

Consider

import numpy as np
import pint

ureg = pint.UnitRegistry()

T = np.ones(shape=[10,1]) * 250.0 * ureg.K
v = np.ones(shape=[1,10]) * 10.0 * ureg.m / ureg.s
rho = np.ones(shape=[10,10]) * ureg.kg / ureg.m**3       
        
T, v, rho = np.broadcast_arrays(T, v, rho)

Many thanks

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

1 participant