Closed ciaransweet closed 2 months ago
Or perhaps it doesn't make sense to expand for inventory? But I suppose for STAC it does? As we have individual entries for each combination of parameters?
Edit: Okay actually I think I understand better now, inventory.json
somewhat describes all the possible combinations. For the case of STAC, we still have the case where values aren't really templated out but I think that's due to the STAC implementation naively just dumping all values, rather than templating out the combinations.
Hi @ciaransweet, Yes that's right. It's templated in inventory.json and only expanded at the point where inventory.json is converted back into HazardResource objects (e.g. in physrisk). This is done to keep inventory.json smaller and more maintainable. I think main examples are when there are multiple GCMs used or in the case of work loss when there are different categories of activity. Arguably, GCM is such a common use case that it could be made a first-class citizen together with scenarios and years...
Probably one for @joemoorhouse
Could you possibly give me an example/point me to where I would call
expand()
on a hazard resource to get its fully templated out values?For example, right now we have: https://github.com/os-climate/hazard/blob/main/src/hazard/services.py#L61
But I get values like:
In the
inventory.json
outputIn that line of code linked, which spot is the appropriate place to
.expand()
the resource?