Skip to content

Commit

Permalink
Merge pull request #934 from rl-institut/patch-dash-tab-name
Browse files Browse the repository at this point in the history
Set Dash report tab name as: `scenario_name` (`scenario_id`)

I checked the automatizations, and they ran through sucessfully: https://github.com/rl-institut/multi-vector-simulator/actions/runs/1968313457
Not sure why it is not displayed here.
  • Loading branch information
smartie2076 committed Mar 11, 2022
2 parents e3bc85f + 15f975e commit 4455ad3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ Here is a template for new release sections
- `F0_output.parse_simulation_log`, so that `SIMULATION_RESULTS` are not overwritten anymore (#901)
- `input_template/csv_elements`: Added missing parameters and generalized units (#904)
- `CONTRIBUTING.md` according to last lessons learnt (#904)
- Set numpy version to lower or equal than `1.19.4` (#924)
- Set numpy version to lower or equal than `1.19.4` (#924)
- `F2.create_app()` to specify tab name of Dash report to `scenario_name` (`scenario_id`) instead of `Dash` (#934)

### Removed
-

### Fixed
- `OBJECTIVE_VALUE`, `SIMULTATION_TIME`, `MODELLING_TIME` now included in the `json_with_results.json` (#901)
- Missing parameters in `input_template/csv_elements` (#904)

- Confusing Dash report tab names (#933)
-
## [1.0.0] - 2021-05-31

### Added
Expand Down
6 changes: 4 additions & 2 deletions src/multi_vector_simulator/F2_autoreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def open_in_browser(app, timeout=600):
-------
Nothing, but the web app version of the auto-report is displayed in a browser.
"""

td = threading.Thread(target=app.run_server)
td.daemon = True
td.start()
Expand Down Expand Up @@ -654,8 +653,11 @@ def create_app(results_json, path_sim_output=None):
},
]

tab_name = f"{results_json[PROJECT_DATA][SCENARIO_NAME]} ({results_json[PROJECT_DATA][SCENARIO_ID]})"
app = dash.Dash(
assets_folder=asset_folder, external_stylesheets=external_stylesheets,
assets_folder=asset_folder,
external_stylesheets=external_stylesheets,
title=tab_name,
)

# Reading the relevant user-inputs from the JSON_WITH_RESULTS.json file into Pandas dataframes
Expand Down

0 comments on commit 4455ad3

Please sign in to comment.