Instructions for Developers#
This file presents instructions for PyBTLS
developers.
Create working repository with developer install#
Fork
PyBTLS
GitHub repositoryClone repo
git clone <forked-repo>
Create new PyBTLS developer environment
conda env create -f environment.yaml
Activate developer environment
conda activate pybtls-dev
Change directory to pybtls fork
cd path_to_forked_repo
Install developer version
pip install -e .
Install depedencies
conda install -c anaconda pytest conda install -c anaconda sphinx conda install -c conda-forge black pip install sphinx_autodoc_typehints pip install nbsphinx pip install pydata_sphinx_theme
Add
PyBTLS
as upstreamgit remote add upstream https://github.com/pybtls/pybtls.git
Develop and create pull-request (PR)#
Create new branch
git checkout -b <new-branch>
Pull updates from PyBTLS main
git pull upstream main
Develop package
For new features related to the simulation, modify the C++ code in
./cpp/
.Expose your new features to Python by modifying
./cpp/src/py_main.cpp
,./py/pybtls/lib/BTLS.py
, etc. accordingly.For new features related to the data processing, modify the Python code in
./py/pybtls/post_processing/
.
[If applicable] Create unit tests for
pytest
.Store test file in
./tests/<test-file.py>
.
[If applicable] Create new example notebook.
Store notebook in
./docs/source/notebooks/<tutorial.ipynb>
.Index notebook in
./docs/source/tutorial.rst
[If applicable] Add new dependencies in
./pyproject.toml
Build documentation
Change directory to
./docs/
make clean
make html
xdg-open build/html/index.html
Update version number in the following files
./pyproject.toml
./py/pybtls/__init__.py
Stage changes; commit; and push to remote fork
Go to GitHub and create PR for the branch