Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Contributing to DeLFT

Thank you for your interest in contributing to DeLFT! This guide will help you get started.

## Getting Started

1. Fork the repository on GitHub
2. Clone your fork:
```sh
git clone https://github.com/<your-username>/delft
cd delft
```
3. Create a branch for your changes:
```sh
git checkout -b my-feature
```

## Development Setup

**Requirements:** Python 3.10 or 3.11

Set up a virtual environment and install in editable mode:

```sh
uv venv --python 3.11
source .venv/bin/activate
uv pip install pip

# macOS
uv pip install -e ".[dev]"

# Linux with CUDA 12.1 (GPU)
uv pip install -e ".[dev,gpu]" --extra-index-url https://download.pytorch.org/whl/cu121
```

## Code Style

We use [ruff](https://docs.astral.sh/ruff/) for linting and formatting. The configuration is in `pyproject.toml`.

Key settings:
- Line length: 120 characters
- Double quotes for strings
- Imports are sorted automatically

Before committing, run:

```sh
ruff check .
ruff format .
```

To auto-fix linting issues:

```sh
ruff check --fix .
```

## Running Tests

```sh
# Run all tests
pytest

# Skip slow tests
pytest -m "not slow"

# Run specific test directory
pytest tests/sequence_labelling/
```

## CI Checks

All pull requests must pass:
1. **Linting:** `ruff check .`
2. **Formatting:** `ruff format --check .`
3. **Tests:** `pytest`

CI runs on both Ubuntu and macOS with Python 3.10 and 3.11.

## Pull Request Process

1. Ensure there is an open issue to refer to
2. Branch from `master`
2. Make your changes and ensure all CI checks pass locally
3. Write a clear description of what your changes do and why
4. Submit your pull request against the `master` branch
5. Squash and merge


## License

By contributing to DeLFT, you agree to share your contribution under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ See the [DELFT documentation](https://delft.readthedocs.io) for usage.
python -m applications.delft.grobidTagger date train --architecture BidLSTM --wandb
```

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to get started, code style, running tests, and the pull request process.

## License and contact

Distributed under [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0). The dependencies used in the project are either themselves also distributed under Apache 2.0 license or distributed under a compatible license.
Expand Down