-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from chrishavlin/covering_grid_support
adding covering grid support
- Loading branch information
Showing
14 changed files
with
482 additions
and
85 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import pytest | ||
|
||
from yt_napari._data_model import InputModel | ||
from yt_napari._model_ingestor import _choose_ref_layer, _process_validated_model | ||
from yt_napari._schema_version import schema_name | ||
|
||
jdicts = [] | ||
jdicts.append( | ||
{ | ||
"$schema": schema_name, | ||
"datasets": [ | ||
{ | ||
"filename": "_ytnapari_load_grid", | ||
"selections": { | ||
"covering_grids": [ | ||
{ | ||
"fields": [{"field_name": "density", "field_type": "gas"}], | ||
"left_edge": {"value": (0.4, 0.4, 0.4)}, | ||
"right_edge": {"value": (0.5, 0.5, 0.5)}, | ||
"level": 0, | ||
"rescale": 1, | ||
} | ||
] | ||
}, | ||
} | ||
], | ||
} | ||
) | ||
|
||
|
||
@pytest.mark.parametrize("jdict", jdicts) | ||
def test_covering_grid_validation(jdict): | ||
_ = InputModel.model_validate(jdict) | ||
|
||
|
||
@pytest.mark.parametrize("jdict", jdicts) | ||
def test_slice_load(yt_ugrid_ds_fn, jdict): | ||
im = InputModel.model_validate(jdict) | ||
layer_lists, _ = _process_validated_model(im) | ||
ref_layer = _choose_ref_layer(layer_lists) | ||
_ = ref_layer.align_sanitize_layers(layer_lists) | ||
|
||
im_data = layer_lists[0][0] | ||
assert im_data.min() == 0 | ||
assert im_data.max() == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.