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

Add technology uglifier for LES's #1612

Closed grdw closed 6 years ago

grdw commented 6 years ago

This seems to work locally:

screen shot 2018-02-02 at 15 40 26

However, if I try to save it (it does save):

Something goes wrong at ETEngine (for api/v3/scenarios/<scenario-id>/converters/stats):

screen shot 2018-02-02 at 15 41 01

Seems that strong parameters is needed for this to work. 🤔

antw commented 6 years ago

Sorry for being thick: how does converting technologies to a hash fix the 401 Unauthorized response? Was ETMoses sending data in the wrong format?

grdw commented 6 years ago

Oh, I'm sorry for not explaining.

This is the current situation: Currently on beta there's still an error ocurring when trying to import a scenario for ETMoses. This is the error from Airbrake. The problem is the formatting.

After the couple of lines of fixing in this PR the other error bubbles up at ETEngine (probably due to the Rails 5 upgrade I can imagine).

antw commented 6 years ago

Got it, thanks!

You're right about the strong params in ETEngine. ConverterController#stats needs the following change:

- keys = params.require(:keys)
+ keys = params.require(:keys).permit!.to_h
grdw commented 6 years ago

I created a PR here: https://github.com/quintel/etengine/pull/999