Contributing
Thank you for considering a contribution to HalogenGroups / PFASGroups!
How to contribute
Open an issue to discuss bugs, feature requests, or new group definitions before submitting a pull request.
Fork the repository on GitHub.
Create a feature branch:
git checkout -b my-featureMake your changes and add tests.
Run the test suite (see below).
Open a pull request against the
mainbranch.
Setting up a development environment
git clone https://github.com/lucdecrem/PFASGroups.git
cd PFASGroups
conda create -n halogengroups-dev -c conda-forge python=3.10 rdkit networkx
conda activate halogengroups-dev
pip install -e ".[dev]"
Running tests
pytest
To run only unit tests (no slow benchmarks):
pytest -m "not slow"
To check coverage:
pytest --cov=HalogenGroups --cov-report=term-missing
Code style
The project uses Black for formatting and Flake8 for linting:
black HalogenGroups/ tests/
flake8 HalogenGroups/ tests/
Adding new halogen groups
New group definitions live in
HalogenGroups/data/halogen_groups.json. Each entry must have:
{
"group_id": 117,
"name": "my_new_group",
"category": "Generic",
"smarts": "[CX4](F)(F)(F)[NX3]",
"is_PFAS": true,
"compute": true,
"description": "Perfluoroalkyl amine"
}
After adding a group:
Run
pytest tests/test_groups.pyto check that the new group loads and matches the expected test molecules.Add at least one positive and one negative test molecule to
tests/_test_examples.py.
Reporting issues
Please include:
Python and RDKit versions (
python --version,python -c "import rdkit; print(rdkit.__version__)").The minimal SMILES that triggers the issue.
Expected vs actual output.
Contact
GitHub Issues: https://github.com/lucdecrem/PFASGroups/issues
Email: luc.miaz@aces.su.se