-
Notifications
You must be signed in to change notification settings - Fork 0
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
Prob compare #169
Prob compare #169
Conversation
- added probabilistic metrics via `compute_probabilistic_metrics.py` - added `probabilistic_compare()` as gval accessor method - added `_compare_metrics_df_with_xarray()` to compare df's with xarray objects - added probabilistic compare accessor method - added xskillscore as dependency - updated docstrings to represent correct module name or function - deprecated `load_raster_as_xarray()` #50 - added `_create_circle_mask()`, `_create_xarray()`, and `_create_xarray_pairs()` - added `Prob_metrics_df` dataframe schema
- updated tests to use `Prob_metrics_df` schema for `expected_df`s - stopped coercion for `Prob_metrics_df` schema - ran `black` and `flake8` - updated crps_ensemble test to use correct size variable
- updated `_assert_pairing_dict_equal()` to use `np.testing.assert_equal()` - addition of xskillscore slightly changed some values for continuous metrics. - fixed skipped test `test_create_xarray_pairs()`
- updated `_assert_pairing_dict_equal()` to use deepdiff - added deepdiff as dev dependency - updated values for continuous compare metrics - most likely introduced due to dependency updates - differences are very minor to 10+ decimal places - ensured expected dict is PairingDict object
- updated `_assert_pairing_dict_equal()` docstring
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.
Just some minor changes, some other things I am going to open up as issues.
tests/cases_load_xarray.py
Outdated
(0, 1, (7, 7), 3), # band 2 | ||
] | ||
|
||
data_band_1 = np.array( |
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.
This and data defined at line 47, 116, and 280 could be defined once somewhere in the script. Perhaps other variables could be not repeated as well.
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.
All repeated variables in this module were moved to global status. Changes in those values at the function level remain in place.
sizes = (sizes, sizes) | ||
|
||
# handle shapes | ||
if shapes == "circle": |
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.
I would remove 318-325 and delegate check for valid shape to the loop starting 330 unless this is for memory purposes or some future masks may generalize to multiple shapes.
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.
Yes, the purpose of this is to support other array creation functions eventually.
# background value, circle value, circle center, and circle radius | ||
band_params_benchmark = [ | ||
(145, 360, (25, 25), 15), | ||
# (160, 360, (2, 2), 3), |
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.
Unless there is a purpose remove commented lines.
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.
Removed.
- moved function level variables to global where applicable in `cases_load_xarray.py` - updated comments for band level params to include (x, y) coords - removed legacy commented lines
Probabilistic metrics
_assert_pairing_dict_equal()
to usedeep diff.DeepDiff()
functionProb_metrics_df
schema forexpected_df
sProb_metrics_df
schemablack
andflake8
compute_probabilistic_metrics.py
probabilistic_compare()
as gval accessor method_compare_metrics_df_with_xarray()
to compare df's with xarray objectsload_raster_as_xarray()
. closes Deprecate_load_xarray()
and_load_raster_as_xarray()
#50_create_circle_mask()
,_create_xarray()
, and_create_xarray_pairs()
Prob_metrics_df
dataframe schema