Skip to content
Open
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
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
Expand All @@ -21,69 +21,69 @@ repos:
- id: trailing-whitespace
exclude: .gitignore
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 26.5.1
hooks:
- id: black-jupyter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
rev: v0.16.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.2
rev: v3.9.6
hooks:
- id: prettier
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
rev: v0.21.0
hooks:
- id: yamlfmt
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
rev: v0.24.4
hooks:
- id: toml-sort-fix
exclude: poetry.lock
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies: [".[toml]"]
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.1.0
rev: 4.2.2
hooks:
- id: sqlfluff-fix
- repo: https://github.com/hadolint/hadolint
rev: v2.13.0-beta
rev: v2.14.0
hooks:
- id: hadolint-docker
- repo: https://github.com/jsh9/markdown-toc-creator
rev: 0.0.6
rev: 0.1.3
hooks:
- id: markdown-toc-creator
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: check-mailmap
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
rev: 2.4.1
hooks:
- id: poetry-check
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v2.3.0
hooks:
- id: mypy
additional_dependencies:
- types-requests
- repo: https://github.com/srstevenson/nb-clean
rev: 3.3.0
rev: 4.0.1
hooks:
- id: nb-clean
args: [--preserve-cell-outputs, --remove-empty-cells]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.25
hooks:
- id: validate-pyproject
additional_dependencies:
Expand Down
22 changes: 22 additions & 0 deletions code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Contributor Covenant Code of Conduct

<!--TOC-->

______________________________________________________________________

**Table of Contents**

- [Our Pledge](#our-pledge)
- [Our Standards](#our-standards)
- [Enforcement Responsibilities](#enforcement-responsibilities)
- [Scope](#scope)
- [Enforcement](#enforcement)
- [Enforcement Guidelines](#enforcement-guidelines)
- [1. Correction](#1-correction)
- [2. Warning](#2-warning)
- [3. Temporary Ban](#3-temporary-ban)
- [4. Permanent Ban](#4-permanent-ban)
- [Attribution](#attribution)

______________________________________________________________________

<!--TOC-->

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
Expand Down
3 changes: 1 addition & 2 deletions data/natural/preprocess_msds.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ def get_text(d, text="", level=1, linebreaks=2):
print(f"Output file already exists, please check: {path_jsonl_out}")
else:
with open(path_jsonl_out, "a") as fout:
for sample in data:
fout.write(json.dumps(sample) + "\n")
fout.writelines(json.dumps(sample) + "\n" for sample in data)
print(f"JSONL saved to: {path_jsonl_out}")
64 changes: 32 additions & 32 deletions data/tabular/RedDB/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,46 +214,46 @@ def read_dataset():
journal = {Nature Scientific Data}""",
],
"templates": [
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""" # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""", # noqa: E501
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}."""
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""",
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""",
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} based on the {#text |!}description{# below|!}.
Description: It has an {solubilityAqSolPred__names__noun} {solubilityAqSolPred#} {solubilityAqSolPred__units} and a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.
Result: {SMILES#}""", # noqa: E501
Result: {SMILES#}""",
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} based on the {#text |!}description{# below|!}.
Description: It has an {solubilityAqSolPred__names__noun} {solubilityAqSolPred#} {solubilityAqSolPred__units} and a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.
Result: {InChI#}""", # noqa: E501
Result: {InChI#}""",
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} based on the {#text |!}description{# below|!}.
Description: It has an {solutionLumo__names__noun} {solutionLumo#} {solutionLumo__units} and a {solutionHomo__names__noun} of {solutionHomo#} {solutionHomo__units}.
Result: {SMILES#}""", # noqa: E501
Result: {SMILES#}""",
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} based on the {#text |!}description{# below|!}.
Description: It has an {solutionLumo__names__noun} {solutionLumo#} {solutionLumo__units} and a {solutionHomo__names__noun} of {solutionHomo#} {solutionHomo__units}.
Result: {InChI#}""", # noqa: E501
Result: {InChI#}""",
],
}

Expand Down
6 changes: 3 additions & 3 deletions data/tabular/SIDER/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ def write_meta(column_ids: pd.Index, descriptions: List[str], num_points: int) -
]

templates = [
"The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description}" # noqa: E501
"The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description}"
+ " {#representation of |!}{SMILES#} is {"
+ col_id
+ "#not a &a }"
+ "{#potential cause|potential reason!} for {"
+ col_id
+ "__names__noun}." # noqa: E501
+ "__names__noun}."
for col_id in column_ids[1:]
]

meta = {
"name": "SIDER", # unique identifier, we will also use this for directory names
"description": f"""Database of marketed drugs and adverse drug reactions (ADR), grouped into {len(column_ids[1:])} system organ classes.""", # noqa: E501
"description": f"""Database of marketed drugs and adverse drug reactions (ADR), grouped into {len(column_ids[1:])} system organ classes.""",
"identifiers": [
{
"id": "SMILES", # column name
Expand Down
Loading
Loading