Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] mvs_tool -png fails if no upfront investment necessary #927

Open
4 tasks done
smartie2076 opened this issue Oct 8, 2021 · 2 comments
Open
4 tasks done

[Bug] mvs_tool -png fails if no upfront investment necessary #927

smartie2076 opened this issue Oct 8, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@smartie2076
Copy link
Collaborator

I have a simulation where I do note require any upfront investments (ie. a status quo simulation). I tried running my scenario with

python mvs_tool.py -ext csv -f -pdf -png -i inputs -o outputs

I guess because there are no upfront investments, it is not possible to store a png of those and the simulation terminates:

Upfront Investment Costs ( nan Euro : BYLP Saini Enclave, BYPL Global Optimimum
Traceback (most recent call last):
  File "mvs_tool.py", line 4, in <module>
    main()
  File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\cli.py", line 186, in main
    path_png_figs=user_input.get("path_png_figs", None),
  File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F0_output.py", line 139, in evaluate_dict
    F1_plots.plot_piecharts_of_costs(dict_values, file_path=path_png_figs)
  File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F1_plotting.py", line 1173, in plot_piecharts_of_costs
    + project_title
ValueError: cannot convert float NaN to integer

It seems that total_for_title = df_temp2.at["Total", kp_indic] is parsed as ( nan.

2021-10-08 10_49_55-mvs_eland  D__PycharmProjects_mvs_eland  -  _src_multi_vector_simulator_F1_plo

Checklist to make sure that the bug report ist complete:

  • OS: Win10
  • Branch: dev, updated on 2021-10-07
  • If applicable: Attach full error message
  • If applicable: Share screenshots/images of your problem
    ❌ If applicable: Share used input data data confidential, can be provided internally for review. I think all status quo scenarios without upfront investments would work
@smartie2076 smartie2076 added the bug Something isn't working label Oct 8, 2021
@smartie2076
Copy link
Collaborator Author

I think I misinterpreted something: the issue also takes place if I deactivate -png and only use pdf. Other simulations run though, though, so it must be something specific about the inputs. New error message:

Also, if you're using any of the table format helpers (e.g. Group), replace
`from dash_table.Format import Group` with
`from dash.dash_table.Format import Group`
 import dash_table
d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F2_autoreport.py:886: ResourceWarning: unclosed file <_io.TextIOWrapper name='D:\\PycharmProjects\\mvs_eland\\2021-10-01-
BYPL-Saini-Enclave_fix_electricity_import\\01_status_quo_outputs\\report\\assets\\proj_map.html' mode='r' encoding='cp1252'>
 leaflet_map_path, "r",
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Annuity Costs ( 598735.15399 Euro : BYLP Saini Enclave, BYPL Global Optimimum
Upfront Investment Costs ( nan Euro : BYLP Saini Enclave, BYPL Global Optimimum
Traceback (most recent call last):
 File "mvs_tool.py", line 4, in <module>
   main()
 File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\cli.py", line 186, in main
   path_png_figs=user_input.get("path_png_figs", None),
 File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F0_output.py", line 143, in evaluate_dict
   app = autoreport.create_app(dict_values)
 File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F2_autoreport.py", line 1001, in create_app
   dict_values=results_json, only_print=False,
 File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F2_autoreport.py", line 524, in ready_costs_pie_plots
   figs = plot_piecharts_of_costs(dict_values)
 File "d:\pycharmprojects\mvs_eland\src\multi_vector_simulator\F1_plotting.py", line 1173, in plot_piecharts_of_costs
   + project_title
ValueError: cannot convert float NaN to integer

@smartie2076
Copy link
Collaborator Author

Somehow, total_for_title = df_temp2.at["Total", kp_indic] seems to be parsed as something with character ( and then the number that we actually care about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant