uxarray icon indicating copy to clipboard operation
uxarray copied to clipboard

Topological Aggregations: (Node to Edge) and (Node to Face)

Open philipc2 opened this issue 11 months ago • 4 comments

Closes #719 #718 #713 #712

Overview

  • Link to User Guide section on Topological Aggregations
  • Implements localized reductions on top of the standard global reductions provided by Xarray. These reductions utilize connectivity information for perform localized reductions (i.e. the average of all the nodes that surround each face)
    • mean
    • max
    • min
    • prod
    • sum
    • std
    • var
    • median
    • all
    • any

philipc2 avatar Mar 07 '24 10:03 philipc2

@erogluorhan

I'm going to pick this PR back up and address the changes that we've discussed in #724

Below are the following changes I'm going to make

  • Use the term "aggregation" instead of "reductions" when referring to functions such as mean, max, any, etc.
  • Instead of overloading Xarray's methods, create new ones using names such as topological_mean()

This would look like the following in our API

# assume some uxds with a `vorticity_200hPa` variable (node-centered)
uxds = ...

# standard xarray mean
uxds['vorticity_200hPa'].mean()

# topological (i.e. grid informed) mean, average of nodes stored on each face
uxds['vorticity_200hPa'].topological_mean(destination='face')

# topological (i.e. grid informed) mean, average of the nodes composed each edge.
uxds['vorticity_200hPa'].topological_mean(destination='edge')

What do you think? I'd like to really move forward with this functionality and get the performance improvements in.

philipc2 avatar May 07 '24 00:05 philipc2

Yes, all sounds good!

erogluorhan avatar May 07 '24 19:05 erogluorhan

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

I'd really appreciate some help proof reading and checking for any typos in the new functions that I added, especially in the docstrings.

While reviewing, I also suggest looking over the user guide section I made for topological reductions. I'm really happy with how it turned out, and hope we can start making these sections for all of our functionality.

https://uxarray--711.org.readthedocs.build/en/711/user-guide/topological-aggregations.html

philipc2 avatar May 15 '24 19:05 philipc2

@rytam2

This is the pull request we briefly discussed last Monday. Whenever you wrap up with some of the other internship tasks, you can get started with reviewing this one!

philipc2 avatar Jun 17 '24 16:06 philipc2

Looks good! Any reason why we aren't supporting face and edge centered data variables yet though?

Thanks for the review! @rytam2 will be helping get support for those two methods this summer.

philipc2 avatar Jun 21 '24 20:06 philipc2