forked from enviPath/enviPy
[Fix] Compound Grouping, Identity prediction of enviFormer, Setting params (#337)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#337
This commit is contained in:
@ -1591,7 +1591,7 @@ def package_rule(request, package_uuid, rule_uuid):
|
||||
context = get_base_context(request)
|
||||
|
||||
if smiles := request.GET.get("smiles", False):
|
||||
stand_smiles = FormatConverter.standardize(smiles)
|
||||
stand_smiles = FormatConverter.standardize(smiles, remove_stereo=True)
|
||||
res = current_rule.apply(stand_smiles)
|
||||
if len(res) > 1:
|
||||
logger.info(
|
||||
@ -1919,7 +1919,7 @@ def package_pathways(request, package_uuid):
|
||||
"Pathway prediction failed due to missing or empty SMILES",
|
||||
)
|
||||
try:
|
||||
stand_smiles = FormatConverter.standardize(smiles)
|
||||
stand_smiles = FormatConverter.standardize(smiles, remove_stereo=True)
|
||||
except ValueError:
|
||||
return error(
|
||||
request,
|
||||
@ -2793,7 +2793,6 @@ def settings(request):
|
||||
|
||||
return render(request, "collections/settings_paginated.html", context)
|
||||
|
||||
return render(request, "collections/objects_list.html", context)
|
||||
elif request.method == "POST":
|
||||
if s.DEBUG:
|
||||
for k, v in request.POST.items():
|
||||
@ -2805,15 +2804,18 @@ def settings(request):
|
||||
|
||||
new_default = request.POST.get("prediction-setting-new-default", "off") == "on"
|
||||
|
||||
# min 2, max s.DEFAULT_MAX_NUMBER_OF_NODES
|
||||
max_nodes = min(
|
||||
max(
|
||||
int(request.POST.get("prediction-setting-max-nodes", 1)),
|
||||
s.DEFAULT_MAX_NUMBER_OF_NODES,
|
||||
2,
|
||||
),
|
||||
s.DEFAULT_MAX_NUMBER_OF_NODES,
|
||||
)
|
||||
|
||||
# min 1, max s.DEFAULT_MAX_DEPTH
|
||||
max_depth = min(
|
||||
max(int(request.POST.get("prediction-setting-max-depth", 1)), s.DEFAULT_MAX_DEPTH),
|
||||
max(int(request.POST.get("prediction-setting-max-depth", 1)), 1),
|
||||
s.DEFAULT_MAX_DEPTH,
|
||||
)
|
||||
|
||||
@ -2960,7 +2962,7 @@ def jobs(request):
|
||||
parts = pair.split(",")
|
||||
|
||||
try:
|
||||
smiles = FormatConverter.standardize(parts[0])
|
||||
smiles = FormatConverter.standardize(parts[0], remove_stereo=True)
|
||||
except ValueError:
|
||||
raise BadRequest(f"Couldn't standardize SMILES {parts[0]}!")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user