From 0a997dcf80450f751979aa1067099656610f49d3 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 20 Jul 2021 00:04:08 -0400 Subject: [PATCH] Refactor --- scripts/extract_odm_strings.py | 7 +++++-- source/arguments.rst | 6 +++--- source/arguments/dsm.rst | 2 +- source/arguments/dtm.rst | 2 +- source/arguments/pc-classify.rst | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/extract_odm_strings.py b/scripts/extract_odm_strings.py index 5f2fa686d..22a8e3933 100644 --- a/scripts/extract_odm_strings.py +++ b/scripts/extract_odm_strings.py @@ -100,6 +100,9 @@ if len(options) > 0: opt_name = max(arg_map + (opt_name, ), key=len) return opt_name.replace("--", "") + def get_opt_descr(opt): + return options[opt].get('help', '').replace("*", "\*") + def get_opt_choices(opt): return options[opt].get('choices', options[opt].get('metavar', '')).replace('[', '').replace(']', '').replace(',', ' | ').replace('\'', '') @@ -115,7 +118,7 @@ if len(options) > 0: kwargs = { 'opt': opt_name, 'ticks': '`' * len(opt_name), - 'descr': options[opt].get('help', '').replace("*", "\*"), + 'descr': get_opt_descr(opt), 'parameter': "**Options:** *%s*" % get_opt_choices(opt) if get_opt_choices(opt) else "", 'include': ".. include:: ../arguments_edit/%s" % os.path.basename(include_file), 'editfile': os.path.join("arguments_edit", os.path.basename(include_file)), @@ -131,7 +134,7 @@ if len(options) > 0: get_opt_name(opt), get_opt_name(opt), get_opt_choices(opt), - options[opt].get('help', '') + get_opt_descr(opt) ) with open(tmplfile) as f: diff --git a/source/arguments.rst b/source/arguments.rst index 5627e1554..44fa75f93 100644 --- a/source/arguments.rst +++ b/source/arguments.rst @@ -38,10 +38,10 @@ Options and Flags Legacy option (use --pc-quality instead). Controls the density of the point cloud by setting the resolution of the depthmap images. Higher values take longer to compute but produce denser point clouds. Default: ``640`` :ref:`dsm` - Use this tag to build a DSM (Digital Surface Model, ground + objects) using a progressive morphological filter. Check the --dem* parameters for finer tuning. Default: ``False`` + Use this tag to build a DSM (Digital Surface Model, ground + objects) using a progressive morphological filter. Check the --dem\* parameters for finer tuning. Default: ``False`` :ref:`dtm` - Use this tag to build a DTM (Digital Terrain Model, ground only) using a simple morphological filter. Check the --dem* and --smrf* parameters for finer tuning. Default: ``False`` + Use this tag to build a DTM (Digital Terrain Model, ground only) using a simple morphological filter. Check the --dem\* and --smrf\* parameters for finer tuning. Default: ``False`` :ref:`end-with` dataset | split | merge | opensfm | openmvs | odm_filterpoints | odm_meshing | mvs_texturing | odm_georeferencing | odm_dem | odm_orthophoto | odm_report End processing at this stage. . Default: ``odm_report`` @@ -122,7 +122,7 @@ Options and Flags Orthophoto resolution in cm / pixel. Note that this value is capped by a ground sampling distance (GSD) estimate. To remove the cap, check --ignore-gsd also. Default: ``5`` :ref:`pc-classify` - Classify the point cloud outputs using a Simple Morphological Filter. You can control the behavior of this option by tweaking the --dem-* parameters. Default: ``False`` + Classify the point cloud outputs using a Simple Morphological Filter. You can control the behavior of this option by tweaking the --dem-\* parameters. Default: ``False`` :ref:`pc-csv` Export the georeferenced point cloud in CSV format. Default: ``False`` diff --git a/source/arguments/dsm.rst b/source/arguments/dsm.rst index 79874bff5..18f276265 100644 --- a/source/arguments/dsm.rst +++ b/source/arguments/dsm.rst @@ -10,7 +10,7 @@ dsm -Use this tag to build a DSM (Digital Surface Model, ground + objects) using a progressive morphological filter. Check the --dem* parameters for finer tuning. Default: ``False`` +Use this tag to build a DSM (Digital Surface Model, ground + objects) using a progressive morphological filter. Check the --dem\* parameters for finer tuning. Default: ``False`` .. include:: ../arguments_edit/dsm.rst diff --git a/source/arguments/dtm.rst b/source/arguments/dtm.rst index 5e7b4a4c0..6f4865b16 100644 --- a/source/arguments/dtm.rst +++ b/source/arguments/dtm.rst @@ -10,7 +10,7 @@ dtm -Use this tag to build a DTM (Digital Terrain Model, ground only) using a simple morphological filter. Check the --dem* and --smrf* parameters for finer tuning. Default: ``False`` +Use this tag to build a DTM (Digital Terrain Model, ground only) using a simple morphological filter. Check the --dem\* and --smrf\* parameters for finer tuning. Default: ``False`` .. include:: ../arguments_edit/dtm.rst diff --git a/source/arguments/pc-classify.rst b/source/arguments/pc-classify.rst index c417265b0..e2999589b 100644 --- a/source/arguments/pc-classify.rst +++ b/source/arguments/pc-classify.rst @@ -10,7 +10,7 @@ pc-classify -Classify the point cloud outputs using a Simple Morphological Filter. You can control the behavior of this option by tweaking the --dem-* parameters. Default: ``False`` +Classify the point cloud outputs using a Simple Morphological Filter. You can control the behavior of this option by tweaking the --dem-\* parameters. Default: ``False`` .. include:: ../arguments_edit/pc-classify.rst