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

Location of results folder depends on trailing slash #14

Open
nachtm opened this issue Feb 22, 2019 · 1 comment
Open

Location of results folder depends on trailing slash #14

nachtm opened this issue Feb 22, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@nachtm
Copy link
Contributor

nachtm commented Feb 22, 2019

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.

@danielduhh
Copy link
Contributor

Beware: if you have a trailing forward slash in your --folderPath arg, it will create a results folder in your path, which will then break your next run unless you delete it!

@danielduhh danielduhh added the bug Something isn't working label Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants