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

ValhallaMatcher AttributeError: 'int' object has no attribute 'start' #183

Closed
amin-sajadi opened this issue May 27, 2024 · 2 comments · Fixed by #184
Closed

ValhallaMatcher AttributeError: 'int' object has no attribute 'start' #183

amin-sajadi opened this issue May 27, 2024 · 2 comments · Fixed by #184
Assignees

Comments

@amin-sajadi
Copy link

amin-sajadi commented May 27, 2024

Dear all,

I would like to inform you that ValhallaMatcher cannot use the matches_to_dataframe() or path_to_dataframe(). Please find the following full error message:

AttributeError Traceback (most recent call last)
...\lib\site-packages\mappymatch\matchers\match_result.py:39, in MatchResult.path_to_dataframe(self)
[36] (.../lib/site-packages/mappymatch/matchers/match_result.py:36) if self.path is None:
[37] (.../lib/site-packages/mappymatch/matchers/match_result.py:37) return pd.DataFrame()
---> [39] (.../lib/site-packages/mappymatch/matchers/match_result.py:39) df = pd.DataFrame([r.to_flat_dict() for r in self.path])
[40] (.../lib/site-packages/mappymatch/matchers/match_result.py:40) df = df.fillna(np.NAN)
[42] (.../lib/site-packages/mappymatch/matchers/match_result.py:42) return df

File ...\lib\site-packages\mappymatch\matchers\match_result.py:39, in (.0)
[36] (.../lib/site-packages/mappymatch/matchers/match_result.py:36) if self.path is None:
[37] (.../lib/site-packages/mappymatch/matchers/match_result.py:37) return pd.DataFrame()
---> [39] (.../lib/site-packages/mappymatch/matchers/match_result.py:39) df = pd.DataFrame([r.to_flat_dict() for r in self.path])
[40] (.../lib/site-packages/mappymatch/matchers/match_result.py:40) df = df.fillna(np.NAN)
[42] (.../lib/site-packages/mappymatch/matchers/match_result.py:42) return df

File ...\lib\site-packages\mappymatch\constructs\road.py:64, in Road.to_flat_dict(self)
[62] (.../lib/site-packages/mappymatch/constructs/road.py:62) return self.to_dict()
[63] (.../lib/site-packages/mappymatch/constructs/road.py:63) else:
---> [64] (.../lib/site-packages/mappymatch/constructs/road.py:64) d = {**self.to_dict(), **self.metadata}
[65] (.../lib/site-packages/mappymatch/constructs/road.py:65) del d["metadata"]
[66] (.../lib/site-packages/mappymatch/constructs/road.py:66) return d
...
---> [51] (.../lib/site-packages/mappymatch/constructs/road.py:51) d["origin_junction_id"] = self.road_id.start
[52] (.../lib/site-packages/mappymatch/constructs/road.py:52) d["destination_junction_id"] = self.road_id.end
[53] (.../lib/site-packages/mappymatch/constructs/road.py:53) d["road_key"] = self.road_id.key

AttributeError: 'int' object has no attribute 'start'

I would be grateful if you please let me know your commets. Thank you very much and keep up the great work.

@nreinicke
Copy link
Collaborator

Thanks for catching this! I've identified where the problem is and will push a fix up in the next release.

@nreinicke
Copy link
Collaborator

@amin-sajadi - I just released 0.4.3 that should have a fix for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants