Aller au contenu

Installation

Prérequis

WINDOWS : Installation conda

  1. Pour les développeurs qui font leur environnement sous anaconda prompt sous windows, le fait d'installer anaconda en directement sur C:/ et pas sur C:/programdata change pas mal de chose en termes d'autorisations d'installation (solution 1 à privilégier).
  2. De nombreuses sources d'installation ne sont pas disponibles directement sous le canal défini par défaut dans anaconda. Il faut forcer le canal conda-forge qui a quasiment toujours les packages à jour les plus récents :
        conda config --add channels conda-forge
        conda config --set channel_priority strict
    
    Une ligne de plus pour vérifier si la modification a été effective :
        conda config --get channels
    
    Initaliser powershell
        conda init powershell
    
    Astuce : créer un raccourci PowerShell qui active ton env automatiquement
        powershell.exe -NoExit -Command "conda activate oreni"
    

Installation Oreni

Installation de l'environnement

Il faut créer un environnement conda :

git clone https://gitlab.limos.fr/rolerich/tipee_limos_eplus.git
cd tipee_limos_eplus
conda env create -f environment.yml
conda activate oreni
conda install git pip uv poetry

Installation du package

Installation du package

cd tipee_limos_eplus
poetry install --all-extras
pip install git+"https://gitlab.limos.fr/rolerich/tipee_limos_eplus.git"
cd tipee_limos_eplus
make

Installation EnergyPlus

v24.1.0

Utilisation de git

Récupérer le projet distant

mkdir tipee_limos_eplus
cd tipee_limos_eplus
git clone https://gitlab.limos.fr/rolerich/tipee_limos_eplus.git .

Pousser les développements sur le projet distant

cd tipee_limos_eplus
git add .
git commit -m "Dev1"
git push -uf origin master

Mettre à jour le projet avec le projet distant

cd tipee_limos_eplus
git pull

Exécuter un exemple de calcul sans cosimulation FMU

python main_cabin.py.py

Exécuter un exemple de calcul avec cosimulation FMU

python main_detached_house.py.py

Gestionnaire de dépendances du module python

Poetry

Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Poetry offers a lockfile to ensure repeatable installs, and can build your project for distribution.

Installation Poetry

Installation

curl -sSL https://install.python-poetry.org | python3 -
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

Installer les dépendances du module

poetry install
poetry install --with docs

Ajouter un package

Linux, macOS, Windows (WSL)

poetry add pandas

Extraire les dépendances du module vers un fichier requirements.txt

Linux, macOS, Windows (WSL)

poetry export -f requirements.txt --output requirements.txt --without-hashes --with docs 

Options avancées (en phase de test):

Run celery

python oreni run-celery --concurrency=4 

Run celery flower (http://localhost:5555)

python oreni flower

Parsers EnergyPlus

Utiliser l'API avec le module pyenergyplus

    conda install cmake ninja gfortran
    brew install cmake ninja gfortran
conda activate oreni
git clone https://github.com/bbrangeo/pyenergyplus.git
cd pyenergyplus
git submodule init
git submodule update --init --recursive
python setup.py install

Model Pydantic EnergyPlus

Generate epmodel.py

conda activate oreni
git clone https://github.com/bbrangeo/epmodel.git
cd epmodel/codegen
pip install datamodel_code_generator
python codegen.py
cp epmodel.py oreni/models/energyplus/epmodel.py