Development
python setup.py develop
Gives you an editable install for messing with Python code in the project. (Any underyling cpp changes require this command to be re-run).
Package Structure
There are a few different moving parts that can be built in this project:
the cpp brush library (called
cbrush
)the cpp tests, written google tests (an executable named
tests
)depends on
cbrush
the cpp-python bindings (a Python module written in cpp named
_brush
)depends on
cbrush
the
brush
Python moduledepends on
_brush
the docs (built with a combination of Sphinx and Doxygen)
depends on
brush
Pip will install the brush
module and call CMake
to build the _brush
extension.
It will not build the docs or cpp tests.
Tests
Python
The tests are run by calling pytest from the root directory. You may need to install brush with pip install '.[test]'
to install all required dependencies
pytest
Cpp
If you are developing the cpp code and want to build the cpp tests, run the following:
./configure
./install tests
Building the docs locally
To build the documentation you will need some additional requirements. Before proceeding, make sure you have the python wrapper installed, as the documentation have some sample notebooks that will run the code.
First go to the docs
folder:
cd docs/
Then, install additional python packages in the same environemnt as brush is intalled with:
conda activate brush
pip install -r requirements.txt
Now just run:
make html
The static website is located in -build/html
Building the python docs
First you need to modify the CMakeLists.txt
to enable building the docs by changing option(DOCS "build docs" OFF)
to ON
, as well as "-DDOCS=OFF"
to ON
in the pyproject.toml
.
Then you can install brush with pip install '.[docs]'
and it will build the docs as it install the module.