Thank you for considering to contribute to Meddlr! We welcome all contributions: code, documentation, feedback, and support.
If you use Meddlr in your work (research, company, etc.) and find it useful, spread the word!
This guide is inspired by Huggingface transformers.
- Please do not commit broken code to any branch.
- Only commit stable config files. Config files that are in development should not be committed.
- Use pull requests (PR) to the merge in code. Do not develop on the
main
branch.
-
For the
repository
by clicking on theFork
button on the repository's page. -
Clone your fork to your local disk, and add the base repository as a remote:
$ git clone git@github.com:<your Github handle>/meddlr.git $ cd meddlr $ git remote add upstream https://github.com/ad12/meddlr.git
-
Create a new branch to hold your development changes:
$ git checkout -b a-descriptive-name-for-my-changes
Do not work on the
main
branch. -
Set up a development environment by running the following commands in a virtual environment:
pip install -e ".[dev]" make dev
-
Once you finish adding your code, run all major formatting and checks using the following:
make autoformat lint test
- Commit your changes and submit a pull request. Follow the checklist below when creating a pull request.
- Make the title of your pull request should be a summary of its contribution;
- If your pull request addresses an issue, mention the issue number in the pull request description
- If your PR is a work in progress, start the title with
[WIP]
- Make sure existing tests pass;
- Add high-coverage tests. Additions without tests will not be merged
- All public methods must have informative docstrings in the google style.
Please write unit tests for any new functionality that is implemented and verify that it does not interfere with existing functionality. Even if you're sure that it works, write a test.
Library tests can be found in the tests folder.
From the root of the repository, here's how to run tests with pytest
for the library:
$ make test
meddlr
follows the google style for documentation.
This section goes over some specific technical guides when contributing new code.
There are many file path manager libraries. For this project we use fvcore.
For any opening files, writing to files, etc., do not use the os
library as this
can cause some internal breakings. Instead use fvcore.common.file_io.PathManager
.
from fvcore.common.file_io import PathManager
path = "/my/path"
# get absolute path
PathManager.get_local_path(path)
# open file
with PathManager.open(path, "r") as f:
...
Please do not push configs that have absolute paths. All config files in this repo should be usable by all users, regardless of the machine.
Instead, use prefixes like "data://"
for data paths, "results://
" for results paths, etc.