implement dynamic db name from config
Some checks failed
Ruff / ruff (push) Waiting to run
Mypy / mypy (push) Failing after 44s
Pytest / pytest (3.12) (push) Successful in 50s
Pytest / pytest (3.13) (push) Has been cancelled
Pytest / pytest (3.14) (push) Has been cancelled

This commit is contained in:
Justus Kuhlmann 2025-12-04 14:31:53 +01:00
commit 0626b34337
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
5 changed files with 60 additions and 27 deletions

View file

@ -20,6 +20,7 @@ import os
from .input.implementations import codes as known_codes
from typing import Any
def replace_string(string: str, name: str, val: str) -> str:
if '{' + name + '}' in string:
n = string.replace('{' + name + '}', val)
@ -27,6 +28,7 @@ def replace_string(string: str, name: str, val: str) -> str:
else:
return string
def replace_in_meas(measurements: dict[str, dict[str, Any]], vars: dict[str, str]) -> dict[str, dict[str, Any]]:
# replace global variables
for name, value in vars.items():
@ -39,6 +41,7 @@ def replace_in_meas(measurements: dict[str, dict[str, Any]], vars: dict[str, str
measurements[m][key][i] = replace_string(measurements[m][key][i], name, value)
return measurements
def fill_cons(measurements: dict[str, dict[str, Any]], constants: dict[str, str]) -> dict[str, dict[str, Any]]:
for m in measurements.keys():
for name, val in constants.items():