overthesun / simoc

A scalable model of an interactive, off-world community
https://ngs.simoc.space/
GNU General Public License v3.0
2 stars 2 forks source link

Missing energy production in `/get_steps` #93

Closed ezio-melotti closed 5 years ago

ezio-melotti commented 5 years ago

As I was working on the config graph for power, I had to set the name for the solar panels agent to solar_pv_array_mars, as defined in: https://github.com/kstaats/simoc/blob/5926c006e81bebbf80fab473c39da0f1a8f509a1/agent_desc.json#L4365-L4372

I believe /get_steps expects solar_arrays and this change broke the expectation since now I'm getting 0 in total_production.enrg_kwh. Can /get_steps be updated to use solar_pv_array_mars?

Cc: @breathnach @Pebody

breathnach commented 5 years ago

I believe the issue was actually in the convert_configuration function in front_end_routes.py, which expected solar_arrays, and then renamed it to solar_pv_array_mars which is used everywhere else in the backend. The renaming was never ideal, and now that you're using solar_pv_array_mars I've updated convert_configuration to be consistent. I haven't tested it but I believe it should work easily since as far as I'm aware this is the only place "solar_arrays" was mentioned.

breathnach commented 5 years ago

update to fix. game_config["solar_pv_array_mars"] is a dict, not a label like greenhouse and habitat. So it needs it's own function in front end routes.convert_configuration. implemented.

ezio-melotti commented 5 years ago

@breathnach fixed this in 44dfd938e3bc791d6ea63ab073246b87b67151b1 and afc119d8e095e76e6d319251196a9e00b9c0297e.