-
Notifications
You must be signed in to change notification settings - Fork 54
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
Minimally invasive workflow for xarray transition #275
base: RC_v1.5.x
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## RC_v1.5.0 #275 +/- ##
=============================================
+ Coverage 47.47% 48.96% +1.49%
=============================================
Files 14 14
Lines 2711 2851 +140
=============================================
+ Hits 1287 1396 +109
- Misses 1424 1455 +31
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
I started work on
|
…p`; should now work with xarray as input
… is considered as input type
notes: |
…r `feature_detection_multithreshold_timestep`
OK, tests are in place for function However, they fail because if "time" not in [coord.name() for coord in field_in.coords()]:
> raise ValueError(
"input to feature detection step must include a dimension named 'time'"
)
E ValueError: input to feature detection step must include a dimension named 'time' Two options:
I favor option 2. @freemansw1 , @w-k-jones , @JuliaKukulies : What do you think? |
I think this is failing because Overall, I think we need to create a robust xarray/iris conversion method before we convert any of the internals so that we can ensure that output/behaviour is identical before and after the switch. I've starting making a list of elements we need to add on top of the existing
|
We are not setting coordinate names in In if has_time:
out_arr_iris.add_dim_coord(
iris.coords.DimCoord(
pd.date_range(start=time_min, periods=time_num)
.values.astype("datetime64[s]")
.astype(int),
standard_name="time",
units="seconds since epoch",
),
time_dim_num,
) The tests in the current version do not fail because we have only tested with iris cubes. So agree with @w-k-jones , that we should set the coordinate names when the test dataset output is set to be a Also agree that it makes sense to start working on more robust conversion routines, and working with the decorators as suggested by @fsenf might also help to identify more of the oddities that are currently covered. Or were you suggesting to fix the conversion routines entirely before continuing with this strategy, @w-k-jones ? |
@JuliaKukulies : maybe I misunderstood, but we actually have two testing function for def test_feature_detection_multiple_z_coords(
)
def test_feature_detection_setting_multiple():
) I extended the first test function to also test for xarray and iris as part of the transition to xarray. I will look at the test data soon to find a solution. |
@fsenf, sorry I figured my comment was a bit unclear. I was just saying that these test functions have only been introduced with the 3D changes. Hence, they exist in the The code snippet I posted was from |
@JuliaKukulies : Thanks for the hint! |
Excellent, @fsenf ! |
…st and than go to xarray in a conversion steps; this is consistent now for `make_dataset_from_arr` with the other approaches in the module so that the planned conversion tio xarray internals can always use the same scheme
FWIW, I now have a mostly working copy of feature detection fully transitioned to xarray from iris, using many of the same principles as discussed here, including a migration of I still have some more testing and validation to do, and some of the folks running tracking on large datasets at CSU have volunteered to do more testing on this. Once I finish my testing, I'll be happy to contribute it back. |
this is a draft PR to document our collaborative activities in the xarray to iris transition. The idea for a step-by-step transition to xarray is laid out in #143 . This is also a test for full collaborative development, in contrast to the earlier strategy with a single feature prepared by one developer. Let's see ....
I suggest:
that the people that work on a certain module indicate what they currently do and also plan to do in a comment to this draft PR, maybe making a checkbox list of already migrated functions within that module
that everybody runs testing locally with the standard tests and the notebooks from the example directory using