Commit 3075edb5 authored by Dennis Noll's avatar Dennis Noll
Browse files

Merge branch 'master' of git.rwth-aachen.de:3pia/cms_analyses/common

parents f9092601 4c16158c
......@@ -122,7 +122,7 @@ class GroupCoffeaProcesses(PGroupMixin, RecipeMixin, PoolMap, ConfigTask):
if not sys.startswith("ScaleWeight_"):
continue
ratio = tot[:, i] / nom
if 0 < np.nanmin(ratio) <= 0.55:
if np.any(np.isfinite(ratio)) and 0 < np.nanmin(ratio) <= 0.55:
w[i] *= 2
sys_mul2[d][sys] = (
np.nanmin(ratio),
......
......@@ -22,6 +22,7 @@ from contextvars import ContextVar
from contextlib import ContextDecorator, contextmanager
from time import time
from filelock import FileLock
import tempfile
from hashlib import sha1
from pathlib import Path
......@@ -659,25 +660,28 @@ class GitlabIssue:
@property
def issue(self) -> Dict:
if self.breadcrumb.exists():
return self.breadcrumb.load()["issue"]
with self.lock:
title = self.issue_title
json = self._json(
self.apiurl, params={"search": title, "in": "title", "state": "opened"}
)
if len(json):
[issue] = json
assert issue["title"] == title
else:
issue = self._json(
self.apiurl,
data={
"title": title,
"labels": "create-issue (automatic)",
},
if self.breadcrumb.exists():
return self.breadcrumb.load()["issue"]
ihash = sha1(self.issue_title.encode("utf8")).hexdigest()[:20]
with FileLock(Path(tempfile.gettempdir()) / f"gitub_issue.{ihash}.lock"):
title = self.issue_title
json = self._json(
self.apiurl, params={"search": title, "in": "title", "state": "opened"}
)
self.breadcrumb.dump({"issue": issue})
if len(json):
[issue] = json
assert issue["title"] == title
else:
issue = self._json(
self.apiurl,
data={
"title": title,
"labels": "create-issue (automatic)",
},
)
self.breadcrumb.dump({"issue": issue})
# try automatic issue linking
if m := re.match(r"^issue_(\d+)_", self.model_version):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment