Skip to content

Commit 94d84a9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cbee0e0 commit 94d84a9

99 files changed

Lines changed: 1623 additions & 1477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

code_of_conduct.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Contributor Covenant Code of Conduct
22

3+
<!--TOC-->
4+
5+
______________________________________________________________________
6+
7+
**Table of Contents**
8+
9+
- [Our Pledge](#our-pledge)
10+
- [Our Standards](#our-standards)
11+
- [Enforcement Responsibilities](#enforcement-responsibilities)
12+
- [Scope](#scope)
13+
- [Enforcement](#enforcement)
14+
- [Enforcement Guidelines](#enforcement-guidelines)
15+
- [1. Correction](#1-correction)
16+
- [2. Warning](#2-warning)
17+
- [3. Temporary Ban](#3-temporary-ban)
18+
- [4. Permanent Ban](#4-permanent-ban)
19+
- [Attribution](#attribution)
20+
21+
______________________________________________________________________
22+
23+
<!--TOC-->
24+
325
## Our Pledge
426

527
We as members, contributors, and leaders pledge to make participation in our

data/natural/preprocess_msds.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,5 @@ def get_text(d, text="", level=1, linebreaks=2):
4444
print(f"Output file already exists, please check: {path_jsonl_out}")
4545
else:
4646
with open(path_jsonl_out, "a") as fout:
47-
for sample in data:
48-
fout.write(json.dumps(sample) + "\n")
47+
fout.writelines(json.dumps(sample) + "\n" for sample in data)
4948
print(f"JSONL saved to: {path_jsonl_out}")

data/tabular/RedDB/transform.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -214,46 +214,46 @@ def read_dataset():
214214
journal = {Nature Scientific Data}""",
215215
],
216216
"templates": [
217-
"""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
218-
"""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
219-
"""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
220-
"""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
221-
"""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
222-
"""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
223-
"""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
224-
"""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
225-
"""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
226-
"""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
227-
"""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
228-
"""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
229-
"""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
230-
"""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
231-
"""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
232-
"""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
233-
"""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
234-
"""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
235-
"""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
236-
"""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
237-
"""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
238-
"""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
239-
"""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
240-
"""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
241-
"""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
242-
"""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
243-
"""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
244-
"""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
217+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""",
218+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""",
219+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""",
220+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""",
221+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""",
222+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""",
223+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""",
224+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""",
225+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""",
226+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""",
227+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""",
228+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""",
229+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""",
230+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}."""
231+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""",
232+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""",
233+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""",
234+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""",
235+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""",
236+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""",
237+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""",
238+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""",
239+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""",
240+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""",
241+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""",
242+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""",
243+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""",
244+
"""The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""",
245245
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} based on the {#text |!}description{# below|!}.
246246
Description: It has an {solubilityAqSolPred__names__noun} {solubilityAqSolPred#} {solubilityAqSolPred__units} and a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.
247-
Result: {SMILES#}""", # noqa: E501
247+
Result: {SMILES#}""",
248248
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} based on the {#text |!}description{# below|!}.
249249
Description: It has an {solubilityAqSolPred__names__noun} {solubilityAqSolPred#} {solubilityAqSolPred__units} and a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.
250-
Result: {InChI#}""", # noqa: E501
250+
Result: {InChI#}""",
251251
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} based on the {#text |!}description{# below|!}.
252252
Description: It has an {solutionLumo__names__noun} {solutionLumo#} {solutionLumo__units} and a {solutionHomo__names__noun} of {solutionHomo#} {solutionHomo__units}.
253-
Result: {SMILES#}""", # noqa: E501
253+
Result: {SMILES#}""",
254254
"""Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} based on the {#text |!}description{# below|!}.
255255
Description: It has an {solutionLumo__names__noun} {solutionLumo#} {solutionLumo__units} and a {solutionHomo__names__noun} of {solutionHomo#} {solutionHomo__units}.
256-
Result: {InChI#}""", # noqa: E501
256+
Result: {InChI#}""",
257257
],
258258
}
259259

data/tabular/SIDER/transform.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ def write_meta(column_ids: pd.Index, descriptions: List[str], num_points: int) -
7474
]
7575

7676
templates = [
77-
"The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description}" # noqa: E501
77+
"The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description}"
7878
+ " {#representation of |!}{SMILES#} is {"
7979
+ col_id
8080
+ "#not a &a }"
8181
+ "{#potential cause|potential reason!} for {"
8282
+ col_id
83-
+ "__names__noun}." # noqa: E501
83+
+ "__names__noun}."
8484
for col_id in column_ids[1:]
8585
]
8686

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

0 commit comments

Comments
 (0)