amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

quantities: Make mean() more generic. #1039

Closed Sbte closed 4 months ago

Sbte commented 4 months ago

I ran into this while trying to pass the where argument to numpy.mean().

LourensVeen commented 4 months ago

Looks fine to me. It does extend the AMUSE API to match all of the numpy API (and it means we'll evolve with numpy if they change) but we're doing that already for median(), so I'd say that's alright.

Is there any particular usage you have that you want to add a test for?

Sbte commented 4 months ago

Thanks for the review Lourens. I added a test. I'm not sure why the tests are numbered instead of using meaningful names like test_mean, but I followed the same pattern.

Sbte commented 4 months ago

Ah, perfect. I changed the name.