Replies: 7 comments 5 replies
-
Welcome and as long as you are nice to others don't worry about etiquette fails. Can you post the code here, and I will be happy to take a look and give you a more detailed answer |
Beta Was this translation helpful? Give feedback.
-
I had a go at implementing this here #1610 |
Beta Was this translation helpful? Give feedback.
-
Can you test this in the new version ? |
Beta Was this translation helpful? Give feedback.
-
Hi Jules,
Sorry, probably not for a couple of weeks. I’m on back-to-back travel this week and for the next two, with next week’s meeting being perhaps one of the most important of my career (whether to continue operating our satellite instrument or not).
Nathaniel
Nathaniel Livesey
Mail Stop 183-701, Jet Propulsion Laboratory
4800 Oak Grove Drive, Pasadena, California 91109.
Phone: +1 818 354-4214 Fax: +1 818 393-5065
From: Jules Chéron ***@***.***>
Date: Thursday, October 27, 2022 at 7:51 AM
To: hgrecco/pint ***@***.***>
Cc: Livesey, Nathaniel J (US 3290) ***@***.***>, Author ***@***.***>
Subject: [EXTERNAL] Re: [hgrecco/pint] Prospects for support of numpy.broadcast_arrays (Discussion #1607)
Can you test this in the new version ?
—
Reply to this email directly, view it on GitHub<https://urldefense.us/v3/__https:/github.com/hgrecco/pint/discussions/1607*discussioncomment-3982089__;Iw!!PvBDto6Hs4WbVuu7!eV-vYUsR-nKWObnFhAGzUPdPINwNT2mDqyRvyZnftiHT6MhUe5cR91e3-GUkfKqk6HQEHW_VDIy5$>, or unsubscribe<https://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/AIX2AVJP2XXQVGNYTOG7TWTWFKCCLANCNFSM6AAAAAARCQ7J7A__;!!PvBDto6Hs4WbVuu7!eV-vYUsR-nKWObnFhAGzUPdPINwNT2mDqyRvyZnftiHT6MhUe5cR91e3-GUkfKqk6HQEHYLJwNKL$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Hernan,
Many thanks, and do bug me again in a couple of weeks if I appear to have forgotten. I won’t mind (that’s the kind of fun work I like to do evenings and weekends when I fancy a change from the NASA bureaucracy).
Yours,
Nathaniel
Nathaniel Livesey
Mail Stop 183-701, Jet Propulsion Laboratory
4800 Oak Grove Drive, Pasadena, California 91109.
Phone: +1 818 354-4214 Fax: +1 818 393-5065
From: Hernan Grecco ***@***.***>
Date: Thursday, October 27, 2022 at 5:02 PM
To: hgrecco/pint ***@***.***>
Cc: Livesey, Nathaniel J (US 3290) ***@***.***>, Author ***@***.***>
Subject: [EXTERNAL] Re: [hgrecco/pint] Prospects for support of numpy.broadcast_arrays (Discussion #1607)
Good luck in your meeting!
—
Reply to this email directly, view it on GitHub<https://urldefense.us/v3/__https:/github.com/hgrecco/pint/discussions/1607*discussioncomment-3986928__;Iw!!PvBDto6Hs4WbVuu7!ditZ65xhJh3h7SPIlDNvTfMYsygM52O8_FykIuhWbTLBgv9GGoTpNSGAkaYDVQMzeDsjk1YTokqB$>, or unsubscribe<https://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/AIX2AVMXJ7DSTR75FB4FSKDWFMCY7ANCNFSM6AAAAAARCQ7J7A__;!!PvBDto6Hs4WbVuu7!ditZ65xhJh3h7SPIlDNvTfMYsygM52O8_FykIuhWbTLBgv9GGoTpNSGAkaYDVQMzeDsjkw9uVHx9$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
can you put that example into code? |
Beta Was this translation helpful? Give feedback.
-
Sure, here goes: 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) Hope this helps. Nathaniel |
Beta Was this translation helpful? Give feedback.
-
Dear all, (This is my first time posting on github, so apologies for any etiquette fails.)
Am I right in concluding that pint does not currently support numpy.broadcast_arrays? What are the prospects that it might do down the road (with subok=True, presumably)?
I'm asking because I'm exploring porting an existing codebase from astropy.units to pint, and I've used broadcast_arrays in several places (though I may be able to work around). Apologies in advance if other similar requests emerge that could have been combined.
Nathaniel Livesey
Beta Was this translation helpful? Give feedback.
All reactions