(modify-code)=
For development of the openpifpaf source code itself, you need to clone this repository and then:
pip3 install numpy cython
pip3 install --editable '.[dev,train,test]'
The last command installs the Python package in the current directory
(signified by the dot) with the optional dependencies needed for training and
testing. If you modify functional.pyx
, run this last command again which
recompiles the static code.
Develop your features in separate feature branches.
Create a pull request with your suggested changes. Make sure your code passes
pytest
, pylint
and pycodestyle
checks:
pylint openpifpaf
pycodestyle openpifpaf
pytest
cd guide
python download_data.py
pytest --nbval-lax --current-env *.ipynb
This is a research project and changing fast. Contributions can be in many areas:
OpenPifPaf has few core requirements so that you can run it efficiently on servers without graphical interface.
Sometimes, you just want to install all possible dependencies. Those are provided as "extra" requirements.
Use the following pip3
command to install all extras.
# NO CODE
import sys
if sys.version_info >= (3, 8):
import importlib.metadata
extras = importlib.metadata.metadata('openpifpaf').get_all('Provides-Extra')
print(f'pip3 install "openpifpaf[{",".join(extras)}]"')
Let us know about your open source projects. We would like to feature them in our "related projects" section.
The simplest way to integrate with OpenPifPaf is to write a plugin. If some functionality is not possible through our plugin architecture, open an issue to discuss and if necessary send us a pull request that enables the missing feature you need.
If you do need to make a copy of OpenPifPaf, you must respect our license.
pip install jupyter-book
cd guide
jb build .
If you encounter issues with the kernel spec in a notebook, open the notebook
with a text editor and find metadata.kernelspec.name
and set it to python3
.
Alternatively, you can patch your local package yourself. Open
venv/lib/python3.9/site-packages/jupyter_cache/executors/utils.py
in your editor and add kernel_name='python3'
to the arguments of nbexecute()
here.
Alternatively, for continuous integration, the kernel_name
is replace in the json of the
Jupyter Notebook before executing jupyter-book
here.
Only use this operation on a discardable copy as jq
changes all formatting.
%%bash
pip freeze
%%bash
python -m openpifpaf.predict --version