Structure of the code base¶
First level hierarchy¶
3rdparty, third party code, to be filed with the dependencies archive’s contentcmake, cmake scriptsdebian, debian packagingdoc, project’s developper documentationPython, Python files hierarchyqml, QML files used with Qt Quick frameworkresources, GUI assets (images, fonts, etc.)tests, test files hierarchytools, various developping utilitiesTympan, C++ files hierarchyweb, web resources
C++ code hierarchy (i.e. the Tympan directory)¶
Tympan
\_ core
_ geometric_methods
\_ AcousticRaytracer
_ ConvexHullFinder
_ gui
\_ app (former `TympanApp`)
_ gl (former `DataManagerGraphics`)
_ tools
_ widgets (former `DataManagerIHM`)
_ models
\_ business - application model (former `DataManagerMetier`)
_ common - common representations (former `CommonTools`)
_ solver - problem and result models for the solver
_ solvers
\_ 9613
\_ 9613Solver
_ DefaultSolver
_ CMakeLists.txt - used to define compiling rules for the folder
coremay not include from other Tympan directoriesmodelsmay only include fromcoreguimay only include fromcoreandmodel/sitesolversmay only include fromcore,model/solverandmodel/resultsUnder solvers are stored common classes for all solver families
Under 9613 are stored common classes for 9613 family solver
Under 9613Solver are stored specific classes for 9613Solver
Under DefaultSolver are stored specific classes for DefaultSolver
Python code hierarchy (i.e. the Python directory)¶
File hierarchy¶
Python
\_ bin
_ include
_ tests
_ tympan
\_ __pycache__
_ altimetry
_ models
Python namespaces¶
tympan.altimetrytympan.models
Web code hierarchy¶
File hierarchy¶
web
\_ css
_ js
\_ tests
Test code hierarchy¶
data folder : folder used to store resources for tests
CMakeLists.txt : used to define compiling rules for the folder
utils.py : paths configuration for test in Python
For more information, see Testing
Executables¶
Usage¶
starts the GUI (binary)
used by the GUI to start computation for a site XML file (python)
used by the GUI to computate altimetry for a site XML file (python)
used by the python library to start computation for a solver model (python thin wrapper around solvers code)
1_xxxxx_install.bat : Used to generate the build and install folders of TYMPAN (debug or release depending on the script).
2_xxxxx_Tests_unitaires.bat : Used to launch unit tests (debug or release depending on the script).
3_xxxxx_Build_Doc.bat : Used to generate the doc.
4_xxxxx_Launch_Tympan_GUI.bat : Used to launches TYMPAN with the graphical interface (debug or release depending on the script).
5_Debug_Tympan_Mode_Interactive : Used to launch the python calculation with pdb (very useful for debugging).
Embedded Python and Tympan release generation¶
Reminder¶
# Create virtual environment
cd dists\python
C:\Python313\python.exe -m venv venv313tympan
# Activate virtual environment
C:\dists\python\venv313tympan\Scripts\activate.bat
In this virtual environment, the packages listed in the requirements file had to be installed using the following commands:
pip install -U pip
pip install -U -r requirements-open-source.txt
pip install -U -r requirements-bundle.txt
pip install -U -r requirements-dev.txt
Generate Python embedded in TYMPAN¶
As said previously, to build a complete TYMPAN version (which can be delivered) you must therefore embed python. However, it is not enough to copy the python folder, you must first have installed the necessary packages in the sources folder. Here’s the procedure to follow :
To be sure that the version is clean,it is recommended first reinstalling the version of python that will be used. (Python release link)
Copy
C:\Python313into %DELIVERY_FOLDER%, which is :For Production bundle :
C:\Livraison_bd_Tympan_TykalFor Production open-source :
C:\Livraison_Tympan_open_sourceFor Development bundle :
C:\Livraison_bd_Tympan_Tykal_devFor Development open-source :
C:\Livraison_Tympan_dev_open_source
Install the packages necessary for bundle or open-source distribution in the python folder that we have just copied (different from virtual environment and the system Python under
C:\Python313).
# Either install packages for bundle configuration
%DELIVERY_FOLDER%\Python313\python.exe -m pip install -U -r C:\projects\code_tympan\requirements-open-source.txt
%DELIVERY_FOLDER%\Python313\python.exe -m pip install -U -r C:\projects\code_tympan\requirements-bundle.txt
%DELIVERY_FOLDER%\Python313\python.exe -m pip install -U -r C:\projects\TYKAL\requirements-tykal.txt
%DELIVERY_FOLDER%\Python313\python.exe -m pip install -U -r C:\projects\TYBox\requirements-tybox.txt
# Or install packages for open-source configuration
%DELIVERY_FOLDER%\Python313\python.exe -m pip install -U -r C:\projects\code_tympan\requirements-open-source.txt
You can check that the installation went correctly by using pip on the embedded Python folder in %DELIVERY_FOLDER%.
# Use pip to list installed packages
%DELIVERY_FOLDER%\Python313\python.exe -m pip list