Skip to content

Commit bf6f55e

Browse files
BLD: Remove use of | union operators in singledispatch methods for python 3.10 compatibility
1 parent 90654ce commit bf6f55e

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requires = ["setuptools >= 77.0.3"]
1111
# ----------------
1212
[project]
1313
name = "psi-pyvisual"
14-
version = "1.0.1"
14+
version = "1.0.2"
1515
description = "3D Visualization Tools for Solar Physics"
1616
authors = [
1717
{name = "Predictive Science Inc.", email = "webmaster@predsci.com"},

pyvisual/core/mesh3d.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,10 @@ def _dispatch_input(self,
899899
msg = f"Unsupported input type: {type(uinput)}"
900900
raise NotImplementedError(msg)
901901

902-
@_dispatch_input.register
902+
@_dispatch_input.register(str)
903+
@_dispatch_input.register(Path)
903904
def _(self,
904-
uinput: str | Path,
905+
uinput,
905906
*args,
906907
data,
907908
dataid,
@@ -912,9 +913,10 @@ def _(self,
912913
file_data, *scales = read_hdf_by_index(ifile, *args, dataset_id=dataid, return_scales=True)
913914
return self._parse_input(iformat, file_data if data is None else data, *scales, **kwargs)
914915

915-
@_dispatch_input.register
916+
@_dispatch_input.register(Iterable)
917+
@_dispatch_input.register(Number)
916918
def _(self,
917-
uinput: Iterable | Number,
919+
uinput,
918920
*args,
919921
data,
920922
iformat,

0 commit comments

Comments
 (0)