-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test of randomized value matching
- Loading branch information
1 parent
8a523e3
commit fa7ee07
Showing
4 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,8 +1,18 @@ | ||
from ncompare.core import compare | ||
import xarray as xr | ||
|
||
from ncompare.core import compare, _match_random_value | ||
|
||
|
||
def test_dataset_compare_does_not_raise_exception(ds_3dims_2vars_4coords, ds_4dims_3vars_5coords): | ||
compare(ds_3dims_2vars_4coords, ds_4dims_3vars_5coords) | ||
|
||
def test_dataset_compare_does_not_raise_exception_2(ds_3dims_2vars_4coords, ds_3dims_3vars_4coords_1group): | ||
compare(ds_3dims_2vars_4coords, ds_3dims_3vars_4coords_1group) | ||
|
||
def test_matching_random_values(ds_3dims_2vars_4coords, ds_4dims_3vars_5coords, | ||
ds_3dims_3vars_4coords_1group, outputter_obj): | ||
variable_array_1 = xr.open_dataset(ds_3dims_2vars_4coords).variables['z1'] | ||
variable_array_2 = xr.open_dataset(ds_4dims_3vars_5coords).variables['z1'] | ||
|
||
assert _match_random_value(outputter_obj, variable_array_1, variable_array_1, ) is True | ||
assert _match_random_value(outputter_obj, variable_array_1, variable_array_2, ) is False |
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