From 1c37a6bda3c8b5111d53ce7ca2280136a436a9b8 Mon Sep 17 00:00:00 2001 From: Micah Nacht Date: Fri, 22 Feb 2019 11:17:02 -0800 Subject: [PATCH 1/3] Make runnable, and allow single directory instead of nested --- src/mqm/__main__.py | 4 ++++ src/mqm/mqm_tool.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 src/mqm/__main__.py diff --git a/src/mqm/__main__.py b/src/mqm/__main__.py new file mode 100644 index 0000000..583d3e3 --- /dev/null +++ b/src/mqm/__main__.py @@ -0,0 +1,4 @@ +from .mqm_tool import main + +if __name__ == '__main__': + main() diff --git a/src/mqm/mqm_tool.py b/src/mqm/mqm_tool.py index aa8327e..239a59d 100644 --- a/src/mqm/mqm_tool.py +++ b/src/mqm/mqm_tool.py @@ -371,7 +371,8 @@ def main(): # get a sub-directory list util = Utility() folder_list = util.get_sub_directionaries(input_folder) - del util + if len(folder_list) == 0: + folder_list.append(input_folder) # iterate through all sub-directories From 4d98217580dd271b636d89b1001282b5e246321e Mon Sep 17 00:00:00 2001 From: Micah Nacht Date: Fri, 22 Feb 2019 11:21:44 -0800 Subject: [PATCH 2/3] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b12feb..78efd3a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ pipenv shell 2. run the program through applying
``` -python3 mqm_tool.py --folderPath [a absolute folder path] --maxDepth [maximum tree depth (default = 10)] +python3 -m src.mqm --folderPath [a absolute folder path] --maxDepth [maximum tree depth (default = 10)] --countNum [a count number (default = 10)] --gridPercent [a grid percentage (default = 0.9)] --maxCount [maximum count to the second k-d tree] From 3bf494a0305b1c9bbaf2d1f21e972b2096f3c0dd Mon Sep 17 00:00:00 2001 From: Micah Nacht Date: Mon, 25 Feb 2019 16:20:02 -0800 Subject: [PATCH 3/3] Update pipfile and readme so we can run it easier --- Pipfile | 1 + Pipfile.lock | 4 ++++ README.md | 8 +++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index 79c53df..721566a 100644 --- a/Pipfile +++ b/Pipfile @@ -10,6 +10,7 @@ tox = "*" matplotlib = "~=3.0.2" area = "~=1.1.1" numpy = "~=1.15.4" +mqm = {editable = true,path = "."} [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index c343c1a..d77a8e9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -84,6 +84,10 @@ "index": "pypi", "version": "==3.0.2" }, + "mqm": { + "editable": true, + "path": "." + }, "numpy": { "hashes": [ "sha256:0df89ca13c25eaa1621a3f09af4c8ba20da849692dcae184cb55e80952c453fb", diff --git a/README.md b/README.md index 78efd3a..12d7e81 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ OpenStreetMap (OSM) data quality is always a concern and frequently a barrier fo # Usage +Eventually, this project will be on PyPI, which will make the following steps only necessary for development. + **Installing dependencies** -To utilize the MQM tool, please install Python3 and `pipenv`. Then, run the following command to install all of the dependencies:
+To run the MQM tool from source, please install Python3 and `pipenv`. Then, run the following command to install all of the dependencies:
``` pipenv install ``` @@ -22,12 +24,12 @@ pipenv shell 2. run the program through applying
``` -python3 -m src.mqm --folderPath [a absolute folder path] --maxDepth [maximum tree depth (default = 10)] +python3 -m mqm --folderPath [a absolute folder path] --maxDepth [maximum tree depth (default = 10)] --countNum [a count number (default = 10)] --gridPercent [a grid percentage (default = 0.9)] --maxCount [maximum count to the second k-d tree] For example: -python3 mqm_tool.py --folderPath ~/desktop/program/test_data +python3 -m mqm --folderPath ~/desktop/program/test_data ``` Note: