Skip to content

Commit 8514b6e

Browse files
committed
wrap PathLike in str
python/mypy#5667
1 parent 7c15407 commit 8514b6e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/xtal2png/skeleton.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def __init__(
102102
space_group_range: Tuple[int, int] = (1, 230),
103103
distance_range: Tuple[float, float] = (0.0, 25.0),
104104
max_sites: int = 52,
105-
save_dir: Union[str, PathLike[str]] = path.join("data", "preprocessed"),
105+
save_dir: Union[str, "PathLike[str]"] = path.join("data", "preprocessed"),
106106
):
107107
"""Instantiate an XtalConverter object with desired ranges and ``max_sites``.
108108
@@ -124,7 +124,7 @@ def __init__(
124124
Expected range for pairwise distances between sites, by default (0.0, 25.0)
125125
max_sites : int, optional
126126
Maximum number of sites to accomodate in encoding, by default 52
127-
save_dir : Union[str, PathLike[str]]
127+
save_dir : Union[str, 'PathLike[str]']
128128
Directory to save PNG files via ``func:xtal2png``,
129129
by default path.join("data", "interim")
130130
"""
@@ -140,7 +140,7 @@ def __init__(
140140

141141
def xtal2png(
142142
self,
143-
structures: List[Union[Structure, str, PathLike[str]]],
143+
structures: List[Union[Structure, str, "PathLike[str]"]],
144144
show: bool = False,
145145
save: bool = True,
146146
):
@@ -245,12 +245,14 @@ def process_filepaths_or_structures(self, structures):
245245

246246
return save_names, S
247247

248-
def png2xtal(self, images: List[Union[Image.Image, PathLike]], save: bool = False):
248+
def png2xtal(
249+
self, images: List[Union[Image.Image, "PathLike"]], save: bool = False
250+
):
249251
"""_summary_
250252
251253
Parameters
252254
----------
253-
images : List[Union[Image.Image, PathLike]]
255+
images : List[Union[Image.Image, 'PathLike']]
254256
PIL images that (approximately) encode crystal structures.
255257
256258
Examples

0 commit comments

Comments
 (0)