Closed antw closed 12 years ago
Gents,
I'm about to deploy a hotfix for this... it is caused by a failure to calculate the start value for the households_water_heater_heatpump_air_water_electricity_share input whose start value does not return a Numeric, but instead an array containing two converters.
@dennisschoenmakers I'll change the caching to be more accommodating of such errors (and notify us), but would someone look into the start value GQL on ETsource?
Input.get(597).start_value_for(
Scenario.new(area_code: 'nl', end_year: 2050).gql)
# => [ <Converter households_useful_demand_for_hot_water_after_solar_heater_and_add_on>,
# <Converter households_water_heater_heatpump_air_water_electricity>,
# ... ]
Wow! Good catch. That's very weird indeed!
@ChaelKruip: could you correct this start value asap?
Unfortunately other inputs appear to be returning non-numeric start, min, or max values also. The complete list:
present:V(households_water_heater_heatpump_air_water_electricity, households_useful_demand_for_hot_water_after_solar_heater_and_add_on)
present:Q(potential_electricity_production_of_offshore_wind)
present:Q(potential_electricity_production_of_coastal_wind)
present:Q(potential_electricity_production_of_inland_wind)
future:V(0.0)
future:V(AREA(number_households))
By "array-wrapped value" I mean that the GQL returns a value, but it does so inside an array:
Input.get('number_of_micro_chp_fixed').max_value_for(gql)
# => [7349500.0]
Would it be possible to adjust these queries to just return the numeric value? It would avoid the need for having to run extra checks when generating the cache.
For comparison:
A troublesome query, used as a max value:
GQL: Q(potential_electricity_production_of_offshore_wind)
=> [27278.424657534255]
An unrelated, randomly-selected query:
GQL: Q(co2_emissions_of_final_demand_excluding_imported_electricity)
=> 163359325067.51855
Okay, last update. :smile:
I think it is possible to remove the wrapped array. The mw_of_offshore
input uses the potential_electricity_production_of_offshore_wind
query to create the start value. This query looks like this:
V(
PRODUCT(
DIVIDE(AREA(onshore_suitable_for_wind),V(energy_power_wind_turbine_offshore,land_use_per_unit)),
V(energy_power_wind_turbine_offshore,"typical_electricity_production_capacity * full_load_hours / 8760")
)
)
It appears simply removing the V()
wrapper gets rid of the array:
PRODUCT(
DIVIDE(AREA(onshore_suitable_for_wind),V(energy_power_wind_turbine_offshore,land_use_per_unit)),
V(energy_power_wind_turbine_offshore,"typical_electricity_production_capacity * full_load_hours / 8760")
)
@antw: you are allowed to make the necessary adjustments yourself. @ChaelKruip: could you help Anthony out here and there if necessary?
This is also a good clean up of the input gqueries. We should be more strict on returning numeric values.
Fixed with commits a2056fe266de1710f74d717503bf5f9d827fc0b8 and bff4f8d2b958e603fa8096219b0dfd95f9bacceb
Check full details on Airbrake: http://quintel.airbrake.io/errors/51977894?auth_token=1bcd54c40e8de6f973d490870c215bd9e3068daf