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

Add geospatial averaging #95

Merged
merged 1 commit into from
Oct 4, 2021
Merged

Conversation

tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Aug 19, 2021

Description

This PR is a refactoring effort of PR #87, feature/46-spatial-averaging

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/variable.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
xcdat/averager.py Outdated Show resolved Hide resolved
@tomvothecoder tomvothecoder force-pushed the feature/46-spatial-averaging-tv branch 2 times, most recently from cc7e297 to 384e699 Compare September 20, 2021 22:43
@tomvothecoder tomvothecoder changed the base branch from feature/46-spatial-averaging to main September 20, 2021 22:43
@tomvothecoder tomvothecoder mentioned this pull request Sep 20, 2021
11 tasks
@tomvothecoder tomvothecoder changed the title Refactored version of Feature/46-spatial-averaging Refactored version of PR#87, Feature/46-spatial-averaging Sep 20, 2021
@tomvothecoder tomvothecoder changed the title Refactored version of PR#87, Feature/46-spatial-averaging Refactored version of PR#87, feature/46-spatial-averaging Sep 20, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2021

Codecov Report

Merging #95 (dd47623) into main (2ed55a7) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              main       #95    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            5         6     +1     
  Lines          146       286   +140     
==========================================
+ Hits           146       286   +140     
Impacted Files Coverage Δ
xcdat/__init__.py 100.00% <ø> (ø)
xcdat/bounds.py 100.00% <100.00%> (ø)
xcdat/spatial_avg.py 100.00% <100.00%> (ø)
xcdat/xcdat.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ed55a7...dd47623. Read the comment docs.

@tomvothecoder
Copy link
Collaborator Author

tomvothecoder commented Sep 21, 2021

Hey @pochedls, I squashed the commits recently so your version of this branch may be really out of date. To simplify things, you can checkout main, delete this branch, and checkout the latest version of this branch.

It would be great if you can address the TODO: comments in spatial_avg.py. I'm currently in the process of writing tests as well.

Summary of Recent Changes:

  • Updated the name of the decorator for the spatial averaging accessor from ds.avg.spatial to ds.spatial.avg
  • Updated the parent file name from averager_accessor.py to spatial_avg.py
  • Added xcdat.py, which includes the XCDATAccessor to store all of our public accessor methods under a single namespace.
    • Spatial averaging can be accessed by ds.spatial.avg or ds.xcdat.spatial_avg
  • On PR Update open_dataset and dataset_keep_vars() to limit dataset to only 1 variable #105, xcdat.open_dataset() now limits datasets to a single variable

@tomvothecoder tomvothecoder changed the title Refactored version of PR#87, feature/46-spatial-averaging Add spatial averaging Sep 21, 2021
@tomvothecoder tomvothecoder marked this pull request as draft September 23, 2021 22:28
@tomvothecoder
Copy link
Collaborator Author

tomvothecoder commented Sep 29, 2021

TODOs from 9/29 meeting
@pochedls

  • Finish up TODOs for code documentation
  • Finish up QA of tests
  • Make axis arg in avg() default to `["lat", "lon"]

@tomvothecoder tomvothecoder force-pushed the feature/46-spatial-averaging-tv branch from 72f030c to dd47623 Compare October 4, 2021 20:46
- Calculate the spatial average for a rectilinear grid over a (optional) specified regional domain
@tomvothecoder tomvothecoder force-pushed the feature/46-spatial-averaging-tv branch from dd47623 to 1994b3b Compare October 4, 2021 21:08
@tomvothecoder tomvothecoder marked this pull request as ready for review October 4, 2021 21:09
@tomvothecoder tomvothecoder changed the title Add spatial averaging Add geospatial averaging Oct 4, 2021
@tomvothecoder tomvothecoder merged commit 99851af into main Oct 4, 2021
@tomvothecoder tomvothecoder deleted the feature/46-spatial-averaging-tv branch October 4, 2021 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add grid-aware geospatial averaging (weighted)
3 participants