Skip to content

Commit

Permalink
feat: Adapted losses class for single_link_losses and `single_link_…
Browse files Browse the repository at this point in the history
…redundancy`. Included jupyter notebook example. (#383)

* chore: shockwave related variables and functions are removed

* chore: shockwave related variables and functions are removed

* chore: shockwave related variables and functions are removed

* chore: losses input parameter name updated

* chore: losses input parameter name updated

* doc&chore: init of losses are modified and Jupyter notebook is updated

* chore: shockwave variables are remove from analysis reader

* chore: Type change (to Path) of the input files required in the analysis.ini or config

* chore: analysis ini is updated

* chore: NetworkSection added for the __init__ of the Losses

* chore: NetworkSection related error is resolved

* feat: Losses class we developed is renamed and adjusted to single_link_losses. Now single_link_redundancy run is included. Previously developed single_link_losses is renamed to _single_link_losses

* feat: Previously developed single_link_losses is renamed to _single_link_losses

* chore: Losses import is removed

* chore: single_link_losses input files are set as Path()

* feat: single_link_redundancy tested in the single_link_losses

* chore: separato link_type_hazard_intensity is changed from _ to -

* feat: criticality_analysis is passed to the single_link_losses calculation

* feat: criticality_analysis is used instead of self.network

* chore: previously developed single_link_losses module is deleted

* feat: added link_id to AnalysisSectionIndirect

* feat: self.link_id added from AnalysisSectionIndirect.link_id

* feat: traffic intensity file is checked to have link_id consistent with the input graph (generated in the redundancy analysis)

* doc: comment added for link_id

* feat: file_id in the config_data.network is used to keep the file_id in the to-be-generated graph

* doc: typo's

* doc: test-case config update

* doc: test-case config update

* feat: link_id is added to be parametrically defined

* chore: One losses class is made.

* feat: link_id linked to the NetworkSection. Also analysis_config is added to be used for the link_id and HazardOverlay()

* feat: link_type column added to the losses module and vector_network_wrapper.

* feat: link_type column added to the losses module and the criticality_analysis is verified. Also self._check_validity_df() extended to check on the link_id column in the traffic intensities

* feat: link_type column replaced in losses.py to become a linked parameter to the NetworkSection.

* feat: Losses execution is updated.

* feat/chore: csv validation added (geometry is not allowed). Hyphens and underscores are corrected. One workflow is created (previouse to this commmit two workflows were there for multiple and single losses). The criticality gdf has to have EVi_x

* feat/filter out rows not exposed to hazard for vlh

* feat: trip purposes enum made and added to the reader

* feat: trip purposes enum made and added to the reader

* feat: trip purposes enum created earlier added to the losses.py. vlh_calc made per row.

* feat: calc_vlh updated.

* doc: formatting

* feat: vehicle_loss_hours converted to GeoDataFrame

* feat: execute returns GeoDataFrame

* feat: allow using the harardoverlay and its use in the losses.py

* doc: example updated

* feat: hour_per_day added + more information from the criticality analysis is added to the losses results

* feat: remove duplicate ID column in the criticality analysis + _calculate_production_loss_per_capita created

* doc: example_losses.ipynb is updated

* feat: filtering disrupted and non_disrupted criticality results is converted to a function + all links are included in the results

* chore: minor

* feat and doc: minor multi_link_losses update and example files and notebook update

* fix tests under test_losses.py

* fix test losses 1&2

* fix test losses 3

* chore: Small refactoring after merge

* chore: link_id turned into an object's variable with the same name.

* chore: Corrected analysis config data reader as it was parsing paths where it should not

* chore: resolving failed test_losses, updated the test inputs

* chore: resolving failed test_losses, updated the check validity of input data and a test

* chore: resolving failed test_examples losses, string converted to path

* chore: analysis losses removed from the Enum indirect analysis + analysis input files are checked to not to be None

* chore: test_analysis_collection updated to return ValueError when no analysis input file is introduced

* chore: absolute variable path to ini files

* chore: absolute variable path to ini files

* doc: input_analysis_data added to example data multi_link_losses + example notebook is updated

* doc: example notebook is updated because modify_ini parameters were passed wrongly

* chore: Corrected retrieving of network edges with invalid column 'fid'

* chore: Small correction to avoid dropping columns when they do not exist

* chore: List to tuple to be used as indices and the rest of the code is updated to handle a tuple of links (and their types) when these links are simplified + resilience_curve is updated

* chore: test_losses updated based + losses updated for controlling self.criticality_non_disrupted length

* doc: AnalysisConfig files to None

* doc: example_losses.ipynb updated to only contain teh single_link_losses

---------

Co-authored-by: MatthiasHauth <[email protected]>
Co-authored-by: Carles S. Soriano Perez <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2024
1 parent 7f9722f commit bc34e9f
Show file tree
Hide file tree
Showing 203 changed files with 3,978 additions and 20,484 deletions.

This file was deleted.

11 changes: 0 additions & 11 deletions examples/data/losses/analysis.ini

This file was deleted.

11 changes: 0 additions & 11 deletions examples/data/losses/output/analysis.ini

This file was deleted.

Binary file removed examples/data/losses/output/hazard_names.xlsx
Binary file not shown.

This file was deleted.

Binary file not shown.
30 changes: 0 additions & 30 deletions examples/data/losses/output/multi_link_redundancy/settings.txt

This file was deleted.

This file was deleted.

Binary file not shown.
30 changes: 0 additions & 30 deletions examples/data/losses/output/single_link_redundancy/settings.txt

This file was deleted.

794 changes: 0 additions & 794 deletions examples/data/losses/static/network/Red_Vial_RD_wgs84.geojson

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
link_type_hazard_intensity;duration_steps;functionality_loss_ratio
Troncal-N_0.0-0.2;[0.0];[0.0]
Troncal-N_0.2-0.5;[1.0];[0.01]
Troncal-N_0.5-1.5;[2.0];[0.02]
Troncal-N_1.5-9999.0;[10.0, 20.0];[0.2, 0.1]
Regional-N_0.0-0.2;[0.0];[0.0]
Regional-N_0.2-0.5;[1.0];[0.01]
Regional-N_0.5-1.5;[2.0];[0.02]
Regional-N_1.5-9999.0;[10.0, 20.0];[0.2, 0.1]
Local-N_0.0-0.2;[0.0];[0.0]
Local-N_0.2-0.5;[1.0];[0.01]
Local-N_0.5-1.5;[2.0];[0.02]
Local-N_1.5-9999.0;[10.0, 20.0];[0.2, 0.1]
Caminos Vecinales-N_0.0-0.2;[0.0];[0.0]
Caminos Vecinales-N_0.2-0.5;[1.5];[0.015]
Caminos Vecinales-N_0.5-1.5;[10.0, 30.0];[0.3, 0.1]
Caminos Vecinales-N_1.5-9999.0;[10.0, 30.0];[0.3, 0.1]
Troncal-S_0.0-0.2;[1.0];[0.01]
Troncal-S_0.2-0.5;[10.0, 20.0];[0.2, 0.1]
Troncal-S_0.5-1.5;[10.0, 30.0, 50.0];[0.5, 0.3, 0.1]
Troncal-S_1.5-9999.0;[10.0, 40.0, 100.0];[1.0, 60.0, 40.0]
Regional-S_0.0-0.2;[1.0];[0.01]
Regional-S_0.2-0.5;[10.0, 20.0];[0.2, 0.1]
Regional-S_0.5-1.5;[10.0, 30.0, 50.0];[0.5, 0.3, 0.1]
Regional-S_1.5-9999.0;[10.0, 40.0, 100.0];[1.0, 60.0, 40.0]
Local-S_0.0-0.2;[1.0];[0.01]
Local-S_0.2-0.5;[10.0, 20.0];[0.2, 0.1]
Local-S_0.5-1.5;[10.0, 30.0, 50.0];[0.5, 0.3, 0.1]
Local-S_1.5-9999.0;[10.0, 40.0, 100.0];[1.0, 60.0, 40.0]
Caminos Vecinales-S_0.0-0.2;[1.5];[0.015]
Caminos Vecinales-S_0.2-0.5;[10.0, 30.0];[0.3, 0.1]
Caminos Vecinales-S_0.5-1.5;[10.0, 30.0, 75.0];[0.75, 0.3, 0.1]
Caminos Vecinales-S_1.5-9999.0;[10.0, 40.0, 100.0];[1.0, 60.0, 40.0]
tunnel_0.0-0.2;[1.0];[0.01]
tunnel_0.2-0.5;[3.0];[0.03]
tunnel_0.5-1.5;[5.0];[0.05]
tunnel_1.5-9999.0;[10.0, 20.0];[0.2, 0.1]
Puentes_0.0-0.2;[3.0];[0.03]
Puentes_0.2-0.5;[5.0];[0.05]
Puentes_0.5-1.5;[10.0];[0.1]
Puentes_1.5-9999.0;[10.0, 20.0];[0.2, 0.1]
culvert_0.0-0.2;[5.0];[0.05]
culvert_0.2-0.5;[10.0];[0.1]
culvert_0.5-1.5;[10.0, 20.0];[0.2, 0.1]
culvert_1.5-9999.0;[10.0, 40.0];[0.4, 0.1]
Loading

0 comments on commit bc34e9f

Please sign in to comment.