Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
pveigadecamargo committed Jan 27, 2024
1 parent 7fb1602 commit 8d52a60
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions aequilibrae/distribution/gravity_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The procedures implemented in this code are some of those suggested in
Modelling Transport, 4th Edition, Ortuzar and Willumsen, Wiley 2011
"""

from time import perf_counter

import numpy as np
Expand Down
12 changes: 6 additions & 6 deletions aequilibrae/matrix/aequilibrae_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,9 @@ def __write__(self):
np.memmap(self.file_path, dtype="uint8", offset=17, mode="r+", shape=1)[0] = data_size

# matrix name
np.memmap(self.file_path, dtype="S" + str(MATRIX_NAME_MAX_LENGTH), offset=18, mode="r+", shape=1)[
0
] = self.name
np.memmap(self.file_path, dtype="S" + str(MATRIX_NAME_MAX_LENGTH), offset=18, mode="r+", shape=1)[0] = (
self.name
)

# matrix description
offset = 18 + MATRIX_NAME_MAX_LENGTH
Expand Down Expand Up @@ -1095,9 +1095,9 @@ def setName(self, matrix_name: str):
if len(str(matrix_name)) > MATRIX_NAME_MAX_LENGTH:
matrix_name = str(matrix_name)[0:MATRIX_NAME_MAX_LENGTH]

np.memmap(self.file_path, dtype="S" + str(MATRIX_NAME_MAX_LENGTH), offset=18, mode="r+", shape=1)[
0
] = matrix_name
np.memmap(self.file_path, dtype="S" + str(MATRIX_NAME_MAX_LENGTH), offset=18, mode="r+", shape=1)[0] = (
matrix_name
)

def setDescription(self, matrix_description: str):
"""
Expand Down
1 change: 1 addition & 0 deletions aequilibrae/paths/results/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
STILL NEED TO ADD SOME EXPLANATIONS HERE
"""

__author__ = "Pedro Camargo ($Author: Pedro Camargo $)"
__version__ = "1.0"
__revision__ = "$Revision: 1 $"
Expand Down
1 change: 1 addition & 0 deletions aequilibrae/project/network/osm/osm_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
For the original work, please see https://github.com/gboeing/osmnx
"""

import logging
import time
import re
Expand Down
6 changes: 3 additions & 3 deletions aequilibrae/transit/gtfs_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def __deconflict_stop_times(self) -> None:
)

for _, rec in max_speeds.iterrows():
df.loc[
(df.dist >= rec.min_distance) & ((df.dist < rec.max_distance)), "max_speed"
] = rec.speed
df.loc[(df.dist >= rec.min_distance) & ((df.dist < rec.max_distance)), "max_speed"] = (
rec.speed
)

to_fix = df[df.max_speed < df.speed].index.values
if to_fix.shape[0] > 0:
Expand Down
8 changes: 5 additions & 3 deletions aequilibrae/transit/transit_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,9 +1428,11 @@ def to_transit_graph(self) -> TransitGraph:
g.network["id"] = g.network.link_id
g.prepare_graph(
self.vertices[
(self.vertices.node_type == "origin")
if self.blocking_centroid_flows
else (self.vertices.node_type == "od")
(
(self.vertices.node_type == "origin")
if self.blocking_centroid_flows
else (self.vertices.node_type == "od")
)
].node_id.values
)
g.set_graph("trav_time")
Expand Down
1 change: 1 addition & 0 deletions aequilibrae/utils/worker_thread.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Original Author: UNKNOWN. COPIED FROM STACKOVERFLOW BUT CAN'T REMEMBER EXACTLY WHERE
"""

import importlib.util as iutil

spec = iutil.find_spec("PyQt5")
Expand Down

0 comments on commit 8d52a60

Please sign in to comment.