Skip to content

Commit 3a540d0

Browse files
authored
Merge pull request #618 from xchem/m2ms-1394-incermental-RHS-upload
Incermental rhs upload - remove explicit versioning (issue 1394)
2 parents d5c1555 + bd65a59 commit 3a540d0

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

viewer/cset_upload.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ def set_mol(
339339
smiles = Chem.MolToSmiles(mol)
340340
inchi = Chem.inchi.MolToInchi(mol)
341341
molecule_name = mol.GetProp('_Name')
342-
version = mol.GetProp('version')
343342

344343
compound: Compound = self.create_mol(
345344
inchi, compound_set.target, name=molecule_name
@@ -449,8 +448,9 @@ def set_mol(
449448
existing_computed_molecules.append(k)
450449

451450
if len(existing_computed_molecules) == 1:
452-
logger.info(
453-
'Using existing ComputedMolecule %s', existing_computed_molecules[0]
451+
logger.warning(
452+
'Using existing ComputedMolecule %s and overwriting its metadata',
453+
existing_computed_molecules[0],
454454
)
455455
computed_molecule = existing_computed_molecules[0]
456456
elif len(existing_computed_molecules) > 1:
@@ -485,7 +485,6 @@ def set_mol(
485485
computed_molecule.pdb = lhs_so
486486
# TODO: this is wrong
487487
computed_molecule.pdb_info = pdb_info
488-
computed_molecule.version = version
489488
# Extract possible reference URL and Rationale
490489
# URLs have to be valid URLs and rationals must contain more than one word
491490
ref_url: Optional[str] = (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 3.2.25 on 2024-07-10 08:31
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('viewer', '0058_auto_20240614_1016'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='computedmolecule',
15+
name='version',
16+
),
17+
]

viewer/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,6 @@ class ComputedMolecule(models.Model):
10271027
max_length=255,
10281028
help_text="Link to pdb file; user-uploaded pdb or pdb.experiment.pdb_info",
10291029
)
1030-
version = models.PositiveSmallIntegerField(null=False, default=1)
10311030

10321031
def __str__(self) -> str:
10331032
return f"{self.smiles}"

0 commit comments

Comments
 (0)