Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#52
This commit is contained in:
2025-08-22 06:36:22 +12:00
parent ec387cc12e
commit 6e6b394289
42 changed files with 222 additions and 368 deletions

View File

@ -944,7 +944,7 @@ class SimpleAmbitRule(SimpleRule):
@property
def as_svg(self):
return IndigoUtils.smirks_to_svg(self.smirks, True)
return IndigoUtils.smirks_to_svg(self.smirks, True, width=800, height=400)
class SimpleRDKitRule(SimpleRule):
@ -1203,6 +1203,12 @@ class Pathway(EnviPathModel, AliasMixin, ScenarioMixin):
for n in self.root_nodes:
queue.append(n)
# Add unconnected nodes
for n in self.nodes:
if len(n.out_edges.all()) == 0:
if n not in queue:
queue.append(n)
while len(queue):
current = queue.pop()
processed.add(current)
@ -1341,12 +1347,12 @@ class Pathway(EnviPathModel, AliasMixin, ScenarioMixin):
pw = Pathway()
pw.package = package
if name is None:
if name is None or name.strip() == '':
name = f"Pathway {Pathway.objects.filter(package=package).count() + 1}"
pw.name = name
if description is not None:
if description is not None and description.strip() != '':
pw.description = description
pw.save()