Open egiraldof opened 4 years ago
You need to create and pass in a gnome.spills.substance.GnomeOil or NonWeatheringSubstance in the substance kwarg. You can't just pass in a dict. The following should be enough.
substance = GnomeOil(**json_data)
@jay-hennen Thanks for the help!
Now I get this error "sqlalchemy.orm.exc.NoResultFound: Oil with identifier "South_Blend", not found in database. But "South_Blend" is the new substance that I want to customize with the characteristics that are above.
You need to provide a 'component_density' key to your dictionary. May also need other keys; I don't know what they would be.
Initializing a GnomeOil directly from a from-scratch dict is not normal usage (yet), and the necessary parameters aren't published yet. I think you would have better luck loading a generic oil and then overriding the attributes with your values.
@ChrisBarker-NOAA Has the OilLibrary been decoupled from Pygnome yet in this Github version?
@ChrisBarker-NOAA
It should be, yes -- that is you can use a GNOME Oil without any access to the oil_library.
And there should be example GNOME oils in there somewhere, that you can edit. @coconnor8: maybe you could point us to them.
Sorry this isn't properly documented.
Example oils are in gnome.spill.sample_oils
Hello,
I am trying to create a custom substance but I am getting the following error: AttributeError: 'dict' object has no attribute 'standard_density'.