Skip to content

Commit

Permalink
adapted snake_case in doc and ipynbs
Browse files Browse the repository at this point in the history
  • Loading branch information
MTLehner committed Apr 4, 2024
1 parent d62616e commit 44483ee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion demos/02_computational_experiment_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
],
"source": [
"# now bulk register. We want to also collect IDs of compounds which were already registered.\n",
"reg_ids = lwreg.bulk_register(mols=ms,failOnDuplicate=False)\n",
"reg_ids = lwreg.bulk_register(mols=ms,fail_on_duplicate=False)\n",
"reg_ids = set(reg_ids)\n",
"print(f'Registered {len(reg_ids)} unique compounds.')"
]
Expand Down
2 changes: 1 addition & 1 deletion demos/03_computational_experiment_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
],
"source": [
"# now bulk register. We want to also collect IDs of compounds which were already registered.\n",
"reg_ids = lwreg.bulk_register(mols=ms_3d,failOnDuplicate=False)\n",
"reg_ids = lwreg.bulk_register(mols=ms_3d,fail_on_duplicate=False)\n",
"print(f'Registered {len(reg_ids)} unique conformers.')"
]
},
Expand Down
14 changes: 7 additions & 7 deletions lwreg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def _register_one_conformer(mrn,
cn,
curs,
config,
failOnDuplicate,
fail_on_duplicate,
confId=-1):
try:
chash = _get_conformer_hash(sMol,
Expand All @@ -422,7 +422,7 @@ def _register_one_conformer(mrn,
cn.commit()
except _violations:
cn.rollback()
if failOnDuplicate:
if fail_on_duplicate:
raise
else:
curs.execute(
Expand Down Expand Up @@ -636,7 +636,7 @@ def register(config=None,
molblock -- MOL or SDF block
smiles -- smiles
escape -- the escape layer
failOnDuplicate -- if true then an exception is raised when trying to register a duplicate
fail_on_duplicate -- if true then an exception is raised when trying to register a duplicate
confId -- the conformer ID to use when in registerConformers mode
no_verbose -- if this is False then the registry number will be printed
"""
Expand Down Expand Up @@ -688,7 +688,7 @@ def register_multiple_conformers(config=None,
config -- configuration dict
mol -- RDKit molecule object (must have at least one conformer)
escape -- the escape layer
failOnDuplicate -- if true then an exception is raised when trying to register a duplicate
fail_on_duplicate -- if true then an exception is raised when trying to register a duplicate
no_verbose -- if this is False then the registry number will be printed
"""
if not config:
Expand Down Expand Up @@ -774,7 +774,7 @@ def bulk_register(config=None,
The result tuple includes a single entry for each molecule in the input.
That entry can be one of the following:
- the registry number (molregno) of the registered molecule
- RegistrationFailureReasons.DUPLICATE if failOnDuplicate is True and a
- RegistrationFailureReasons.DUPLICATE if fail_on_duplicate is True and a
molecule is a duplicate
- RegistrationFalureReasons.PARSE_FAILURE if there was a problem processing
the molecule
Expand All @@ -785,8 +785,8 @@ def bulk_register(config=None,
config -- configuration dict
mols -- an iterable of RDKit molecule objects
sdfile -- SDF filename
escapeProperty -- the molecule property to use as the escape layer
failOnDuplicate -- if true then RegistraionFailureReasons.DUPLICATE will be returned
escape_property -- the molecule property to use as the escape layer
fail_on_duplicate -- if true then RegistraionFailureReasons.DUPLICATE will be returned
for each already-registered molecule, otherwise the already existing
structure ID will be returned
no_verbose -- if this is False then the registry numbers will be printed
Expand Down
4 changes: 2 additions & 2 deletions tutorial/Machine learning experiment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
"metadata": {},
"outputs": [],
"source": [
"mrns = lwreg.bulk_register(mols=df.mol.to_list(),failOnDuplicate=False)"
"mrns = lwreg.bulk_register(mols=df.mol.to_list(),fail_on_duplicate=False)"
]
},
{
Expand Down Expand Up @@ -390,7 +390,7 @@
"simpd_name = 'CHEMBL217-1'\n",
"ds = catalog[simpd_name]\n",
"df = ds.read()\n",
"mrns = lwreg.bulk_register(mols=df.mol.to_list(),failOnDuplicate=False)\n",
"mrns = lwreg.bulk_register(mols=df.mol.to_list(),fail_on_duplicate=False)\n",
"chembl_target = ds.metadata[\"url\"].split(\"/\")[-2]\n",
"ds_uid = str(uuid.uuid4())\n",
"cn = utils.connect(config=config)\n",
Expand Down

0 comments on commit 44483ee

Please sign in to comment.