UXARRAY / uxarray

Xarray-styled package for reading and directly operating on unstructured grid datasets following UGRID conventions
https://uxarray.readthedocs.io/
Apache License 2.0
139 stars 30 forks source link

Use Vectorized Coordinate Conversion Everywhere #790

Open philipc2 opened 1 month ago

philipc2 commented 1 month ago
          > https://github.com/UXARRAY/uxarray/issues/730 sounds good to me regarding the code-base changes. Actually, not only Hongyu's helpers, but I believe we should aim to change all of such calls to vectorized calls for optimization purposes, and I think if it is too much for this PR, it can be handled as part of Rachel's optimization efforts.

Agreed, the following modules are the ones I was able to find that still call these functions iteratively.

The same applies to test case changes; I think we need to address them either as part of this PR or create an issue for that and deal with it soon. BTW, the changes would even help with the tests' execution times in our CI action runs, right? I also think the changes should be straightforward to still keep testing for arrays rather than scalars, similar to what you did here, right?

I can make changes to the test cases where appropriate. It should be a simple fix.

_Originally posted by @philipc2 in https://github.com/UXARRAY/uxarray/pull/748#discussion_r1602253324_