splinepy welcomes and appreciates discussions, issues and pull requests!
Once the repo is forked, one possible starting point would be creating a new python environments, for example, using conda with python=3.9
conda create -n splinepyenv python=3.9
conda activate splinepyenv
git clone [email protected]:<path-to-your-fork>
cd splinepy # or <forkname>
git submodule update --init --recursive
git checkout -b new-feature0
python3 setup.py develop --minimal --debug
--minimal
flag builds splines upto 3D (both parametric and physical dimensions), and that way we can reduce compile time. --debug
build also reduces compile time. We are experimenting with the ways to reduce compile time during development. Let us know if you have a great idea!
- use
if
andraise
instead ofassert
- no complex comphrehensions: preferably fits in a line, 2 lines max if it is totally necessary
- use first letter abbreviations in element loops:
for kv in knot_vectors
- use
i
,j
,k
,l
for pure index:for i, kv in enumerate(knot_vectors)
For c++, we've prepared a .clang-format
, with that you can just run clang-format
. We closely follow naming scheme suggested by google stype guide, with a clear exception of file naming.
Here's a preference:
#pragma once
To check the format and style of your code use the following commands:
pip install pre-commit
precommit run -a
pip install -r docs/requirements.txt
sphinx-build -b html docs/source docs/build -E -j auto # `-E` to ignore existing files, -j auto for parallel build (or specify number of processes)
# you can now open `docs/build/index.html` with your browser