develop #41

Merged
jkuhl merged 210 commits from develop into master 2026-05-07 16:01:02 +02:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 08d25da188 - Show all commits

HOTFIX: nsure path casting in find and meas_io
Some checks failed
Ruff / ruff (push) Waiting to run
Mypy / mypy (push) Successful in 1m9s
Pytest / pytest (3.12) (push) Has been cancelled
Pytest / pytest (3.14) (push) Has been cancelled
Pytest / pytest (3.13) (push) Has been cancelled

Justus Kuhlmann 2026-05-06 16:48:35 +02:00
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -322,6 +322,7 @@ def find_record(path: Path, ensemble: str, correlator_name: str, code: str, proj
revision: Optional[str]=None,
customFilter: Optional[Callable[[pd.DataFrame], pd.DataFrame]] = None,
**kwargs: Any) -> pd.DataFrame:
path = Path(path)
db_file = get_db_file(path)
db = path / db_file
if code not in codes:

View file

@ -37,6 +37,7 @@ def write_measurement(path: Path, ensemble: str, measurement: dict[str, dict[str
parameter_file: str
The parameter file used for the measurement.
"""
path = Path(path)
db_file = get_db_file(path)
db = path / db_file
@ -50,7 +51,7 @@ def write_measurement(path: Path, ensemble: str, measurement: dict[str, dict[str
c = conn.cursor()
for corr in measurement.keys():
file_in_archive = Path('.') / 'archive' / ensemble / corr / str(uuid + '.json.gz')
file = path / file_in_archive
file = Path(path) / file_in_archive
known_meas = {}
if not os.path.exists(path / 'archive' / ensemble / corr):
os.makedirs(path / 'archive' / ensemble / corr)
@ -174,6 +175,7 @@ def load_records(path: Path, meas_paths: list[str], preloaded: dict[str, Any] =
returned_data: list
The loaded records.
"""
path = Path(path)
if dry_run:
_check_db2paths(path, meas_paths)
return []
@ -238,6 +240,7 @@ def cache_path(path: Path, file: str, key: str) -> Path:
cache_path: str
The path at which the measurement of the given file and key is cached.
"""
path = Path(path)
cache_path = cache_dir(path, file) / key
return cache_path
@ -258,6 +261,7 @@ def preload(path: Path, file: Path) -> dict[str, Any]:
filedict: dict[str, Any]
The data read from the file.
"""
path = Path(path)
get(path, file)
filedict: dict[str, Any] = pj.load_json_dict(str(path / file))
print("> read file")
@ -276,7 +280,7 @@ def drop_record(path: Path, meas_path: str) -> None:
The measurement path as noted in the database.
"""
file_in_archive = meas_path.split("::")[0]
file = path / file_in_archive
file = Path(path) / file_in_archive
db_file = get_db_file(path)
db = path / db_file
get(path, db_file)
@ -310,6 +314,7 @@ def drop_cache(path: Path) -> None:
path: str
The path of the library.
"""
path = Path(path)
cache_dir = path / ".cache"
for f in os.listdir(cache_dir):
shutil.rmtree(cache_dir / f)