File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 3
3
from __future__ import annotations
4
4
5
5
import inspect
6
+ import pathlib
6
7
from typing import TYPE_CHECKING , Any , cast
7
8
from functools import partial
8
9
17
18
from regularizepsf .visualize import KERNEL_IMSHOW_ARGS_DEFAULT , PSF_IMSHOW_ARGS_DEFAULT , visualize_grid
18
19
19
20
if TYPE_CHECKING :
20
- import pathlib
21
21
from numbers import Real
22
22
from collections .abc import Callable
23
23
@@ -272,6 +272,7 @@ def save(self, path: pathlib.Path) -> None:
272
272
None
273
273
274
274
"""
275
+ path = pathlib .Path (path )
275
276
if path .suffix == ".h5" :
276
277
with h5py .File (path , "w" ) as f :
277
278
f .create_dataset ("coordinates" , data = self .coordinates )
@@ -302,6 +303,7 @@ def load(cls, path: pathlib.Path) -> ArrayPSF:
302
303
loaded model
303
304
304
305
"""
306
+ path = pathlib .Path (path )
305
307
if path .suffix == ".h5" :
306
308
with h5py .File (path , "r" ) as f :
307
309
coordinates = [tuple (c ) for c in f ["coordinates" ][:]]
Original file line number Diff line number Diff line change 2
2
3
3
from __future__ import annotations
4
4
5
+ import pathlib
5
6
from typing import TYPE_CHECKING
6
7
7
8
import h5py
15
16
from regularizepsf .visualize import KERNEL_IMSHOW_ARGS_DEFAULT , visualize_grid
16
17
17
18
if TYPE_CHECKING :
18
- import pathlib
19
19
20
20
from regularizepsf .psf import ArrayPSF
21
21
@@ -173,6 +173,7 @@ def save(self, path: pathlib.Path) -> None:
173
173
None
174
174
175
175
"""
176
+ path = pathlib .Path (path )
176
177
if path .suffix == ".h5" :
177
178
with h5py .File (path , "w" ) as f :
178
179
f .create_dataset ("coordinates" , data = self .coordinates )
@@ -201,6 +202,7 @@ def load(cls, path: pathlib.Path) -> ArrayPSFTransform:
201
202
PSFTransform
202
203
203
204
"""
205
+ path = pathlib .Path (path )
204
206
if path .suffix == ".h5" :
205
207
with h5py .File (path , "r" ) as f :
206
208
coordinates = [tuple (c ) for c in f ["coordinates" ][:]]
You can’t perform that action at this time.
0 commit comments