UNA
The top-level UNA class is the entry point for every analysis. It owns
a Settings instance and a Topology instance, and dispatches to the
appropriate engine when you call one of its Run* methods.
- class UNA(verbosity=1)[source]
Bases:
object- Parameters:
verbosity (int)
- accessibility = None
- flow = None
- composite_result = None
- has_flow_results = False
- has_centrality_results = False
- RunBatch(analysis, pairing_file=None)[source]
Run an analysis (accessibility or flow) for every entry in self.projects.
A “project” in UNA is a saved list of Settings snapshots (this method’s self.projects list). An “analysis” is which engine family each row represents — “accessibility” or “flow” — so calling RunBatch(“flow”) runs every project row as a Flow analysis. See DESIGN.md § Terminology.
If pairing_file is provided, self.projects is replaced by loading that file first. Accepts .csv, .tsv, or .json (array exported by ExportProjectAsJSON / ExportProjectAsCSV). When no file is given, whatever is already in self.projects is used — build it with SaveSettingsToProject() first.
- RunODM(format='Sqlite', speed=5.0, file_name=None)[source]
Compute and export an origin-destination distance/duration matrix.
Completely independent — builds its own network topology and engine. Does not require RunAccessibility() to have been called first.
Requires settings.origin_uid_column and settings.destination_id_column to be set so the output rows are labelled with real identifiers.
- ConvertProject_csv_to_json(csv_file, json_file=None, compact=True)[source]
Convert a project pairing CSV/TSV to a JSON array of settings objects.
Each row becomes one element in the JSON array containing only the settings values that were present in that row.
- Parameters:
csv_file (str) – Path to the pairing CSV or TSV file.
json_file (str) – Output path. Defaults to the same path as csv_file with a .json extension.
compact (bool) – If True (default), each object contains only fields that differ from their default value. If False, every settings field is written out — useful for documentation.
- Returns:
The path to the written JSON file.
- Return type:
None
- ExportProjectAsJSON(folder=None, file_name='project', compact=True)[source]
Export the project settings list to a JSON file.
- ExportProjectAsCSV(file_name='project')[source]
Export the project settings list to a CSV file.
NOTE: The CSV is written to settings.data_folder so the project file stays alongside the data files it references. Set settings.data_folder before calling if you need a specific output location.
- Parameters:
file_name (str) – File name without extension.
- Return type:
None