Skip to content

Commit 018b211

Browse files
committed
linting
1 parent 22025bf commit 018b211

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/atomate2/abinit/schemas/outfiles.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import base64
44
import os
55
from pathlib import Path
6+
from typing import Optional, Union
67

78
from monty.json import MSONable
89
from typing_extensions import Self
@@ -11,7 +12,9 @@
1112
class AbinitStoredFile(MSONable):
1213
"""Wrap a file to store its raw data."""
1314

14-
def __init__(self, data: str | bytes, source_filepath: str | Path) -> None:
15+
def __init__(
16+
self, data: Union[str, bytes], source_filepath: Union[str, Path]
17+
) -> None:
1518
self.data = data
1619
self.source_filepath = source_filepath
1720

@@ -39,7 +42,7 @@ def from_dict(cls, d: dict) -> Self:
3942
return cls(data=data, source_filepath=d["source_filepath"])
4043

4144
@classmethod
42-
def from_file(cls, filepath: str | Path, data_type: str | type) -> Self:
45+
def from_file(cls, filepath: Union[str, Path], data_type: Union[str, type]) -> Self:
4346
"""Create an AbinitStoredFile from the original file."""
4447
source_filepath = os.path.abspath(filepath)
4548
if data_type in {"bytes", bytes}:
@@ -68,7 +71,7 @@ def extension(self) -> str:
6871
"""Return the extension of the source file."""
6972
return str(self.source_filepath).split("_")[-1]
7073

71-
def write(self, filepath: str | Path = None) -> None:
74+
def write(self, filepath: Optional[Union[str, Path]] = None) -> None:
7275
"""Write the data into a file."""
7376
filepath = filepath or self.filename
7477
if self.data_type == "bytes":

0 commit comments

Comments
 (0)