Skip to content

Commit

Permalink
Update contributor docs (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
reidjohnson authored Sep 28, 2024
1 parent cd5208c commit eb3bf80
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 39 deletions.
31 changes: 1 addition & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,4 @@ In general, we follow the ["fork-and-pull" Git workflow](https://gist.github.com

## Setting Up Your Environment

To contribute to the `quantile-forest` source code, start by forking and then cloning the repository (i.e. `git clone [email protected]:YourUsername/quantile-forest.git`)

Once inside the repository, to build and install the package, run:

```cmd
python setup.py build_ext --inplace
python setup.py install
```

## Testing Your Changes

To execute unit tests from the `quantile-forest` repository, run:

```cmd
pytest quantile_forest -v
```

## Troubleshooting

If the build fails because SciPy is not installed, ensure OpenBLAS and LAPACK are available and accessible.

On macOS, run:

```cmd
brew install openblas
brew install lapack
export SYSTEM_VERSION_COMPAT=1
```

Then try rebuilding.
To contribute to the `quantile-forest` source code, you can follow the [developer's guide](https://zillow.github.io/quantile-forest/getting_started/developers.html).
27 changes: 18 additions & 9 deletions docs/getting_started/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@ Developer's Guide

Development Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~

Building the package from source additionally requires the following dependencies:

* cython (>=3.0a4)

We also use pre-commit hooks to identify simple issues before submission.

To install these dependencies, run::
Setting Up Your Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~

To contribute to the `quantile-forest` source code, start by forking and then cloning the repository (i.e. `git clone [email protected]:YourUsername/quantile-forest.git`)

Once inside the repository, you can prepare a development environment. Using conda::

pip install cython pre-commit
conda create -n qf python=3.12
conda activate qf
conda install pre-commit
pre-commit install

Development Installation
~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -38,25 +47,25 @@ Test and Coverage

Ensure that `pytest` and `pytest-cov` are installed::

$ pip install pytest pytest-cov
pip install pytest pytest-cov

To test the code::

$ python -m pytest quantile_forest -v
python -m pytest quantile_forest -v

To test the code and produce a coverage report::

$ python -m pytest quantile_forest --cov-report html --cov=quantile_forest
python -m pytest quantile_forest --cov-report html --cov=quantile_forest

To test the documentation::

$ python -m pytest --doctest-glob="*.rst" --doctest-modules docs
python -m pytest --doctest-glob="*.rst" --doctest-modules docs

Documentation
~~~~~~~~~~~~~

To build the documentation, run::

$ pip install -r ./docs/sphinx_requirements.txt
$ mkdir -p ./docs/_images
$ sphinx-build -b html ./docs ./docs/_build
pip install -r ./docs/sphinx_requirements.txt
mkdir -p ./docs/_images
sphinx-build -b html ./docs ./docs/_build

0 comments on commit eb3bf80

Please sign in to comment.