Thank you for your interest in contributing to the marginaleffects
Python project!
This document outlines guidelines and instructions for setting up the development environment, running tests, and ensuring your code follows the project standards.
We manage the development environment using uv
for dependency management, task execution, and testing. All necessary information is in the .toml
and .lock
files, and uv
will handle dependency management automatically.
Clone the repository
git clone git@github.com:vincentarelbundock/pymarginaleffects.git
cd pymarginaleffects
Create and activate the virtual environment using uv
:
uv venv .venv
source .venv/bin/activate.sh
Install the project and its dependencies:
uv pip install .
We use pytest
for testing. The testing environment is fully managed by uv
. To run the tests, simply execute:
uv run --all-extras pytest
uv
will automatically install any missing dependencies before running the tests.
This project follows strict code formatting and linting rules enforced by ruff
. Before submitting any code, make sure to run ruff
to format your files and check for linting errors.
You can run ruff
by executing:
uv run --all-extras ruff check marginaleffects
uv run --all-extras ruff format marginaleffects
Make sure there are no linting errors before submitting your changes.
- Be nice!
- Fork the repository and create a new branch for your feature or bugfix.
- Ensure all your changes are well-documented in the code, documentation, and changelog (if necessary).
- Write tests for any new functionality or changes you make.
- Run the tests and ensure everything passes before submitting your pull request.
- Ensure your code is formatted and linted using
ruff
. - Push your changes to your forked repository.
- Create a pull request (PR) on the main repository.
- Make sure to include a clear description of your changes and reference any related issues (if applicable).
We appreciate your contributions and look forward to reviewing your pull requests!
- Follow the Numpydoc docstring style for the documentation, see link
The marginaleffects
repository includes a Makefile
to facilitate some common tasks.
- Install make for Windows https://gnuwin32.sourceforge.net/packages/make.htm.
- Add it to your path variable.
- Then you can use scripts specified in the Makefile. e.g.
make test