Skip to content

Commit

Permalink
Update contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jzwar committed Nov 25, 2023
1 parent e58854d commit 3ce93e2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
splinepy welcomes and appreciates discussions, issues and pull requests!

## Quick start
<<<<<<< Updated upstream
Once the repo is forked, one possible starting point would be creating a new python environments, for example, using [conda](https://docs.conda.io/en/latest/miniconda.html) with `python=3.10`
=======
Once the repo is forked, one possible starting point would be creating a new python environments, for example, using [conda](https://docs.conda.io/en/latest/miniconda.html) with, for example, `python=3.9`
>>>>>>> Stashed changes
```bash
conda create -n splinepyenv python=3.10
conda activate splinepyenv
Expand All @@ -15,15 +19,19 @@ pip install -e. --config-settings=cmake.args=-DSPLINEPY_MORE=OFF --config-settin
`--config-settings=cmake.args=-DSPLINEPY_MORE` build argument builds splines up to 3D (both parametric and physical dimensions if they are part of template parameters), and that way we can reduce compile time. `--config-settings=cmake.build-type="Debug"` build also reduces compile time. We are experimenting with ways to reduce compile time during development. Let us know if you have a great idea!

## Python style / implementation preferences
- use `if` and `raise` instead of `assert`
- use [`PEP 8`](https://peps.python.org/pep-0008/) style guide for python code
- 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)`
<<<<<<< Updated upstream
- module local import with a leading underscore: `from splinepy import settings as _settings`
=======
- to avoid redundancy, doc strings can be copied (see, e.g., helpme module)
>>>>>>> Stashed changes
## C++ style / implementation preferences
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](https://google.github.io/styleguide/cppguide.html#Naming), with a clear exception of file naming.
Here's a preference:
Here's another preference:
- `#pragma once`

## Automatic formatting / style check
Expand All @@ -36,6 +44,7 @@ precommit run -a
## Local documentation build
```bash
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
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
```

0 comments on commit 3ce93e2

Please sign in to comment.