electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
434 stars 104 forks source link

Adds check for identifier #466

Closed madsnedergaard closed 3 years ago

madsnedergaard commented 3 years ago

Issue

Resolves #465

Description

Changes the Purchases modelCanRun function to check for identifier in lineItems.

FYI

This change will mean the co2engine package will throw many more 'No carbonModel available for this activity.' errors. I don't think it has any implications, but would love some additional thoughts here :)

madsnedergaard commented 3 years ago

cc @skovhus

madsnedergaard commented 3 years ago

It could also make sense to let the model run, and let it model throw an error that says specifically that we expect an identifier here. Just a thought. I think this approach works as well!

If we want to use modelCanRun functionality more actively in Bloom, I think it makes sense to ensure it reflects reality :)

madsnedergaard commented 3 years ago

Failing builds fixed in #468, awaiting merging of that one.