diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2024-01-24 01:10:36 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2024-01-24 01:10:36 +0100 |
commit | 46ff89bade0f7ca4d5b1edfaa75dacf48c25be86 (patch) | |
tree | 4b727de4cc0756e170e4d89cfc6355109a48c76f /run.py | |
parent | 40e1a9eb35a771cdaea7973f8b0642860da1a069 (diff) | |
download | meteo_toolbox-46ff89bade0f7ca4d5b1edfaa75dacf48c25be86.tar.gz |
reuse xarray objects to reduce memory footprint
Diffstat (limited to 'run.py')
-rwxr-xr-x | run.py | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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]) |