diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..747ffb7 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/_templates/custom-class-template.rst b/docs/source/_templates/custom-class-template.rst new file mode 100644 index 0000000..f73eda5 --- /dev/null +++ b/docs/source/_templates/custom-class-template.rst @@ -0,0 +1,34 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + :inherited-members: + :special-members: __call__, __add__, __mul__ + + {% block methods %} + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + :nosignatures: + {% for item in methods %} + {%- if not item.startswith('_') %} + ~{{ name }}.{{ item }} + {%- endif -%} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/docs/source/_templates/custom-module-template.rst b/docs/source/_templates/custom-module-template.rst new file mode 100644 index 0000000..d066d0e --- /dev/null +++ b/docs/source/_templates/custom-module-template.rst @@ -0,0 +1,66 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: Module attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. autosummary:: + :toctree: + :template: custom-module-template.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} diff --git a/docs/source/api.rst b/docs/source/api.rst new file mode 100644 index 0000000..e90b356 --- /dev/null +++ b/docs/source/api.rst @@ -0,0 +1,9 @@ +API +=== + +.. autosummary:: + :toctree: _autosummary + :template: custom-module-template.rst + :recursive: + + utils \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..40f6d49 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,34 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import sys +import os +sys.path.insert(0, os.path.abspath('../..')) +project = 'Analyse Morphologique' +copyright = '2023, Djalim SIMAILA, Alexis DOGHMANE' +author = 'Djalim SIMAILA, Alexis DOGHMANE' +release = '1.2.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx_rtd_theme', + 'sphinx.ext.autosummary' +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..5ee31ad --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,31 @@ +.. Analyse Morphologique documentation master file, created by + sphinx-quickstart on Tue May 16 10:01:13 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Analyse Morphologique's documentation! +================================================= + +"Analyse Morphologique" (Morphological Analysis) is a tool developed by the Geomechanics Laboratory of INRAE PACA Center. Its goal is to extract information about the morphology of 3D scans from HET (Hydraulic Erosion Test) tests. +Check out the :doc:`installation` section for further information. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +Contents +-------- + +.. toctree:: + + installation + api \ No newline at end of file diff --git a/docs/source/installation.rst b/docs/source/installation.rst new file mode 100644 index 0000000..5a923a5 --- /dev/null +++ b/docs/source/installation.rst @@ -0,0 +1,34 @@ +Installation +===== + +Python Version +-------------- +Analyse Morphologique is compatible with Python 3.10 and above. + + +Install Analyse Morphologique +------------ + +To use Analyse Morphologique, first get a release tarball or clone the repository from `here https://forgemia.inra.fr/scanner3d/analysemorphologique`_. +Then, install the dependencies with pip: + +.. code-block:: console + + $ pip install -r requirements.txt + +Once the dependencies installed, you can run Analyse Morphologique with + +.. code-block:: console + + $ python main.py + +.. note:: + If you have issues with the pyQt5 module, you can run Analyse Morphologique in a virtual envirenment. + To do so, run the following commands: + + .. code-block:: console + + $ python3 -m venv .venv + $ source .venv/bin/activate # on Windows, use .venv\Scripts\activate.bat instead + (.venv) $ pip install -r requirements.txt + (.venv) $ python main.py \ No newline at end of file diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000..f682c83 --- /dev/null +++ b/utils/__init__.py @@ -0,0 +1,7 @@ +import utils.data_processing as data_processing +import utils.files as files +import utils.graph2D as graph2D +import utils.graph3D as graph3D +import utils.math as math +import utils.gui as gui +import utils.settings as settings \ No newline at end of file diff --git a/utils/data_processing/__init__.py b/utils/data_processing/__init__.py new file mode 100644 index 0000000..7f28780 --- /dev/null +++ b/utils/data_processing/__init__.py @@ -0,0 +1 @@ +import utils.data_processing.data_processing as data_processing \ No newline at end of file diff --git a/utils/files/__init__.py b/utils/files/__init__.py new file mode 100644 index 0000000..338a6b0 --- /dev/null +++ b/utils/files/__init__.py @@ -0,0 +1,3 @@ +import utils.files.input as input +import utils.files.output as output +import utils.files.norm as norm \ No newline at end of file diff --git a/utils/graph2D/__init__.py b/utils/graph2D/__init__.py new file mode 100644 index 0000000..bd5d14d --- /dev/null +++ b/utils/graph2D/__init__.py @@ -0,0 +1,2 @@ +import utils.graph2D.mpl_render as mpl_render +import utils.graph2D.visplot_render as visplot_render \ No newline at end of file diff --git a/utils/graph2D/mpl_render.py b/utils/graph2D/mpl_render.py index f460c95..ba45771 100644 --- a/utils/graph2D/mpl_render.py +++ b/utils/graph2D/mpl_render.py @@ -1,8 +1,7 @@ """ Created on Fri Apr 21 2023 @name: mpl_render.py -@desc: A module to render a 2D data using matplotlib, - thoses functions cant be integrated into pyqt gui yet +@desc: A module to render a 2D data using matplotlib, thoses functions cant be integrated into pyqt gui yet @auth: Djalim Simaila @e-mail: djalim.simaila@inrae.fr """ diff --git a/utils/graph3D/__init__.py b/utils/graph3D/__init__.py new file mode 100644 index 0000000..8ba251a --- /dev/null +++ b/utils/graph3D/__init__.py @@ -0,0 +1,2 @@ +import utils.graph3D.mpl_render as mpl_render +import utils.graph3D.visplot_render as visplot_render \ No newline at end of file diff --git a/utils/graph3D/mpl_render.py b/utils/graph3D/mpl_render.py index 14274c5..087f8a4 100644 --- a/utils/graph3D/mpl_render.py +++ b/utils/graph3D/mpl_render.py @@ -1,8 +1,7 @@ """ Created on Fri Apr 21 2023 @name: mpl_render.py -@desc: A module to render a 3D data using matplotlib, - thoses functions cant be integrated into pyqt gui yet +@desc: A module to render a 3D data using matplotlib, thoses functions cant be integrated into pyqt gui yet @auth: Djalim Simaila @e-mail: djalim.simaila@inrae.fr """ diff --git a/utils/gui/__init__.py b/utils/gui/__init__.py new file mode 100644 index 0000000..d0a761f --- /dev/null +++ b/utils/gui/__init__.py @@ -0,0 +1 @@ +import utils.gui.pyqt as pyqt \ No newline at end of file diff --git a/utils/gui/pyqt/__init__.py b/utils/gui/pyqt/__init__.py new file mode 100644 index 0000000..64504c0 --- /dev/null +++ b/utils/gui/pyqt/__init__.py @@ -0,0 +1,4 @@ +import utils.gui.pyqt.settings as settings +import utils.gui.pyqt.main_window as main_window +import utils.gui.pyqt.error_popup as error_popup +import utils.gui.pyqt.about as about \ No newline at end of file diff --git a/utils/gui/pyqt/about/__init__.py b/utils/gui/pyqt/about/__init__.py new file mode 100644 index 0000000..cee619e --- /dev/null +++ b/utils/gui/pyqt/about/__init__.py @@ -0,0 +1,2 @@ +import utils.gui.pyqt.about.AboutThis as AboutThis +import utils.gui.pyqt.about.UI_AboutThis as UI_AboutThis \ No newline at end of file diff --git a/utils/gui/pyqt/error_popup/__init__.py b/utils/gui/pyqt/error_popup/__init__.py new file mode 100644 index 0000000..1017edc --- /dev/null +++ b/utils/gui/pyqt/error_popup/__init__.py @@ -0,0 +1 @@ +import utils.gui.pyqt.error_popup.ErrorPopup as ErrorPopup diff --git a/utils/gui/pyqt/main_window/Workers/__init__.py b/utils/gui/pyqt/main_window/Workers/__init__.py new file mode 100644 index 0000000..116e72d --- /dev/null +++ b/utils/gui/pyqt/main_window/Workers/__init__.py @@ -0,0 +1,5 @@ +import utils.gui.pyqt.main_window.Workers.Worker as Worker +import utils.gui.pyqt.main_window.Workers.AdvancedDataWorker as AdvancedDataWorker +import utils.gui.pyqt.main_window.Workers.DiscreteDataWorker as DiscreteDataWorker +import utils.gui.pyqt.main_window.Workers.PreProcessWorker as PreProcessWorker +import utils.gui.pyqt.main_window.Workers.RawDataWorker as RawDataWorker \ No newline at end of file diff --git a/utils/gui/pyqt/main_window/__init__.py b/utils/gui/pyqt/main_window/__init__.py new file mode 100644 index 0000000..9722c87 --- /dev/null +++ b/utils/gui/pyqt/main_window/__init__.py @@ -0,0 +1,3 @@ +import utils.gui.pyqt.main_window.MainWindow as MainWindow +import utils.gui.pyqt.main_window.UI_MainWindow as UI_MainWindow +import utils.gui.pyqt.main_window.Workers as Workers \ No newline at end of file diff --git a/utils/gui/pyqt/settings/__init__.py b/utils/gui/pyqt/settings/__init__.py new file mode 100644 index 0000000..6cf2320 --- /dev/null +++ b/utils/gui/pyqt/settings/__init__.py @@ -0,0 +1,2 @@ +import utils.gui.pyqt.settings.Settings as Settings +import utils.gui.pyqt.settings.UI_Settings as UI_Settings \ No newline at end of file diff --git a/utils/math/__init__.py b/utils/math/__init__.py new file mode 100644 index 0000000..ea03b96 --- /dev/null +++ b/utils/math/__init__.py @@ -0,0 +1,2 @@ +import utils.math.data_extraction as data_extraction +import utils.math.position_manipulation as position_manipulation \ No newline at end of file diff --git a/utils/settings/__init__.py b/utils/settings/__init__.py new file mode 100644 index 0000000..19b2e8e --- /dev/null +++ b/utils/settings/__init__.py @@ -0,0 +1 @@ +import utils.settings.SettingManager as SettingManager \ No newline at end of file