aequilibrae.utils.simwrapper.simwrapper_utils#

Functions

export_convergence_csv(results_dataframe, ...)

Write assignment convergence for all results tables into data_dir/assignment_convergence.csv.

get_links_bounds_box(project)

Compute box around all coordinates in links table of project.

get_project_center(project)

Finds center coordinates of project

get_project_zoom(project)

Finds a reasonable zoom level based on project links' reach

parse_convergence_json(json_string)

Parse a (possibly double-encoded) procedure-report JSON string.

pretty_round(value[, direction])

Round a value to a 'pretty' number (1, 2, 5 multiples of powers of 10).

aequilibrae.utils.simwrapper.simwrapper_utils.export_convergence_csv(results_dataframe, data_dir)[source]#

Write assignment convergence for all results tables into data_dir/assignment_convergence.csv.

Returns Path to written CSV, or None if there was no convergence data. Raises ValueError when iteration/rgap lengths mismatch for a scenario.

Compute box around all coordinates in links table of project. Queries spatial database to find max and min x and y coords across all link geometries to return overall network links’ reach.

Returns bounding box values (xmin, ymin, xmax, ymax)

aequilibrae.utils.simwrapper.simwrapper_utils.get_project_center(project)[source]#

Finds center coordinates of project

aequilibrae.utils.simwrapper.simwrapper_utils.get_project_zoom(project)[source]#

Finds a reasonable zoom level based on project links’ reach

aequilibrae.utils.simwrapper.simwrapper_utils.parse_convergence_json(json_string)[source]#

Parse a (possibly double-encoded) procedure-report JSON string.

Returns (iteration_list, rgap_list). For invalid/missing input returns ([], []).

aequilibrae.utils.simwrapper.simwrapper_utils.pretty_round(value, direction='up')[source]#

Round a value to a ‘pretty’ number (1, 2, 5 multiples of powers of 10).

Arguments:

value (float): value to round direction (str): ‘up’ to ceil, ‘down’ to floor

Returns:

float: the rounded pretty number