Skip to content

Commit

Permalink
Merge pull request #130 from AequilibraE/issue129
Browse files Browse the repository at this point in the history
Addresses issue #129
  • Loading branch information
jamiecook authored Apr 20, 2020
2 parents 0da7b4c + 7057d8b commit 2376874
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aequilibrae/paths/results/assignment_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def prepare(self, graph: Graph, matrix: AequilibraeMatrix) -> None:
if graph is None:
raise ("Please provide a graph")
else:
if not graph.cost_field:
raise Exception('Cost field needs to be set for computation. use graph.set_graph("your_cost_field")')

self.nodes = graph.num_nodes
self.zones = graph.num_zones
self.centroids = graph.centroids
Expand Down
4 changes: 4 additions & 0 deletions aequilibrae/paths/results/path_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def prepare(self, graph: Graph) -> None:
Args:
*graph* (:obj:`Graph`): Needs to have been set with number of centroids and list of skims (if any)
"""

if not graph.cost_field:
raise Exception('Cost field needs to be set for cost computation. use graph.set_graph("your_cost_field")')

self.__integer_type = graph.default_types("int")
self.__float_type = graph.default_types("float")
self.nodes = graph.num_nodes + 1
Expand Down
3 changes: 3 additions & 0 deletions aequilibrae/paths/results/skim_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def prepare(self, graph):
*graph* (:obj:`Graph`): Needs to have been set with number of centroids and list of skims (if any)
"""

if not graph.cost_field:
raise Exception('Cost field needs to be set for computation. use graph.set_graph("your_cost_field")')

self.nodes = graph.num_nodes + 1
self.zones = graph.num_zones
self.links = graph.num_links + 1
Expand Down

1 comment on commit 2376874

@pedrocamargo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thasnks, @jamiecook !!

Please sign in to comment.