-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 389 allow an analysis run without files 2nd attempt
Chosen implementation: * create a classmethod in Ra2ceHandler to initialize the handler from configs * initialize the logger from classmethods, depending if it includes file logging or only console logging * renamed the logger module to match the classname Feature commits: * chore: first setup of classmethod * chore: add new way to notebook * test: add valid assert * chore: rework handler * chore: rework tech notebook * chore: change data dir and add some documentation * chore: process review comments * chore: improve logging setup from config * chore: rename logger to match classname * chore: docstring added * test: Extended test to create a copy of the reference data and avoid locking issues --------- Co-authored-by: Carles S. Soriano Perez <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,008 additions
and
685 deletions.
There are no files selected for viewing
638 changes: 343 additions & 295 deletions
638
examples/tech_meetings/20240403_run_without_ini_files_DIY.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
696 changes: 348 additions & 348 deletions
696
examples/tech_meetings/20240403_using_enums_DIY.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
from pathlib import Path | ||
from ra2ce.ra2ce_handler import Ra2ceHandler # import the ra2cehandler to run ra2ce analyses | ||
|
||
_network_ini_name = "network.ini" # set the name for the network.ini settings file | ||
from ra2ce.ra2ce_handler import ( | ||
Ra2ceHandler, # import the ra2cehandler to run ra2ce analyses | ||
) | ||
|
||
folder_dir = Path(r'/data') | ||
_network_ini_name = "network.ini" # set the name for the network.ini settings file | ||
|
||
root_dir = folder_dir # specify the path to the project folder in the examples folder | ||
network_ini = root_dir / _network_ini_name # we set the _network_ini_name before, so we can use this now for the project | ||
assert network_ini.is_file() # check whether the network.ini file exists | ||
folder_dir = Path(r"/data") | ||
|
||
root_dir = folder_dir # specify the path to the project folder in the examples folder | ||
network_ini = ( | ||
root_dir / _network_ini_name | ||
) # we set the _network_ini_name before, so we can use this now for the project | ||
assert network_ini.is_file() # check whether the network.ini file exists | ||
|
||
handler = Ra2ceHandler(network=network_ini, analysis=None) | ||
handler.configure() | ||
|
||
# Set the path to your output_graph folder to find the network/graph creation: | ||
path_output_graph = root_dir / "static" / "output_graph" | ||
|
||
# Now we find and inspect the file 'base_graph_edges.gpkg' which holds the 'edges' of the network. | ||
# Now we find and inspect the file 'base_graph_edges.gpkg' which holds the 'edges' of the network. | ||
# An edge (or link) of a network (or graph) represents a connection between two nodes (or vertices) of the network. More information on: https://mathinsight.org/definition/network_edge#:~:text=An%20edge%20(or%20link)%20of,in%20the%20first%20figure%20below. | ||
base_graph_edges = path_output_graph / "base_graph_edges.gpkg" | ||
edges_gdf = gpd.read_file(base_graph_edges, driver = "GPKG") | ||
edges_gdf = gpd.read_file(base_graph_edges, driver="GPKG") | ||
edges_gdf.head() | ||
|
||
edges_gdf.explore(column='highway', tiles="CartoDB positron") | ||
edges_gdf.explore(column="highway", tiles="CartoDB positron") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.