Skip to content

Fix error in process_solution coming from h5py's create_dataset #6

@mattirish

Description

@mattirish

I'm just getting this error when trying to process a PLEXOS solution from RPM-LA. I've successfully used h5plexos to process the test solution and our NAERM RTS-GMLC network solutions, so there aren't any issues with my installation. I get this same error for any year and scenario of our RPM-LA runs, and with runs from a few months back, too:

>>> process_solution("Model base_2020_h1 Solution.zip","2020_h1.h5")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mirish/anaconda3/lib/python3.6/site-packages/h5plexos-0.4.2-py3.6.egg/h5plexos/process/buildh5.py", line 139, in process_solution
  File "/Users/mirish/anaconda3/lib/python3.6/site-packages/h5plexos-0.4.2-py3.6.egg/h5plexos/process/metadata.py", line 30, in create_time_dset
  File "/Users/mirish/anaconda3/lib/python3.6/site-packages/h5py/_hl/group.py", line 109, in create_dataset
    self[name] = dset
  File "/Users/mirish/anaconda3/lib/python3.6/site-packages/h5py/_hl/group.py", line 277, in __setitem__
    h5o.link(obj.id, self.id, name, lcpl=lcpl, lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 202, in h5py.h5o.link
RuntimeError: Unable to create link (name already exists)

An hdf5 database is created with correct metadata but no data.

From a quick googling, it looks like h5py throws this error in create_dataset when we're trying to create an already existing dataset.

It's hard to know right off that bat what in our PLEXOS representation of RPM is causing this. Will try to figure it out!

@GordStephen, the solution being processed above is in //nrelqnap02/RPM/Projects/LA100/rpm_la/20190523_la_sb100/islanded, if ya want to check it out. The xml is at 20190523_la_sb100/inout/plexos_output/final_20190523_la_sb100_is.xml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions