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

Clean up settings #1490

Closed grdw closed 7 years ago

grdw commented 7 years ago

First merge #1484

Fixes: #1447 Fixes: #1087

antw commented 7 years ago

The "Gas Load" → "Load on the gas network" chart won't load for me. This is because there is no ChartSetting for gas. The chart itself shouldn't actually need a gas setting though (it uses gas_local, gas_four, etc). Perhaps because the chart data has key: "gas"?

{
  key: "gas"
  name: "Gas load chart",
  values: [ /* ... */ ]
}

Could ChartSettings.forChart perhaps also throw an error if the setting doesn't exist? For example:

forChart: function (chartKey) {
  if (!this.data.hasOwnProperty(chartKey)) {
    throw new Error('No such chart setting: ' + chartKey);
  }

  return this.data[chartKey];
}
grdw commented 7 years ago

@antw I think all is good 👍

antw commented 7 years ago

I think all is good 👍

Not for me. 😧

antw commented 7 years ago

The heat chart seems to be missing settings for some series, which is causing them to appear without a label and black as the colour.

I can shed a bit more light on this. The settings are not missing, but just don't have all the values needed for the chart. The affected series are the central heat producers (households collective CHP biogas, households collective geothermal, etc).

For these series, ChartSettings.forChart is returning something like:

{
  type: "households_collective_chp_network_gas",
  visible: true
}

... but for other series, is returning:

{
  areaColor: "#9CC7F9",
  axisLabel : "kW",
  color : "#9CC7F9",
  id: 33,
  name: "Hot water demand",
  type: "water_heating",
  visible : true
}
grdw commented 7 years ago

The pop-over line shows "0" as the value for every series; this happens on all charts.

That's because of:

The auto-scaling of the chart units is slightly wrong.

I was a bit quick to call it 'okido'. I need to test a bit more thoroughly I guess. I'm sorry.

I know about the colouring problem. I thought I had all of them.

antw commented 7 years ago

LGTM! :+1: