Skip to content

Commit c2711bb

Browse files
ci: :arrow-up: pre-commit autoupdate (#1707)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.3](astral-sh/ruff-pre-commit@v0.7.4...v0.8.3) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Anselm Hahn <[email protected]>
1 parent 9f47c97 commit c2711bb

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
args: ["--maxkb=1000"]
2020
exclude: \.ipynb
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.7.4
22+
rev: v0.8.3
2323
hooks:
2424
- id: ruff
2525
files: spectrafit/

spectrafit/plugins/pkl_visualizer.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ def save(self, data: Any, fname: Path, export_format: str) -> None:
111111
format=export_format,
112112
)
113113

114-
with pure_fname(fname).with_suffix(".json").open(
115-
"w+", encoding="utf-8"
116-
) as outfile:
114+
with (
115+
pure_fname(fname)
116+
.with_suffix(".json")
117+
.open("w+", encoding="utf-8") as outfile
118+
):
117119
json.dump(data, outfile, indent=4)
118120

119121
def get_type(self, value: Any) -> Union[Dict[str, Any], str]:

spectrafit/plugins/rixs_converter.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,23 @@ def save(self, data: Any, fname: Path, export_format: str) -> None:
179179
)
180180

181181
if export_format == "json":
182-
with pure_fname(fname).with_suffix(f".{export_format}").open(
183-
"w",
184-
encoding="utf-8",
185-
) as f:
182+
with (
183+
pure_fname(fname)
184+
.with_suffix(f".{export_format}")
185+
.open(
186+
"w",
187+
encoding="utf-8",
188+
) as f
189+
):
186190
json.dump(self.numpydict2listdict(data), f, indent=4)
187191
elif export_format in {"toml", "lock"}:
188-
with pure_fname(fname).with_suffix(f".{export_format}").open(
189-
"wb",
190-
) as f:
192+
with (
193+
pure_fname(fname)
194+
.with_suffix(f".{export_format}")
195+
.open(
196+
"wb",
197+
) as f
198+
):
191199
tomli_w.dump(self.numpydict2listdict(data), f, multiline_strings=False)
192200
elif export_format == "npy":
193201
np.save(pure_fname(fname).with_suffix(f".{export_format}"), data)

0 commit comments

Comments
 (0)