If you are interested in contributing to mdearn, your contributions will fall into two categories:
- You want to implement a new feature:
- In general, we accept any features as long as they fit the scope of this package. If you are unsure about this or need help on the design/implementation of your feature, post about it in an issue.
- You want to fix a bug:
- Please post an issue using the Bug template which provides a clear and concise description of what the bug was.
Once you finish implementing a feature or bug-fix, please send a Pull Request to https://github.com/ramanathanlab/mdlearn.
To develop mdlearn on your machine, please follow these instructions:
- Clone a copy of mdlearn from source:
git clone https://github.com/ramanathanlab/mdlearn.git
cd mdlearn
- If you already have a mdlearn from source, update it:
git pull
- Install mdlearn in
develop
mode:
For development, it is recommended to use a virtual environment. The following commands will create a virtual environment, install the package in editable mode, and install the pre-commit hooks.
python -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel
pip install -e '.[dev,docs,torch]'
pre-commit install
To run the test suite:
First, Build and install mdlearn from source.
To test the code, run the following command:
pre-commit run --all-files
tox -e py312
If contributing, please add a test_<module_name>.py
in the test/
directory
in a subdirectory that matches the mdlearn package directory structure. Inside,
test_<module_name>.py
implement test functions using pytest.
To build the documentation:
- Build and install mdlearn from source.
- Generate the documentation file via:
cd docs
make html
The docs are located in build/html/index.html
.
To view the docs run: open build/html/index.html
.
To release a new version of mdlearn to PyPI:
- Merge the
develop
branch into themain
branch with an updated version number inpyproject.toml
. - Make a new release on GitHub with the tag and name equal to the version number.
- Build and install mdlearn from source.
- Run the following commands:
cd docs
make html
cd ..
rm -r dist
python3 -m build
twine upload dist/*