UXarray Redesign Thoughts and Options #185
Replies: 9 comments 55 replies
-
1. Current API (e.g. xgcm) Description: The API backbone is the Example:
Pros:
Cons:
|
Beta Was this translation helpful? Give feedback.
-
2. Former API Description: The API backbone was still the Example:
Pros:
Cons:
|
Beta Was this translation helpful? Give feedback.
-
3. Registering Description:
Thus, with any We could even define Example:
Pros:
Cons:
|
Beta Was this translation helpful? Give feedback.
-
4. Inheriting (i.e. subclassing) I will skip describing this and giving an example as I suppose we’d know what inheritance would look like (I can still provide if needed though). I will share a few Pros/Cons and say we should avoid due to the cons/costs with it. Pros:
Cons:
|
Beta Was this translation helpful? Give feedback.
-
@erogluorhan could you include in your examples how an Xarray function that does not require grid information would be invoked? For example, returning the minimum value of the field. Thanks |
Beta Was this translation helpful? Give feedback.
-
I tend to gravitate towards approach 4 as it gives the most OOP which is super critical for any forward looking design. Having designed/developed the current or former API I like both of those approaches :) Former approach is much simpler and efficient. 3rd approach looked good at first, but, later after reading @dcherian comment "will limit what other ecosystem packages you can use” I’m not very sure about switching to approach 3. |
Beta Was this translation helpful? Give feedback.
-
While I really like option 3 and believe that it should be implemented in one way or another, I think it's important to consider how we could build upon it, especially for supporting visualization functions. I'm concerned about how restricted we would be to Xarray data structures This could be resolved by using custom indexes (see vector cube). I'm a huge fan of this implementation, but it may be best to stick to one of the others for now until we can dedicate more time to it. The following examples introduce the Example 1 (
|
Beta Was this translation helpful? Give feedback.
-
To all following this discussion, we are planning to make a decision on our Feb 28th telecon. |
Beta Was this translation helpful? Give feedback.
-
Dear all, we have made a decision to subclass Xarray (i.e. option #4) as already proposed in the Redesign prototype PR #216. The whole conversation here and our further discussions with Xarray developers have been greatly helpful for this decision; thanks a lot! To get this new design merged to the current code structure, we have
We are hoping to get this new design released once we address all the items in the above linked document. |
Beta Was this translation helpful? Give feedback.
-
We are in the middle of a UXarray API redesign work based on user feedback and developers’ discussions recently. We’d like to come up with an API design that satisfies both the usage requirements & specifications as well as complies with the Xarray-extension best practices.
I’ll describe 4 potential design options (including the current and the former UXarray API), provide concrete examples to give an idea of how UXarray usage would look like with each of them, and discuss pros & cons with each.
For simplicity and voting purposes, each option will be provided in a separate cell below. Please provide your comments under which option they correspond to, or propose a new design in a new cell.
I can also try providing some UML-like sketches if needed.
For the sample codes, I’ll consider a case where:
grid_path
= Path or URL to the unstructured grid topology definition filedata_path
= Path or URL to the dataset file that contains the actual data, i.e. variable(s) of interest, e.g. vortex, which conforms to the unstructured grid topology given ingrid_path
Beta Was this translation helpful? Give feedback.
All reactions