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

genutil.statistics.mean does not exists #5

Open
chaosphere2112 opened this issue Nov 23, 2016 · 9 comments
Open

genutil.statistics.mean does not exists #5

chaosphere2112 opened this issue Nov 23, 2016 · 9 comments
Labels
kind/feature Categorizes issue as related to feature request
Milestone

Comments

@chaosphere2112
Copy link

because MV2.average does pretty much the same thing

but this would allow to use nifty axis='t' or axis='xy' or axis='(my_axis_name)'

Migrated from: CDAT/cdat#1569

@doutriaux1 doutriaux1 added this to the 2.12 milestone May 8, 2017
@doutriaux1 doutriaux1 self-assigned this Sep 6, 2017
@doutriaux1 doutriaux1 modified the milestones: 3.0, 2.12 Sep 6, 2017
@doutriaux1 doutriaux1 modified the milestones: 3.0, Next Release Mar 29, 2018
@github-actions
Copy link

Marking issue as stale, since there has been no activity in 30 days.

Unless the issue is updated or the 'stale' tag is removed, this issue will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 27, 2020
@durack1
Copy link
Member

durack1 commented Aug 27, 2020

@jasonb5 this is related to the fact that cdms/cdutil etc all had their origin in numeric, before numpy and as numeric didn't include all the functionality that numpy now has, basic stats function were created and are now duplicated by the numpy variants, assuming numpy is wrapped correctly to expose all the functions. The MV2 library could mostly be deprecated in favour of numpy pure functions, or alternatively MV2 just calls the numpy functions directly (preserving the cdms transient variable attributes of course)

@jypeter
Copy link
Member

jypeter commented Aug 28, 2020

I totally agree with accessing numpy (more likely numpy.ma) with MV2, in order to preserve attributes would be very useful!

It could be useful to add a new compute_history attribute to the variable specifying which function was applied, and append this if there is a pre-existing compute_history attribute (same way the history global attribute works in nc files)

Because in some cases, the original name/units of the variable may not mean anything after applying the numpy function

@durack1
Copy link
Member

durack1 commented Aug 28, 2020

@jypeter another good idea, so similar to how nco operates with appending to the history global attribute with a summary of what was done.

I am sure @pochedls will also have some ideas around this

@jasonb5
Copy link
Contributor

jasonb5 commented Aug 28, 2020

The MV2 module already wraps numpy.ma functions. I see there is an average but not mean in MV2, I can add this.

As for history recording, we're planning on adding provenance support in the next-gen CDMS2.

@durack1
Copy link
Member

durack1 commented Aug 28, 2020

@jasonb5 thanks for the update, when we talked about this a long time ago, I was suggesting that removing the duplication in MV2 by rather wrapping all the numpy.ma functions was a good idea, which means that if numpy.ma adds another function (or bugfix) we get this in CDMS for free with no maintenance overhead for you folks

@jasonb5
Copy link
Contributor

jasonb5 commented Aug 28, 2020

Ah I see what you mean, this is inline with the next-gen CDMS where MV2 will be absorbed into the Variable class. As this would be a fairly large change for the current implementation, we'll handle it in the next.

@durack1
Copy link
Member

durack1 commented Aug 28, 2020

Perfect, that sounds like we're on the same page here

@github-actions
Copy link

Marking issue as stale, since there has been no activity in 30 days.

Unless the issue is updated or the 'stale' tag is removed, this issue will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 27, 2020
@jasonb5 jasonb5 added kind/feature Categorizes issue as related to feature request and removed enhancement stale labels Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue as related to feature request
Projects
None yet
Development

No branches or pull requests

5 participants