...
Some checks failed
CI / test (pull_request) Failing after 18s
API CI / api-tests (pull_request) Failing after 35s

This commit is contained in:
Tim Lorsbach
2026-06-21 21:23:15 +02:00
parent c4067cb11e
commit d29cebfa0c
4 changed files with 1610525 additions and 11 deletions

View File

@ -32,7 +32,7 @@ services:
image: git.envipath.com/envipath/envipy-bayer:1.0
container_name: epcelery
env_file:
- .env.dev
- .env
command: celery -A envipath worker --concurrency=6 -Q model,predict,background --pool threads
volumes:
- ep_bayer_data:/opt/enviPy/

View File

@ -354,7 +354,7 @@ DEFAULT_MODEL_PARAMS = {
"num_chains": 10,
}
DEFAULT_MAX_NUMBER_OF_NODES = 50
DEFAULT_MAX_NUMBER_OF_NODES = 9999
DEFAULT_MAX_DEPTH = 8
DEFAULT_MODEL_THRESHOLD = 0.25

View File

@ -784,6 +784,10 @@ def models(request):
{"Home": s.SERVER_URL},
{"Model": s.SERVER_URL + "/model"},
]
context["entity_type"] = "model"
context["api_endpoint"] = f"{s.SERVER_PATH}/api/v1/models/"
context["per_page"] = s.API_PAGINATION_DEFAULT_PAGE_SIZE
context["list_title"] = "models"
# Keep model_types for potential modal/action use
context["model_types"] = {
@ -797,12 +801,14 @@ def models(request):
"requires_rule_packages": True,
"requires_data_packages": True,
},
"EnviFormer": {
}
if s.ENVIFORMER_PRESENT:
context["model_types"]["EnviFormer"] = {
"type": "enviformer",
"requires_rule_packages": False,
"requires_data_packages": True,
},
}
if s.FLAGS.get("PLUGINS", False):
for k, v in s.CLASSIFIER_PLUGINS.items():
@ -810,6 +816,9 @@ def models(request):
"type": k,
"requires_rule_packages": v.requires_rule_packages(),
"requires_data_packages": v.requires_data_packages(),
"additional_parameters": v.Config.__name__.lower()
if v.Config.__name__ != ""
else None,
}
for k, v in s.PROPERTY_PLUGINS.items():
context["model_types"][v.display()] = {
@ -818,12 +827,6 @@ def models(request):
"requires_data_packages": v.requires_data_packages(),
}
# Context for paginated template
context["entity_type"] = "model"
context["api_endpoint"] = f"{s.SERVER_PATH}/api/v1/models/"
context["per_page"] = s.API_PAGINATION_DEFAULT_PAGE_SIZE
context["list_title"] = "models"
return render(request, "collections/models_paginated.html", context)
elif request.method == "POST":
@ -3001,9 +3004,15 @@ def settings(request):
new_default = request.POST.get("prediction-setting-new-default", "off") == "on"
# min 2, max s.DEFAULT_MAX_NUMBER_OF_NODES
temp_max_nodes = request.POST.get("prediction-setting-max-nodes")
if temp_max_nodes is None or temp_max_nodes == "" or int(temp_max_nodes) == -1:
temp_max_nodes = s.DEFAULT_MAX_NUMBER_OF_NODES
else:
temp_max_nodes = int(request.POST.get("prediction-setting-max-nodes", 1))
max_nodes = min(
max(
int(request.POST.get("prediction-setting-max-nodes", 1)),
temp_max_nodes,
2,
),
s.DEFAULT_MAX_NUMBER_OF_NODES,
@ -3024,6 +3033,7 @@ def settings(request):
model_uuid = model_url.split("/")[-1]
params["model"] = EPModel.objects.get(uuid=model_uuid)
# TODO Check if removed if request contains "" or not at all
params["model_threshold"] = request.POST.get(
"model-based-prediction-setting-threshold", s.DEFAULT_MODEL_THRESHOLD
)

File diff suppressed because one or more lines are too long