quintel / etmoses

Online decision support tool to create local energy situations for neighbourhoods, cities and regions with a time resolution of 15 minutes created and maintained by Quintel – Not maintained
https://moses.energytransitionmodel.com
MIT License
11 stars 3 forks source link

Fix must-run heat sources with no profile #1579

Closed antw closed 7 years ago

antw commented 7 years ago

Migrates some older LESes which have a must-run heat source without a profile assigned. These LESes would fail to calculate because it is not expected that a must-run would have no profile.

This is the cause of the numerous Airbrake errors:

NoMethodError: undefined method `[]' for nil:NilClass

app/models/network/builders/heat.rb:104 in block in sources_to_producers
app/models/network/builders/heat.rb:101 in map
app/models/network/builders/heat.rb:101 in sources_to_producers
app/models/network/builders/heat.rb:32 in build_graph
app/models/network/builders/heat.rb:16 in to_graph
app/models/network/builders/heat.rb:12 in build
app/models/testing_ground.rb:122 in network
...

I can't find any way to trigger the missing profile on any new LES, so perhaps it has been inadvertently fixed with some other commit; the most recent affected LES was created more than a month ago.