forked from OpenBioML/chemnlp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add contribution guide and CoC (OpenBioML#6)
- Loading branch information
1 parent
0793278
commit bd7ac30
Showing
7 changed files
with
305 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# GitHub action that attempts to install the conda env | ||
# from conda.yaml | ||
# then run black, isort, flake8 | ||
|
||
name: Install | ||
on: [push, pull_request] | ||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
environment-file: conda.yaml | ||
activate-environment: chemnlp | ||
python-version: 3.7 | ||
auto-update-conda: true | ||
auto-activate-base: false | ||
- name: Install | ||
run: | | ||
conda env create -f conda.yml | ||
conda activate chemnlp | ||
- name: Lint | ||
run: | | ||
conda activate chemnlp | ||
black --check . | ||
isort --check-only . | ||
flake8 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
There are many different ways to contribute to ChemNLP! | ||
You can get in touch via the GitHub [task board](https://github.com/orgs/OpenBioML/projects/5?query=is:open+sort:updated-desc) and [issues](https://github.com/OpenBioML/chemnlp/issues?q=is:issue+is:open+sort:updated-desc&query=is:open+sort:updated-desc) and our [Discord](https://t.co/YMzpevmkiN). | ||
|
||
## Pre-Requisites | ||
Please make a [GitHub account](https://github.com/) prior to implementing a dataset; you can follow instructions to install git [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). | ||
|
||
1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [ChemNLP repository](https://github.com/OpenBioML/chemnlp) | ||
2. [Clone the you fork](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) | ||
3. [Make a new branch](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging) | ||
4. Please try using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for formatting your commit messages | ||
|
||
## Create a development environment (For code/dataset contributions) | ||
|
||
For code and data contributions, we recommend you creata a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). If you do not have conda already installed on your system, we recommend installing [miniconda](https://docs.conda.io/en/latest/miniconda.html): | ||
|
||
```bash | ||
conda env create -f conda.yml # Creates a conda env | ||
conda activate chemnlp # Activate your conda environment | ||
``` | ||
|
||
# Implementing a dataset | ||
|
||
## Contributing a dataset | ||
One of the most important ways to contribute to the ChemNLP efforts is to implement a dataset. | ||
With "implementing" we mean the following: | ||
|
||
- Take a dataset from our [awesome list](https://github.com/kjappelbaum/awesome-chemistry-datasets) (if it is not there, please add it there first, so we keep track) | ||
- Make an issue in this repository that you want to add this dataset (we will label this issue and assign it to you) | ||
- Make a PR that adds in a new folder in `data` | ||
- `meta.yaml` describing the dataset | ||
- `transform.py` Python code that transforms the original dataset (linked in `meta.yaml`) into a form that can be consumed by the loader | ||
- If you need additional dependencies, | ||
|
||
|
||
|
||
The `meta.yaml` has the following structure: | ||
|
||
```yaml | ||
name: aquasoldb # unique identifier, we will also use this for directory names | ||
description: | # short description what this dataset is about | ||
Curation of nine open source datasets on aqueous solubility. | ||
The authors also assigned reliability groups. | ||
targets: | ||
- id: Solubility # name of the column in a tabular dataset | ||
description: Experimental aqueous solubility value (LogS) # description of what this column means | ||
units: log(mol/L) # units of the values in this column (leave empty if unitless) | ||
type: continuous # can be "categorical", "ordinal", "continuous" | ||
names: # names for the property (to sample from for building the prompts) | ||
- solubility | ||
- water solubility | ||
- id: SD | ||
description: Standard deviation of the experimental aqueous solubility value for multiple occurences | ||
units: log(mol/L) | ||
type: continuous | ||
names: | ||
- solubility | ||
- water solubility | ||
- solubility in water | ||
identifiers: | ||
- id: InChI # column name | ||
type: InChI # can be "SMILES", "SELFIES", "IUPAC", "OTHER" | ||
description: International Chemical Identifier # description (optional, except for "OTHER") | ||
license: CC0 1.0 # license under which the original dataset was published | ||
num_points: 10000 # number of datapoints in this dataset | ||
links: # list of relevant links (original dataset, other uses, etc.) | ||
- name: dataset | ||
url: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/OVHAW8 | ||
description: Original dataset | ||
bibtex: # citation(s) for this dataset in BibTeX format | ||
- | | ||
"@article{Sorkun_2019, | ||
doi = {10.1038/s41597-019-0151-1}, | ||
url = {https://doi.org/10.1038%2Fs41597-019-0151-1}, | ||
year = 2019, | ||
month = {aug}, | ||
publisher = {Springer Science and Business Media {LLC}}, | ||
volume = {6}, | ||
number = {1}, | ||
author = {Murat Cihan Sorkun and Abhishek Khetan and Süleyman Er}, | ||
title = {{AqSolDB}, a curated reference set of aqueous solubility and 2D descriptors for a diverse set of compounds}, | ||
journal = {Sci Data} | ||
}" | ||
``` | ||
For the typical material-property datasets, we will later use the `identifier` and `property` columns to create and fill prompt templates. | ||
In case your dataset isn't a simple tabular dataset with chemical compounds and properties, please also add the following additional fields for the templates: | ||
|
||
|
||
```yaml | ||
templates: | ||
- prompt: "Please answer the following chemistry question.\nDerive for the molecule with the <molecule_text> <molecule> the <expt_value_text>." | ||
completion: "<exp_value>" | ||
- prompt: "Please answer the following question.\nPredict the <expt_value_text> for <molecule>." | ||
completion: "<exp_value>" | ||
fields: | ||
exp_value: | ||
values: | ||
- name: exp_value | ||
column: exp_value | ||
text: adsorption energy | ||
- name: calc_value | ||
column: calc_value | ||
text: adsorption free energy | ||
molecule: | ||
values: | ||
- name: smiles | ||
column: smiles | ||
text: | ||
- name: smiles | ||
column: smiles | ||
text: SMILES | ||
``` | ||
|
||
This templating syntax should allow for quite some flexibility: For every template field we will look for the key, e.g., `exp_value` as well as `exp_value_text` (which can be used to describe to the field type/value). | ||
If this (`text`) is a column name, we will use the values from the column (therefore, effectively, jointly sample the `column` and `text` columns). | ||
If there are multiple values for one field, we will sample combinations. | ||
If you want to suggest sampling from different prompt prefixes, you can do so by specifying a template fields and different `text` (but no `column`). | ||
|
||
## Implementing a dataloader | ||
|
||
TBD. | ||
|
||
|
||
## Implementing tokenizers | ||
|
||
TBD. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# chemnlp | ||
[](code_of_conduct.md) | ||
|
||
# ChemNLP | ||
ChemNLP project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
|
||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, caste, color, religion, or sexual | ||
identity and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[INSERT CONTACT METHOD]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining | ||
the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed | ||
unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing | ||
clarity around the nature of the violation and an explanation of why the | ||
behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series of | ||
actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No | ||
interaction with the people involved, including unsolicited interaction with | ||
those enforcing the Code of Conduct, for a specified period of time. This | ||
includes avoiding interactions in community spaces as well as external channels | ||
like social media. Violating these terms may lead to a temporary or permanent | ||
ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including | ||
sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public | ||
communication with the community for a specified period of time. No public or | ||
private interaction with the people involved, including unsolicited interaction | ||
with those enforcing the Code of Conduct, is allowed during this period. | ||
Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community | ||
standards, including sustained inappropriate behavior, harassment of an | ||
individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within the | ||
community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.1, available at | ||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
||
Community Impact Guidelines were inspired by | ||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at | ||
[https://www.contributor-covenant.org/translations][translations]. | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
[Mozilla CoC]: https://github.com/mozilla/diversity | ||
[FAQ]: https://www.contributor-covenant.org/faq | ||
[translations]: https://www.contributor-covenant.org/translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: chemnlp | ||
dependencies: | ||
- python>=3.7 | ||
- pip | ||
- pip: | ||
- -r dev-requirements.txt | ||
- -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
black>=22.1.0,<22.2.0 | ||
flake8>=3.8.3,<3.9.0 | ||
isort>=5.0.0,<5.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
datasets>=2.8.0,<3.0.0 | ||
numpy>=1.21.2 | ||
openpyxl>=3.0.9,<3.1.0 | ||
pandas>=1.3.3 |