Skip to content

Add get_city_name() method to dataloader, to fetch name of city where a log was captured.#27

Merged
benjaminrwilson merged 9 commits intomainfrom
dataloader-get-city-name-method
Apr 1, 2022
Merged

Add get_city_name() method to dataloader, to fetch name of city where a log was captured.#27
benjaminrwilson merged 9 commits intomainfrom
dataloader-get-city-name-method

Conversation

@senselessdev1
Copy link
Copy Markdown
Contributor

@senselessdev1 senselessdev1 commented Mar 26, 2022

PR Summary

Add get_city_name() method to dataloader, to fetch name of city where a log was captured. Works for TbV, Sensor, or LIDAR datasets.

Testing

In order to ensure this PR works as intended, it is:

  • unit tested.
  • other or not applicable (additional detail/rationale required)

Compliance with Standards

As the author, I certify that this PR conforms to the following standards:

  • Code changes conform to PEP8 and docstrings conform to the Google Python style guide.
  • A well-written summary explains what was done and why it was done.
  • The PR is adequately tested and the testing details and links to external results are included.

@senselessdev1 senselessdev1 changed the title Add get_cityname() method to dataloader, to fetch name of city where a log was captured. Add get_city_name() method to dataloader, to fetch name of city where a log was captured. Mar 26, 2022
RuntimeError: If no vector map file is found for the query log ID.
"""
vector_map_fpaths = list(self._data_dir.glob(f"{log_id}/map/log_map_archive*"))
if len(vector_map_fpaths) != 1:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we add a check for if there's an extra vector map file in the directory?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@benjaminrwilson thanks for the review. I think this logic is checking for that case already, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, for sure --- the string for the RuntimeError would be a little misleading in that case though, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. I changed the check to == 0 now, which I think is the more intuitive case (the log is not present).

@benjaminrwilson benjaminrwilson merged commit 5def228 into main Apr 1, 2022
@benjaminrwilson benjaminrwilson deleted the dataloader-get-city-name-method branch April 1, 2022 15:26
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 this pull request may close these issues.

4 participants