Closed jorisberkhout closed 8 years ago
So, it should just print out an integer?
Like:
def number_of_blackout_hours
(production - consumption).select { |num| num < 0 }.size
end
So, it should just print out an integer?
Yes!
Like:
def number_of_blackout_hours (production - consumption).select { |num| num < 0 }.size end
Sounds like a solution to me!
As discussed in https://github.com/quintel/etmodel/issues/2058, we would like to give the user insight in the number of hours per year that the total electricity plus imported electricity cannot meet the demand.
As @grdw pointed out to me, implementing such a method in merit is fairly similar to the
number_of_excess_events
method that he implemented in https://github.com/quintel/merit/commit/00e3dcc4d5b2a085efa6ce0cd6440bef9c8098ab. Assigning him to implement anumber_of_blackout_hours
method as well. This method does not take any arguments and should return the number of hours per year whereproduction - consumption < 0
.This method should also be available in GQL, such that it can be used in the dashboard item described in https://github.com/quintel/etmodel/issues/2058.