pySTEPS / pysteps

Python framework for short-term ensemble prediction systems.
https://pysteps.github.io/
BSD 3-Clause "New" or "Revised" License
466 stars 168 forks source link

Minor exporters adjustment #272

Closed RubenImhoff closed 2 years ago

RubenImhoff commented 2 years ago

For a deterministic run (n_ens_mem = 1), the shape of var_f is [n_timesteps, y, x]. The exporter assumed a shape of [n_ens_members, n_timesteps, y, x], which is no longer the case (changed a few releases ago). Hence, the indexation was incorrect (returning the shape of y instead of n_timesteps).

codecov[bot] commented 2 years ago

Codecov Report

Merging #272 (6218ddc) into master (2dbd3de) will increase coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
+ Coverage   82.23%   82.33%   +0.10%     
==========================================
  Files         158      158              
  Lines       12117    12130      +13     
==========================================
+ Hits         9964     9987      +23     
+ Misses       2153     2143      -10     
Flag Coverage Δ
unit_tests 82.33% <100.00%> (+0.10%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pysteps/io/exporters.py 55.12% <100.00%> (+2.77%) :arrow_up:
pysteps/tests/test_exporters.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2dbd3de...6218ddc. Read the comment docs.

dnerini commented 2 years ago

Hi @RubenImhoff, thanks for spotting the problem and suggesting the fix. Would it be possible to include a test that would have detected the issue in the first place?

RubenImhoff commented 2 years ago

I think so, I'll have a look at it!