Conversation
src/scores/pandas/continuous.py
Outdated
| ) -> PandasType: | ||
| """Calculates the additive bias (mean error) from forecast and observed data. | ||
|
|
||
| Bias is commonly defined as the mean signed difference between forecast and observed values. A detailed explanation is on https://scores.readthedocs.io/en/stable/tutorials/Additive_and_multiplicative_bias.html |
There was a problem hiding this comment.
I'm not sure a general definition of Bias is needed here. Suggest deleting the first sentence to make this consistent with other docstrings in this file.
| Bias is commonly defined as the mean signed difference between forecast and observed values. A detailed explanation is on https://scores.readthedocs.io/en/stable/tutorials/Additive_and_multiplicative_bias.html | |
| A detailed explanation is on https://scores.readthedocs.io/en/stable/tutorials/Additive_and_multiplicative_bias.html |
There was a problem hiding this comment.
Removed first line definition
| # Additive Bias (Mean Error) | ||
|
|
||
|
|
||
| def test_additive_bias_pandas_series(): |
There was a problem hiding this comment.
Since you're expanding the input types for additive_bias you need to test for xarray inputs as well.
For 100% test coverage you'll need to check the exception is correctly raised.
Something like
with pytest.raises(ValueError):
scores.continuous.additive_bias(fcst=fcst, obs=obs, weights=xr.DataArray([1,2,3]))
There was a problem hiding this comment.
@John-Sharples why do we need this in the pandas-specific API? Is the idea it's xarray plus pandas, or just pandas only?
There was a problem hiding this comment.
My mistake, in putting it here it probably belongs in tests/continuous/test_standard.py
|
We still need a test checking we get the expected answer when the inputs are xarray like objects. Something like: |
|
Do we? This is for the pandas API, where xarraylike objects aren't expected. Do we need the pandas API to also handle xarraylikes? |
Apologies - I was mistaken about which function we were testing here. Current test looks good. Happy to approve once confilcts are resolved. |
1d9ac37 to
5c14b3c
Compare
No description provided.