Skip to content

Commit 4463e1f

Browse files
committed
Update traffic_assignment.py
1 parent fcd96a7 commit 4463e1f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

aequilibrae/paths/traffic_assignment.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ def save_select_link_flows(self, table_name: str, project=None) -> None:
834834
data = [
835835
table_name,
836836
"select link",
837-
self.procedure_id,
837+
f"{self.procedure_id}_sl",
838838
str(report),
839839
self.procedure_date,
840840
self.description,
@@ -847,16 +847,20 @@ def save_select_link_flows(self, table_name: str, project=None) -> None:
847847
conn.commit()
848848
conn.close()
849849

850-
def save_select_link_matrices(self, file_name: str) -> None:
850+
def save_select_link_matrices(self, file_name: str, project=None) -> None:
851851
"""
852852
Saves the Select Link matrices for each TrafficClass in the current TrafficAssignment class
853853
"""
854+
if not project:
855+
project = self.project or get_active_project()
856+
857+
file_path = str(Path(file_name).with_suffix(".omx"))
854858

855859
for cls in self.classes:
856860
# Save OD_matrices
857861
if cls._selected_links is None:
858862
continue
859-
cls.results.select_link_od.export(str(Path(file_name).with_suffix(".omx")))
863+
cls.results.select_link_od.export(path.join(project.project_base_path, "matrices", file_path))
860864

861865
def save_select_link_results(self, name: str) -> None:
862866
"""

0 commit comments

Comments
 (0)