Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes skim creation of simplified graph #248

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aequilibrae/paths/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def prepare_graph(self, centroids: np.ndarray) -> None:
self.all_nodes, self.num_nodes, self.nodes_to_indices, self.fs, self.graph = properties

# We generate IDs that we KNOW will be constant across modes
self.graph.sort_values(by=['link_id', 'direction'], inplace=True)
self.graph.sort_values(by=["link_id", "direction"], inplace=True)
self.graph.loc[:, "__supernet_id__"] = np.arange(self.graph.shape[0]).astype(self.__integer_type)
self.graph.sort_values(by=['a_node', 'b_node'], inplace=True)
self.graph.sort_values(by=["a_node", "b_node"], inplace=True)

self.num_links = self.graph.shape[0]
self.__build_derived_properties()
Expand Down Expand Up @@ -479,7 +479,7 @@ def set_skimming(self, skim_fields: list) -> None:
self.compact_skims = np.zeros((self.compact_num_links, len(skim_fields) + 1), self.__float_type)
df = self.__graph_groupby.sum()[skim_fields].reset_index()
for i, skm in enumerate(skim_fields):
self.compact_skims[df.index.values, i] = df[skm].values[:].astype(self.__float_type)
self.compact_skims[df.index.values[:-1], i] = df[skm].values[:-1].astype(self.__float_type)

self.skims = np.zeros((self.num_links, len(skim_fields) + 1), self.__float_type)
t = [x for x in skim_fields if self.graph[x].dtype != self.__float_type]
Expand Down