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

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

Merged
merged 9 commits into from
Apr 1, 2022

Conversation

senselessdev1
Copy link
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
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?

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
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
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).

src/av2/datasets/sensor/av2_sensor_dataloader.py Outdated Show resolved Hide resolved
@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