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

[Doc]: temporal average no longer takes freq? #406

Closed
lee1043 opened this issue Jan 23, 2023 · 3 comments · Fixed by #407
Closed

[Doc]: temporal average no longer takes freq? #406

lee1043 opened this issue Jan 23, 2023 · 3 comments · Fixed by #407
Assignees
Labels
type: docs Updates to documentation

Comments

@lee1043
Copy link
Collaborator

lee1043 commented Jan 23, 2023

Describe your documentation update

In the example of temporal average doc,

ds_month = ds.temporal.average("ts", freq="month")
ds_month.ts

But in my test with latest xcdat it returns

TypeError: TemporalAccessor.average() got an unexpected keyword argument 'freq'

I cannot recall we removed freq from temporal average, but if so, doc needs update accordingly.

@lee1043 lee1043 added the type: docs Updates to documentation label Jan 23, 2023
@pochedls
Copy link
Collaborator

Good catch. Did you want group_average() or should average take freq? I've never used this function so I don't remember the history.

The line that needs updating (to correct the documentation) is here: https://github.com/xCDAT/xcdat/blob/main/xcdat/temporal.py#L191.

@lee1043
Copy link
Collaborator Author

lee1043 commented Jan 23, 2023

@pochedls Thanks for your comment. @pochedls @tomvothecoder please correct me if I am wrong, but I think we have separated group_average from average, so group_average can get annual cycle (12 time points if monthly) or seasonal mean (4 time points) or more, while average returns overall average (thus, one time point). In such case, I think it makes sense to not have freq option for average.

@tomvothecoder
Copy link
Collaborator

@pochedls Thanks for your comment. @pochedls @tomvothecoder please correct me if I am wrong, but I think we have separated group_average from average, so group_average can get annual cycle (12 time points if monthly) or seasonal mean (4 time points) or more, while average returns overall average (thus, one time point). In such case, I think it makes sense to not have freq option for average.

Hey @lee1043, you are correct here.

.average() collapses the time dimension. freq was removed from the method parameters and is instead inferred from the variable's time coordinates (_infer_freq).

We'll just need to update the .average() example to remove freq. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs Updates to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants