From 79fba4e9e324476b10c2294460e5c1c14e4b3624 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 24 Jul 2024 12:13:41 +0100 Subject: [PATCH] Fix ruff issues --- src/epyscan/__init__.py | 2 +- tests/test_epyscan.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/epyscan/__init__.py b/src/epyscan/__init__.py index 5b8acbe..f8a0341 100644 --- a/src/epyscan/__init__.py +++ b/src/epyscan/__init__.py @@ -83,7 +83,7 @@ def setup_case(self, sample: dict): full_sample = epydeck.deep_update(self.template, expanded_sample_dict) path = rundir_hierarchy(self.root, self._counter) - with open(path / "input.deck", "w") as f: + with (path / "input.deck").open("w") as f: epydeck.dump(full_sample, f) self._counter += 1 diff --git a/tests/test_epyscan.py b/tests/test_epyscan.py index edd54de..77d75a0 100644 --- a/tests/test_epyscan.py +++ b/tests/test_epyscan.py @@ -1,7 +1,5 @@ -import epyscan import epydeck - -import numpy as np +import epyscan def test_make_run_dirs(tmp_path): @@ -107,7 +105,7 @@ def test_campaign(tmp_path): "other_block": {"var4": True}, } - with open(base_path / "run_4" / "input.deck") as f: + with (base_path / "run_4" / "input.deck").open() as f: actual_case_deck = epydeck.load(f) assert actual_case_deck == expected_case_deck