rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

If the unit string is set to NA in energyProviders, the MVS does not run #508

Open ursulaelmir opened 4 years ago

ursulaelmir commented 4 years ago

Input data attached very_bad_weather_3.zip

commit number:

commit b26d6f29f568c71382c8022c39e8f1f1c75bf998 (HEAD -> dev, origin/dev, origin/HEAD) Merge: 33ddd81 66289f7 Author: smartie2076 44204527+smartie2076@users.noreply.github.com Date: Thu Aug 13 09:35:18 2020 +0200

Merge pull request #505 from rl-institut/fix-f2-docstrings

Reformat doc-strings in F2 Module

commit 66289f73d0fb1af678de5b8ce79331acd56aa98c Merge: 9758593 33ddd81 Author: smartie2076 44204527+smartie2076@users.noreply.github.com Date: Thu Aug 13 09:31:41 2020 +0200

Error:

Traceback (most recent call last): File "mvs_tool.py", line 4, in main() File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/mvs_eland_tool/local_deploy.py", line 128, in main data_processing.all(dict_values) File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/src/C0_data_processing.py", line 71, in all process_all_assets(dict_values) File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/src/C0_data_processing.py", line 251, in process_all_assets asset_function(dict_values, asset_group) File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/src/C0_data_processing.py", line 394, in energyProviders define_dso_sinks_and_sources(dict_values, asset) File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/src/C0_data_processing.py", line 686, in define_dso_sinks_and_sources dict_values, dict_values[ENERGY_PROVIDERS][dso], dict_availability_timeseries File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/src/C0_data_processing.py", line 806, in add_a_transformer_for_each_peak_demand_pricing_period timeseries_availability=dict_availability_timeseries[key], File "/Users/pastek/Desktop/MVS-RLI/mvs_eland/src/C0_data_processing.py", line 915, in define_transformer_for_peak_demand_pricing SPECIFIC_COSTS: {VALUE: 0, UNIT: CURR + "/" + dict_dso[UNIT],}, TypeError: can only concatenate str (not "float") to str

Bachibouzouk commented 4 years ago

Can you also provide the commit number of your github head (type git log in your console to see it) as well as the full error message ?

ursulaelmir commented 4 years ago

Can you also provide the commit number of your github head (type git log in your console to see it) as well as the full error message ?

I didn't really commit anything. I was trying to run a simulation locally. When this 'NA' is changed to kVA for instance, the simulation runs. @smartie2076 said that it might be that it is reading it as None?

Bachibouzouk commented 4 years ago

Even if you didn't commit, you are on a branch with a commit number at the tip of the branch (if you say "I am on dev" I could checkout dev but still not have the exact same version of dev depending we we last pulled it from the repository). Knowing the commit number will allow me to be sure my local code is exactly the same as yours ;)

ursulaelmir commented 4 years ago

okay added to the description @Bachibouzouk

Bachibouzouk commented 4 years ago

dict_dso[UNIT] is apparently a float instead of being a string, I would look into where dict_dso is built in the code and also at the value os dict_dso[UNIT] just before the error.

You can use

import ipdb
ipdb.set_trace()

before "C0_data_processing.py", line 915 so that the simulation stops and you are in the debugger terminal and can check variables (faster than using print statements) (use c + ENTER to continue the simulation after the breakpoint)

smartie2076 commented 4 years ago

It doesn not only happen to dict_dso but also to others. My example:

csv file:

,unit,project_data
country,str,NA
label,str,project_data
latitude,str,0
longitude,str,0
project_id,str,1
project_name,str,Benchmark test for economic KPI calculated in E2 and C2
scenario_id,str,3
scenario_name,str,Economic_KPI_E2_C2

Error message:

09:40:14-ERROR-Parametr country of asset project_data is missing. The simulation may continue, but errors during execution or in the results can be expected.

I am on PR #520, revision number 518ed4f164a068820cf531ad3f135b4092a113d4.