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 hierarchyresources
, GUI assets (images, fonts, etc.)tests
, test files hierarchytools
, various developping utilitiesTympan
, C++ files hierarchy
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
\_ default
_ CMakeLists.txt - used to define compiling rules for the folder
core
may not include from other Tympan directoriesmodels
may only include fromcore
gui
may only include fromcore
andmodel/site
solvers
may only include fromcore
,model/solver
andmodel/results
Python code hierarchy (i.e. the Python directory)¶
File hierarchy¶
Python
\_ bin
_ include
_ tests
_ tympan
\_ __pycache__
_ altimetry
_ models
Python namespaces¶
tympan.altimetry
tympan.models
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:\Python310\python.exe -m venv venv310tympan
# Activate virtual environment
C:\dists\python\venv310tympan\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.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)
Install the packages necessary for TYMPAN in the python folder that we have just installed (different from virtual environement).
# Go to folder
cd C:\Python310\Scripts
# install packages
pip.exe install -U -r C:\projects\code_tympan\requirements.txt
You can check that the installation went correctly by going to inspect the C:\Python310\Lib\site-packages folder which must now contain the packages necessary for TYMPAN.
The python folder is now correctly prepared. All that remains is copy python into the TYMPAN folder (and rename the folder with release name).