Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed Mar 29, 2024
1 parent 1b5f690 commit 46cd513
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/yadg/extractors/public/agilent/dx.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def extract(
with tempfile.TemporaryDirectory() as tempdir:
zf.extractall(tempdir)
dt = None
for ffn in sorted(os.listdir(tempdir)):
if ffn.endswith("CH"):
path = os.path.join(tempdir, ffn)
fdt = extract_ch(fn=path, timezone=timezone, **kwargs).to_dict()
dt = merge_dicttrees(dt, fdt, "identical")
filenames = [ffn for ffn in os.listdir(tempdir) if ffn.endswith("CH")]
for ffn in sorted(filenames):
path = os.path.join(tempdir, ffn)
fdt = extract_ch(fn=path, timezone=timezone, **kwargs)
dt = merge_dicttrees(dt, fdt.to_dict(), "identical")
return DataTree.from_dict(dt)
11 changes: 6 additions & 5 deletions src/yadg/extractors/public/fusion/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ def extract(
*,
fn: str,
timezone: str,
encoding: str,
**kwargs: dict,
) -> DataTree:
zf = zipfile.ZipFile(fn)
with tempfile.TemporaryDirectory() as tempdir:
zf.extractall(tempdir)
dt = None
for ffn in sorted(os.listdir(tempdir)):
if ffn.endswith("fusion-data"):
path = os.path.join(tempdir, ffn)
fdt = extract_json(fn=path, timezone=timezone, **kwargs).to_dict()
dt = merge_dicttrees(dt, fdt, "identical")
filenames = [ffn for ffn in os.listdir(tempdir) if ffn.endswith("fusion-data")]
for ffn in sorted(filenames):
path = os.path.join(tempdir, ffn)
fdt = extract_json(fn=path, timezone=timezone, encoding=encoding, **kwargs)
dt = merge_dicttrees(dt, fdt.to_dict(), "identical")
return DataTree.from_dict(dt)

0 comments on commit 46cd513

Please sign in to comment.