Skip to content

Commit

Permalink
Style and build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Moss committed Dec 14, 2023
1 parent cfd8d1b commit 3b4c5aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions aequilibrae/paths/public_transport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ class HyperpathGenerating:
raise TypeError("graph should be a TransitGraph")

for col in [trav_time, freq]:
if not pd.api.types.is_numeric_dtype(edges[col].dtype):
if not pd.api.types.is_numeric_dtype(graph[col].dtype):
raise TypeError(f"column '{col}' should be of numeric type")

if any(graph.graph[col].isna()):
raise ValueError(f"column '{col}' should not have any missing values")

if edges[col].min() < 0.0:
if graph[col].min() < 0.0:
raise ValueError(f"column '{col}' should be nonnegative")


Expand Down
2 changes: 1 addition & 1 deletion aequilibrae/paths/traffic_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def set_demand_matrix_core(self, core: str):
Set the matrix core to use for demand.
:Arguments:
**core** (:obj:`str`): """
**core** (:obj:`str`):"""
if core not in self.matrix.view_names:
raise KeyError(f"'{core}' is not present in `matrix.view_names`")
self.matrix_core = core
14 changes: 8 additions & 6 deletions aequilibrae/transit/transit_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,9 @@ def __init__(
self.project_conn = database_connection("project_database")

self.period_id = period_id
start, end = (
self.project_conn
.execute("SELECT period_start, period_end FROM periods WHERE period_id = ?;", [period_id])
.fetchall()[0]
)
start, end = self.project_conn.execute(
"SELECT period_start, period_end FROM periods WHERE period_id = ?;", [period_id]
).fetchall()[0]

self.start = start - time_margin # starting time of the selected time period
self.end = end + time_margin # ending time of the selected time period
Expand Down Expand Up @@ -1457,7 +1455,11 @@ def from_db(cls, public_transport_conn, period_id: int, **kwargs):
**public_transport_conn** (:obj:`sqlite3.Connection`): Connection to the ``public_transport.sqlite`` database.
"""
project_conn = database_connection("project_database")
config = json.loads(project_conn.execute("SELECT config FROM transit_graph_configs WHERE period_id = ? LIMIT 1;", [period_id]).fetchone()[0])
config = json.loads(
project_conn.execute(
"SELECT config FROM transit_graph_configs WHERE period_id = ? LIMIT 1;", [period_id]
).fetchone()[0]
)
config.update(kwargs)

graph = cls(public_transport_conn, **config)
Expand Down

0 comments on commit 3b4c5aa

Please sign in to comment.