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 2b12feb..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 mqm_tool.py --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: 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