-
Notifications
You must be signed in to change notification settings - Fork 172
Remove XGrid.from_dataset #2648
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
Changes from all commits
5ecda19
d94a3c3
b381682
c0edb0b
139d916
3007703
9026b39
f5626a0
cb1fd18
ff1ac0b
b78de00
e3a38d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| import pytest | ||
|
|
||
| from parcels import FieldSet | ||
| from parcels._datasets.structured.generic import datasets as datasets_structured | ||
|
|
||
| SKIP_BY_DEFAULT = {"validation", "flaky"} | ||
|
|
||
|
|
||
|
|
@@ -17,3 +20,16 @@ def pytest_collection_modifyitems(config, items): | |
| @pytest.fixture | ||
| def tmp_parquet(tmp_path): | ||
| return tmp_path / "tmp.parquet" | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def fieldset() -> FieldSet: | ||
| """FieldSet with U and V""" | ||
| ds = datasets_structured["ds_2d_left"].copy() | ||
| ds = ds[["U_A_grid", "V_A_grid", "grid"]].rename( | ||
| { | ||
| "U_A_grid": "U", | ||
| "V_A_grid": "V", | ||
| } | ||
| ) | ||
|
Comment on lines
+29
to
+34
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to worry about the values in the arrays of these datasets? For example, if they are by default zero then some advection tests may pass irrespective of how good the advection scheme is. Or is it simply not intended that the values in these arrays are used?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed in person - these datasets have random data at the moment, where other datasets can be used for more flow specific tests. |
||
| return FieldSet.from_sgrid_conventions(ds, mesh="flat") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit 'magical' that the fieldset() is defined here, but can be used in all the test files without an explicit import in these test files. New devs may get confused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in person - this is just pytest magic :)