Skip to content

Commit

Permalink
fix(DatasetBuilder): typing adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley authored and johnkit committed Apr 30, 2024
1 parent d7db238 commit 0686dea
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pan3d/dataset_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DatasetBuilder:

def __init__(
self,
server: trame_server.core.Server = None,
server: typing.Union[trame_server.core.Server, str] = None,
dataset_path: str = None,
state: dict = None,
pangeo: bool = False,
Expand All @@ -47,13 +47,7 @@ def __init__(
pangeo: If true, use a list of example datasets from Pangeo Forge (examples/pangeo_catalog.json).
"""

if server is None:
server = get_server()

if isinstance(server, str):
server = get_server(server)

server.client_type = "vue3"
server = get_server(server, client_type="vue3")
self.server = server
self._layout = None
self._force_local_rendering = not has_gpu_rendering()
Expand Down Expand Up @@ -103,7 +97,10 @@ def data_array(self) -> xarray.core.dataarray.DataArray:
return self.algorithm.sliced_data_array

@property
def mesh(self) -> pyvista.core.grid.RectilinearGrid:
def mesh(self) -> typing.Union[
pyvista.core.grid.RectilinearGrid,
pyvista.core.grid.StructuredGrid,
]:
"""Returns the PyVista Mesh derived from the current data array."""
if self._mesh is None:
self._mesh = self.algorithm.mesh
Expand Down

0 comments on commit 0686dea

Please sign in to comment.