Skip to content

Commit

Permalink
Merge branch '255-demcompare-makefile-typos' into 'master'
Browse files Browse the repository at this point in the history
Resolve "demcompare makefile typos" + typos docs + dockerfile

Closes #29, #250, and #255

See merge request 3d/demcompare!191
  • Loading branch information
duboise-cnes committed Mar 1, 2024
2 parents c476e63 + ddf2bda commit 97eeb86
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 83 deletions.
24 changes: 0 additions & 24 deletions Dockerfile

This file was deleted.

23 changes: 3 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
SHELL := /bin/bash

# Set Virtualenv directory name
# Exemple: VENV="other-venv/" make install
# Example: VENV="other-venv/" make install
ifndef VENV
VENV = "venv"
endif

# Browser definition
# Browser definition for sphinx and coverage
define BROWSER_PYSCRIPT
import os, webbrowser, sys

Expand All @@ -28,7 +28,6 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"

# Python global variables definition
PYTHON_VERSION_MIN = 3.8

# Set PYTHON if not defined in command line
# Example: PYTHON="python3.10" make venv to use python 3.10 for the venv
# By default the default python3 of the system.
Expand Down Expand Up @@ -165,15 +164,6 @@ notebook-clean-output:
@echo "Clean Jupyter notebooks"
@${VENV}/bin/jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace notebooks/*.ipynb

## Docker section

docker: ## Build docker image (and check Dockerfile)
@echo "Check Dockerfile with hadolint"
@docker pull hadolint/hadolint
@docker run --rm -i hadolint/hadolint < Dockerfile
@echo "Build Docker image demcompare dev"
@docker build -t cnes/demcompare:dev -t cnes/demcompare:latest .

## Release section

.PHONY: dist
Expand All @@ -190,7 +180,7 @@ release: dist ## package and upload a release
## Clean section

.PHONY: clean
clean: clean-venv clean-build clean-precommit clean-pyc clean-test clean-lint clean-docs clean-notebook ## clean all (except docker)
clean: clean-venv clean-build clean-precommit clean-pyc clean-test clean-lint clean-docs clean-notebook ## clean all

.PHONY: clean-venv
clean-venv: ## clean venv
Expand Down Expand Up @@ -248,10 +238,3 @@ clean-docs: ## clean builded documentations
clean-notebook: ## clean notebooks cache
@echo "+ $@"
@find . -type d -name ".ipynb_checkpoints" -exec rm -fr {} +

.PHONY: clean-docker
clean-docker: ## clean created docker images
@echo "+ $@"
@echo "Clean Docker image demcompare dev"
@docker image rm cnes/demcompare:dev
@docker image rm cnes/demcompare:latest
4 changes: 3 additions & 1 deletion demcompare/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ def generate_report( # noqa: C901
try:
spm.build_project("latexpdf")
except Exception:
logging.error("Error when building report as pdf output (ignored)")
# put only INFO to be more silent to logging when latexpdf not present
# to change if we keep or not pdf report
logging.info("Error when building report as pdf output (ignored)")

# Sphinx project install in final directory
spm.install_project()
40 changes: 20 additions & 20 deletions docs/source/userguide/coregistration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,26 @@ Scientific parameters

Here is the list of the parameters of the input configuration file for the coregistration step and its associated default value when it exists:

+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
| Name | Description | Type | Default value | Required |
+===============================+=================================================+=============+=====================+==========+
| ``method_name`` | Planimetric coregistration method | string | ``nuth_kaab`` | No |
+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
| ``number_of_iterations`` | | Number of iterations | int | ``6`` | No |
| | | of the coregistration method | | | |
+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
| ``estimated_initial_shift_x`` | | Estimated initial x | int | ``0`` | No |
| | | coregistration shift | | | |
+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
| ``estimated_initial_shift_y`` | | Estimated initial y | int | ``0`` | No |
| | | coregistration shift | | | |
+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
| ``sampling_source`` | Sampling source for reprojection | string | ``sec`` | No |
+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
| ``save_optional_outputs`` | | If save internal DEMs and coregistration | boolean | ``false`` | No |
| | | method outputs such as iteration plots | | | |
| | | to disk (true/false value) | | | |
+-------------------------------+-------------------------------------------------+-------------+---------------------+----------+
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+
| Name | Description | Type | Default value | Required |
+===============================+=================================================+=============+======================+==========+
| ``method_name`` | Planimetric coregistration method | string |``nuth_kaab_internal``| No |
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+
| ``number_of_iterations`` | | Number of iterations | int | ``6`` | No |
| | | of the coregistration method | | | |
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+
| ``estimated_initial_shift_x`` | | Estimated initial x | int | ``0`` | No |
| | | coregistration shift | | | |
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+
| ``estimated_initial_shift_y`` | | Estimated initial y | int | ``0`` | No |
| | | coregistration shift | | | |
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+
| ``sampling_source`` | Sampling source for reprojection | string | ``sec`` | No |
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+
| ``save_optional_outputs`` | | If save internal DEMs and coregistration | boolean | ``false`` | No |
| | | method outputs such as iteration plots | | | |
| | | to disk (true/false value) | | | |
+-------------------------------+-------------------------------------------------+-------------+----------------------+----------+


I/O parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/source/userguide/statistics/classification_layers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ The modes
.. tab:: The **standard mode**
Within this mode **all valid pixels are considered**. It means nan values but also outliers (if ``remove_outliers`` was set to ``"True"``) and masked ones are discarded.
Within this mode **all valid pixels are considered**. It means nan values but also outliers (if ``remove_outliers`` was set to ``true``) and masked ones are discarded.
Note that the nan values can be originated from the altitude differences image and / or the exogenous classification layers themselves (ie. if the input segmentation
has NaN values, the corresponding pixels will not be considered for the statistics computation of this classification layer).
Expand Down
22 changes: 11 additions & 11 deletions docs/source/userguide/statistics/dem_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,25 @@ All the different DEM processing methods can be used within a single configurati
}
"statistics": {
"alti-diff": {
"remove_outliers": "True"
"remove_outliers": true
},
"alti-diff-slope-norm": {
"remove_outliers": "True"
"remove_outliers": true
},
"angular-diff": {
"remove_outliers": "True"
"remove_outliers": true
},
"ref": {
"remove_outliers": "True"
"remove_outliers": true
},
"sec": {
"remove_outliers": "True"
"remove_outliers": true
},
"ref-curvature": {
"remove_outliers": "True"
"remove_outliers": true
},
"sec-curvature": {
"remove_outliers": "True"
"remove_outliers": true
}
}
}
Expand All @@ -103,7 +103,7 @@ The user may specify the required metrics as follows:
}
"statistics": {
"alti-diff": {
"remove_outliers": "True",
"remove_outliers": true,
"metrics": ["mean", {"ratio_above_threshold": {"elevation_threshold": [1, 2, 3]}}]
}
}
Expand All @@ -121,10 +121,10 @@ The DEM processing methods applied on one DEM can also be used with a single DEM
},
"statistics": {
"ref": {
"remove_outliers": "True"
"remove_outliers": true
},
"ref-curvature": {
"remove_outliers": "True"
"remove_outliers": true
}
}
}
Expand All @@ -143,7 +143,7 @@ The user may specify the required metrics as follows:
},
"statistics": {
"ref": {
"remove_outliers": "True",
"remove_outliers": true,
"metrics": ["mean", {"ratio_above_threshold": {"elevation_threshold": [1, 2, 3]}}]
}
}
Expand Down
6 changes: 3 additions & 3 deletions docs/source/userguide/statistics/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following metrics are currently available on demcompare:
,,fig_title, "str", ``DEM hill shade``
,,plot_path, "str", ``None``
``'svf'``\ SkyViewFactor,matrix,filter_intensity, "float", ``315``
,,replication, "bool", ``True``
,,replication, "bool", true
,,quantiles, "List[float]", ":math:`[0.09, 0.91]`"
,,cmap, "str", ``Greys_r``
,,cmap_nodata, "str", ``royalblue``
Expand Down Expand Up @@ -95,11 +95,11 @@ The following metrics are currently available on demcompare:
}
"statistics": {
"alti-diff": {
"remove_outliers": "True",
"remove_outliers": true,
"metrics": ["mean", {"ratio_above_threshold": {"elevation_threshold": [1, 2, 3]}}]
},
"ref": {
"remove_outliers": "True",
"remove_outliers": true,
"metrics": [
{
"slope-orientation-histogram": {
Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,20 @@ packages = find:
dev =
pre-commit
isort>=5.8.0 # Check imports
black>=21.5b0 # PEP8 format code
black[jupyter]>=21.5b0 # PEP8 format code
flake8>=3.9.1 # General linter
flake8-comprehensions>=3.4.0 # Check list/dict/set
flake8-bugbear>=21.4.3 # Add some rules to flake8
pylint # General linter
setuptools_scm # versions from git tag
virtualenv
configupdater
twine # for pypi upload
build
pytest
pytest-cov
pytest-sugar
tox
mypy
black[jupyter]

docs =
sphinx>=4.3.0
Expand Down

0 comments on commit 97eeb86

Please sign in to comment.