forked from enviPath/enviPy
Cleanup (#52)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#52
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user