aboutsummaryrefslogtreecommitdiff
path: root/run.py
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2024-01-24 01:10:36 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2024-01-24 01:10:36 +0100
commit46ff89bade0f7ca4d5b1edfaa75dacf48c25be86 (patch)
tree4b727de4cc0756e170e4d89cfc6355109a48c76f /run.py
parent40e1a9eb35a771cdaea7973f8b0642860da1a069 (diff)
downloadmeteo_toolbox-46ff89bade0f7ca4d5b1edfaa75dacf48c25be86.tar.gz
reuse xarray objects to reduce memory footprint
Diffstat (limited to 'run.py')
-rwxr-xr-xrun.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/run.py b/run.py
index 2220db3..244da10 100755
--- a/run.py
+++ b/run.py
@@ -16,10 +16,9 @@ def create_aggregators(cfg):
classname = aggconf['module']
del aggconf['module']
- ret[aggregator] = {}
- ret[aggregator]['module'] = __import__(classname, fromlist=[None])
- ret[aggregator]['config'] = aggconf
- ret[aggregator]['config']['name'] = aggregator
+ module = __import__(classname, fromlist=[None])
+
+ ret[aggregator] = module.load_data(name=aggregator, **aggconf)
return ret
@@ -66,8 +65,7 @@ for plotter in conf['plotter']:
del plotter['module']
if 'aggregator' in plotter:
- agg = aggregators[plotter['aggregator']]
- plotter['data'] = agg['module'].load_data(**agg['config'])
+ plotter['data'] = aggregators[plotter['aggregator']]
del plotter['aggregator']
mod = __import__(modname, fromlist=[None])