🚀 feat(docs): add Sphinx documentation to the project

The Sphinx documentation has been added to the project. This includes a Makefile, a make.bat file, and a conf.py file in the docs directory. The source directory contains the documentation files in reStructuredText format. The documentation includes an installation guide and an API reference. The utils package has been reorganized to be more modular and easier to document. The documentation can be built using the `make html` command in the docs directory.

🎉 feat(utils): add new modules and packages to the project
New modules and packages have been added to the project. The following packages have been added:
- utils.gui.pyqt.about
- utils.gui.pyqt.error_popup
- utils.gui.pyqt.main_window
- utils.gui.pyqt.settings
- utils.math
- utils.settings

The new packages contain modules that provide additional functionality to the project.
This commit is contained in:
Djalim Simaila 2023-05-16 14:02:26 +02:00
parent e57d9e9837
commit be673c97aa
24 changed files with 301 additions and 4 deletions

20
docs/Makefile Normal file
View File

@ -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)

35
docs/make.bat Normal file
View File

@ -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

View File

@ -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 %}

View File

@ -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 %}

9
docs/source/api.rst Normal file
View File

@ -0,0 +1,9 @@
API
===
.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:
utils

34
docs/source/conf.py Normal file
View File

@ -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']

31
docs/source/index.rst Normal file
View File

@ -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

View File

@ -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

7
utils/__init__.py Normal file
View File

@ -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

View File

@ -0,0 +1 @@
import utils.data_processing.data_processing as data_processing

3
utils/files/__init__.py Normal file
View File

@ -0,0 +1,3 @@
import utils.files.input as input
import utils.files.output as output
import utils.files.norm as norm

View File

@ -0,0 +1,2 @@
import utils.graph2D.mpl_render as mpl_render
import utils.graph2D.visplot_render as visplot_render

View File

@ -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
"""

View File

@ -0,0 +1,2 @@
import utils.graph3D.mpl_render as mpl_render
import utils.graph3D.visplot_render as visplot_render

View File

@ -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
"""

1
utils/gui/__init__.py Normal file
View File

@ -0,0 +1 @@
import utils.gui.pyqt as pyqt

View File

@ -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

View File

@ -0,0 +1,2 @@
import utils.gui.pyqt.about.AboutThis as AboutThis
import utils.gui.pyqt.about.UI_AboutThis as UI_AboutThis

View File

@ -0,0 +1 @@
import utils.gui.pyqt.error_popup.ErrorPopup as ErrorPopup

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,2 @@
import utils.gui.pyqt.settings.Settings as Settings
import utils.gui.pyqt.settings.UI_Settings as UI_Settings

2
utils/math/__init__.py Normal file
View File

@ -0,0 +1,2 @@
import utils.math.data_extraction as data_extraction
import utils.math.position_manipulation as position_manipulation

View File

@ -0,0 +1 @@
import utils.settings.SettingManager as SettingManager