ecmwf: add test to better understand what is happening with memory
2 files changed, 29 insertions(+), 0 deletions(-)

M meteo_scraper/cli.py
A => test/test_ecmwf.py
M meteo_scraper/cli.py +9 -0
@@ 67,3 67,12 @@ def scrap_ecmwf_ens_fcst(filename='ecmwf
     tsa = timeseries(CONFIG['uri']['dburi'])
     get_last_ens_data(filename)
     ens_ecmwfdata_to_refinery(tsa, filename)
+
+
+@meteo.command(name='ingest-ecmwf-ens')
+@click.option(
+    "--filename"
+)
+def ingest_ecmwf_ens_fcst(filename='ecmwf_ens.grib'):
+    tsa = timeseries(CONFIG['uri']['dburi'])
+    ens_ecmwfdata_to_refinery(tsa, filename)
  No newline at end of file

          
A => test/test_ecmwf.py +20 -0
@@ 0,0 1,20 @@ 
+import metview as mv
+import numpy as np
+
+def test_det_values():
+    param = '2t'
+    filename = 'ecmwf_hres.grib'
+    gribfile_hres = mv.read(f'{filename}')
+    gt = gribfile_hres[param]
+    values = mv.values(gt)
+
+    assert np.shape(values)[1] == 405900
+
+def test_ens_values():
+    param = '2t'
+    filename = 'ecmwf_ens.grib'
+    gribfile_ens = mv.read(f'{param}_{filename}')
+    gt = gribfile_ens[param]
+    values = mv.values(gt)
+
+    assert np.shape(values)[1] == 405900