tum-ens/urbs

urbs.save h5 with dual variables not possible

IngaMueller opened this issue · 1 comments

When running urbs with dual variables (prob = urbs.create_model(data, dt, timesteps, dual=True)) key errors occur for the following constraints:

  • res_stock_step_rule
  • res_stock_total_rule
  • res_env_step_rule
  • res_env_total_rule

The traceback indicates the following cause:

  • report_sites_name=report_sites_name), File "runme.py", line 134, in run_scenario
  • urbs.save(prob, os.path.join(result_dir, '{}.h5'.format(sce))), File ~/urbs/saveload.py", line 35, in save
  • prob._result = create_result_cache(prob), File "~/urbs/saveload.py", line 16, in create_result_cache
  • result_cache[entity]= get_entity(prob, entity), File "~/urbs/pyomoio.py", line 55, in get_entity
  • [v[0] + (instance.dual[v[1]],) for v in entity.iteritems()]), File "~/urbs/pyomoio.py", line 55, in
  • [v[0] + (instance.dual[v[1]],) for v in entity.iteritems()]), File "~python3.5/dist-packages/pyomo/core/base/suffix.py", line 200, in getitem" (id=%s)" % id(component))

KeyError: 'Component with name: res_env_step[4,Dummy,CO2,Env] (id=140227049569256)'

I think this is solved by release 1.0.