Skip to content

Commit

Permalink
[telemac] addressed reviews and added info in README
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed May 20, 2024
1 parent e70b8f0 commit 11189fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Thalassa is currently supporting visualization of the output of the following so

- [Schism](https://github.com/schism-dev/schism)
- [ADCIRC](https://adcirc.org/)
- [openTELEMAC](https://www.opentelemac.org/)

Adding support for new solvers is relatively straight-forward.

Expand All @@ -30,6 +31,10 @@ Adding support for new solvers is relatively straight-forward.
```
pip install thalassa
```
for Selafin files (openTELEMAC outputs):
```
pip install thalassa[selafin]
```

### Conda

Expand Down
14 changes: 9 additions & 5 deletions tests/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
pytest.param(SELAFIN, "S"),
],
)


def test_main_api(file, variable):
ds = api.open_dataset(file)
assert normalization.is_generic(ds)
Expand All @@ -42,9 +40,15 @@ def test_main_api(file, variable):
hv.render(pointer_ts, backend="bokeh")


@pytest.mark.parametrize("variable", [None, "zeta"])
def test_create_trimesh(variable):
ds = api.open_dataset(ADCIRC_NC)
@pytest.mark.parametrize(
"file,variable",
[
pytest.param(ADCIRC_NC, "zeta"),
pytest.param(SELAFIN, "S"),
],
)
def test_create_trimesh(file, variable):
ds = api.open_dataset(file)
trimesh = api.create_trimesh(ds, variable=variable)
assert isinstance(trimesh, gv.TriMesh)

Expand Down
3 changes: 1 addition & 2 deletions thalassa/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def is_adcirc(ds: xarray.Dataset) -> bool:
def infer_format(ds: xarray.Dataset) -> THALASSA_FORMATS:
if is_schism(ds):
fmt = THALASSA_FORMATS.SCHISM
if is_telemac(ds):
elif is_telemac(ds):
fmt = THALASSA_FORMATS.TELEMAC
elif is_pyposeidon(ds):
fmt = THALASSA_FORMATS.PYPOSEIDON
Expand Down Expand Up @@ -176,7 +176,6 @@ def normalize_telemac(ds: xarray.Dataset) -> xarray.Dataset:
},
)
if "plan" in ds.dims:
# I.e. OLD Schism IO or "merged" new IO
ds = ds.rename(
{
"plan": VERTICAL_DIM,
Expand Down

0 comments on commit 11189fb

Please sign in to comment.