Creating own process
A classical error is to forget adding empty __init__.py
files
in all folder to be sure they are processed by platform pythonic explorations:
be sure there are __init__.py
files in all your folders !
Move to your sos-trades-dev folder and load virtual environment
-
move in the sostrades-dev-tools where the platform was installed
cd <path to your installation folder>\sostrades-dev-tools
-
activate the virtual environment
.\.venv\Scripts\activate
You should see a(.venv)
appear at the beginning of yout DOS prompt
Every time you want to work with SoSTrades to develop or use the platform,
activate this virtual environment first by reruning this .\.venv\Scripts\activate
command
Create your folder structure in one of your module repository
-
move to one of your module's sos_processes folder
.../sostrades-dev-tools/models/<your repository>/<your-module>/sos_processes
cd ...\sostrades-dev-tools\models\<your repository>\<your-module>\sos_processes
-
add a folder for your new process
mkdir <your-process-name>
cd <your-process-name>
type NUL > __init__.py
-
create a folder for your process documentation
mkdir documentation
type NUL > documentation\__init__.py
Create your process
-
create a file
process.py
in which you will create a specific process builder
following instructions given in this developer's manual section -
you might want to create a
usecase.py
file to initialize a reference for your process
following instructions given in this developer's manual section -
finally create a file
documentation\process.md
with your dfocumentation in markdown format
Update ontology
-
move to
.../sostrades-dev-tools
folder
cd ...\sostrades-dev-tools
-
run the
UpdateOntology.py
script to initialize the ontology of parameters, models and processes :
python scripts/UpdateOntology.py
Check your process appear in the platform
-
start the platform, select the upper-left three horizontal bars and in the menu select Ontology/Processes
-
Use the Filter to check if your process appears
-
select the book icon at the end of your model line in list, to check informations were well retrieved (models used, documentation...)