Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
This repository was archived by the owner on May 7, 2025. It is now read-only.

Location of results folder depends on trailing slash #14

Description

@nachtm

With the edits from #13, we can run the project. It mostly works, but is a little unstable. If you run it like so:

python3 -m src.mqm inputFolder=/Absolute/path/to/parent/shallow/folder it runs fine.

However, if you run it like python3 -m src.mqm inputFolder=/Absolute/path/to/parent/shallow/folder/ it creates the results folder inside of shallow/folder/ and tries to read from it, failing to do so and throwing an error:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/micahnacht/github/public-repos/osmquality/src/mqm/__main__.py", line 4, in <module>
    main()
  File "/Users/micahnacht/github/public-repos/osmquality/src/mqm/mqm_tool.py", line 385, in main
    os.path.split(sub_folder)[1])
  File "/Users/micahnacht/github/public-repos/osmquality/src/mqm/mqm_tool.py", line 278, in process_single_folder
    road_file = geo_processor.get_road_file()
  File "/Users/micahnacht/github/public-repos/osmquality/src/mqm/geo_process.py", line 307, in get_road_file
    road_file_name = [f for f in os.listdir(os.path.join(self.folder_path, sub_folder[0])) if f.endswith('.geojson')][0]
IndexError: list index out of range

We should always create the results folder outside of the folder from which we're reading.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions