quintel / etsource

Data source for the Energy Transition Model
https://energytransitionmodel.com/
MIT License
12 stars 8 forks source link

Remove default_unit from inputs #150

Closed dennisquintel closed 10 years ago

dennisquintel commented 12 years ago

I think it's not used anymore, right?

hasclass commented 12 years ago

pretty sure it's still used.

  # == Remark about default_unit
  #
  # Because ETmodel/flex return only numbers when pulling a slider, we can
  # define a default suffix for an input with the v1_legacy_unit
  # attribute.
  #
  # So if you define inside an inputs/my_special_input.yml
  # v1_legacy_unit: "%"
  #
  # A number 5 from an etmodel slider will be converted to "5%". So the
  # etmodel frontend displays a slider where you can update the growth
  # rate. When the user chooses 7% the slider actually only sends the
  # number  7 to the etengine. The ETengine/API if there is no suffix for
  # that slider, the api will append the one defined in  default_unit
  # and send the "7%" to the GQL. The UPDATE function then derives from
  # that "7%" that it should increase the demand by 7% and not set the
  # demand to 7. Why: we once wanted the sliders to be flexible, so that
  # you can choose to use the slider with absolute, growth_rate and growth
  # per year. But simply got forgotten (either that we can, or that we
  # want to).
dennisquintel commented 12 years ago

But we also have unit....

=> ["agriculture_electricity_demand: % / %y",
 "agriculture_heat_demand: % / %y",
 "buildings_appliances_efficiency: % / %y",
 "buildings_cooling_per_student_employee: % / %y",
 "buildings_electricity_per_student_employee: % / %y",
 "buildings_heat_per_employee_student: % / %y",
 "buildings_number_of_buildings: % / %y",
 "electricity_bio_oil_share_in_gas_production: % / ",
 "electricity_natural_gas_share: % / ",
 "electricity_oil_share_in_gas_production: % / ",
 "households_cooling_demand_per_person: % / %y",
 "households_hot_water_demand_per_person: % / %y",
 "households_electricity_demand_per_person: % / %y",
 "households_heat_demand_per_person: % / %y",
 "households_number_of_inhabitants: % / %y",
 "industry_aluminium_production: % / %y",
 "industry_demand: % / %y",
 "industry_efficiency_electricity: % / %y",
 "industry_electricity_demand: % / %y",
 "industry_heat_demand: % / %y",
 "industry_heat_from_fuels: % / %y",
 "industry_non_energetic_oil_demand: % / %y",
 "industry_non_energetic_other_demand: % / %y",
 "other_electricity_demand: % / %y",
 "other_heat_demand: % / %y",
 "transport_cars: % / %y",
 "transport_efficiency_airplanes: % / %y",
 "transport_efficiency_combustion_engine_cars: % / %y",
 "transport_efficiency_combustion_engine_trucks: % / %y",
 "transport_efficiency_electric_vehicles: % / %y",
 "transport_efficiency_ships: % / %y",
 "transport_efficiency_trains: % / %y",
 "transport_inland_navigation: % / %y",
 "transport_domestic_flights: % / %y",
 "transport_trains: % / %y",
 "transport_trucks: % / %y"]

could it possibly be that that _defaultunit is used to indicate that the growth should be calculated per year?

dennisquintel commented 12 years ago

Now leads to a lot of confusion, maybe a better name? Assigned @hasclass: please pick this up with @ChaelKruip.

hasclass commented 12 years ago

The UPDATE query takes the clue on how to update a number from the default_unit.

e.g.
UPDATE( ..., demand , "3.0") => 3.0 UPDATE( ..., demand , "3.0%") => 231.0 * 1.03 UPDATE( ..., demand , "3.0%y") => 231.0 * 1.03^30years

If you don't specifically pass a unit at the end of the number the default_unit will be used. e.g.: default_unit: '%' "3.0" => "3.0%"

Rationale was that the etmodel could decide whether it wants to update growth/year, absolute or growth total

On Tuesday, October 9, 2012 at 8:06 PM, Dennis Schoenmakers wrote:

Now leads to a lot of confusion, maybe a better name? Assigned @hasclass (https://github.com/hasclass): please pick this up with @ChaelKruip (https://github.com/ChaelKruip).

— Reply to this email directly or view it on GitHub (https://github.com/dennisschoenmakers/etsource/issues/150#issuecomment-9259665).

dennisquintel commented 12 years ago

Makes sense.... @chaelkruip: could you come up with a better name?

dennisquintel commented 12 years ago

Rationale was that the etmodel could decide whether it wants to update growth/year, absolute or growth total

Since we never implemented this and I don't see that we shall in the foreseable future: could we combine the two (unit and default unit) into one 'unit', e.g.: %y? Now people (=@chaelkruip) keep complaining and confused every time they need to add/edit/comprehend an input statement.

ChaelKruip commented 10 years ago

default_unit has been removed. Closing.