From 93a4d858903ec85c4bb1d23e02305376e991161d Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 6 May 2019 15:42:49 -0400 Subject: [PATCH] Reorganized directory structure, scripts --> stages Former-commit-id: 9924286e50bc752204497e46fba740461bd55e20 --- opendm/context.py | 4 ++-- .../grass_addons => opendm/grass/addons}/i.cutlinesmod.py | 0 opendm/grass_engine.py | 2 +- opendm/remote.py | 5 ++++- run.py | 2 +- {scripts => stages}/__init__.py | 0 {scripts => stages}/dataset.py | 0 {scripts => stages}/mve.py | 0 {scripts => stages}/mvstex.py | 0 {scripts => stages}/odm_app.py | 0 {scripts => stages}/odm_dem.py | 0 {scripts => stages}/odm_filterpoints.py | 0 {scripts => stages}/odm_georeferencing.py | 0 {scripts => stages}/odm_meshing.py | 0 {scripts => stages}/odm_orthophoto.py | 0 {scripts => stages}/odm_slam.py | 0 {scripts => stages}/run_opensfm.py | 0 {scripts => stages}/splitmerge.py | 0 18 files changed, 8 insertions(+), 5 deletions(-) rename {scripts/grass_addons => opendm/grass/addons}/i.cutlinesmod.py (100%) rename {scripts => stages}/__init__.py (100%) rename {scripts => stages}/dataset.py (100%) rename {scripts => stages}/mve.py (100%) rename {scripts => stages}/mvstex.py (100%) rename {scripts => stages}/odm_app.py (100%) rename {scripts => stages}/odm_dem.py (100%) rename {scripts => stages}/odm_filterpoints.py (100%) rename {scripts => stages}/odm_georeferencing.py (100%) rename {scripts => stages}/odm_meshing.py (100%) rename {scripts => stages}/odm_orthophoto.py (100%) rename {scripts => stages}/odm_slam.py (100%) rename {scripts => stages}/run_opensfm.py (100%) rename {scripts => stages}/splitmerge.py (100%) diff --git a/opendm/context.py b/opendm/context.py index e49660fd..7e4d9df4 100644 --- a/opendm/context.py +++ b/opendm/context.py @@ -4,8 +4,8 @@ from opendm import io import multiprocessing # Define some needed locations -scripts_path = os.path.abspath(os.path.dirname(__file__)) -root_path, _ = os.path.split(scripts_path) +current_path = os.path.abspath(os.path.dirname(__file__)) +root_path, _ = os.path.split(current_path) superbuild_path = os.path.join(root_path, 'SuperBuild') superbuild_bin_path = os.path.join(superbuild_path, 'install', 'bin') diff --git a/scripts/grass_addons/i.cutlinesmod.py b/opendm/grass/addons/i.cutlinesmod.py similarity index 100% rename from scripts/grass_addons/i.cutlinesmod.py rename to opendm/grass/addons/i.cutlinesmod.py diff --git a/opendm/grass_engine.py b/opendm/grass_engine.py index 29389a8e..8b7c7832 100644 --- a/opendm/grass_engine.py +++ b/opendm/grass_engine.py @@ -92,7 +92,7 @@ class GrassContext: # Execute it log.ODM_INFO("Executing grass script from {}: {} --tmp-location {} --exec bash script.sh".format(self.get_cwd(), self.grass_binary, self.location)) env = os.environ.copy() - env["GRASS_ADDON_PATH"] = env.get("GRASS_ADDON_PATH", "") + os.path.abspath(os.path.join("scripts/grass_addons")) + env["GRASS_ADDON_PATH"] = env.get("GRASS_ADDON_PATH", "") + os.path.abspath(os.path.join("opendm/grass/addons")) filename = os.path.join(self.get_cwd(), 'output.log') with open(filename, 'wb') as writer, open(filename, 'rb', 1) as reader: diff --git a/opendm/remote.py b/opendm/remote.py index ad42964b..e81522f2 100644 --- a/opendm/remote.py +++ b/opendm/remote.py @@ -22,7 +22,10 @@ class HybridDistributedExecutor: if not self.project_paths: return - + # TODO: build queue + + # TODO: local thread worker + diff --git a/run.py b/run.py index c7be42bd..00e5df59 100755 --- a/run.py +++ b/run.py @@ -8,7 +8,7 @@ from opendm import io import os from pipes import quote -from scripts.odm_app import ODMApp +from stages.odm_app import ODMApp if __name__ == '__main__': log.init() diff --git a/scripts/__init__.py b/stages/__init__.py similarity index 100% rename from scripts/__init__.py rename to stages/__init__.py diff --git a/scripts/dataset.py b/stages/dataset.py similarity index 100% rename from scripts/dataset.py rename to stages/dataset.py diff --git a/scripts/mve.py b/stages/mve.py similarity index 100% rename from scripts/mve.py rename to stages/mve.py diff --git a/scripts/mvstex.py b/stages/mvstex.py similarity index 100% rename from scripts/mvstex.py rename to stages/mvstex.py diff --git a/scripts/odm_app.py b/stages/odm_app.py similarity index 100% rename from scripts/odm_app.py rename to stages/odm_app.py diff --git a/scripts/odm_dem.py b/stages/odm_dem.py similarity index 100% rename from scripts/odm_dem.py rename to stages/odm_dem.py diff --git a/scripts/odm_filterpoints.py b/stages/odm_filterpoints.py similarity index 100% rename from scripts/odm_filterpoints.py rename to stages/odm_filterpoints.py diff --git a/scripts/odm_georeferencing.py b/stages/odm_georeferencing.py similarity index 100% rename from scripts/odm_georeferencing.py rename to stages/odm_georeferencing.py diff --git a/scripts/odm_meshing.py b/stages/odm_meshing.py similarity index 100% rename from scripts/odm_meshing.py rename to stages/odm_meshing.py diff --git a/scripts/odm_orthophoto.py b/stages/odm_orthophoto.py similarity index 100% rename from scripts/odm_orthophoto.py rename to stages/odm_orthophoto.py diff --git a/scripts/odm_slam.py b/stages/odm_slam.py similarity index 100% rename from scripts/odm_slam.py rename to stages/odm_slam.py diff --git a/scripts/run_opensfm.py b/stages/run_opensfm.py similarity index 100% rename from scripts/run_opensfm.py rename to stages/run_opensfm.py diff --git a/scripts/splitmerge.py b/stages/splitmerge.py similarity index 100% rename from scripts/splitmerge.py rename to stages/splitmerge.py