Skip to content

Commit

Permalink
Read Trim files with arbitrary number of layers (#35)
Browse files Browse the repository at this point in the history
Changes:

* Made _trim_to_faces_frame work with any number of layers
* Bump to version 0.5.2
  • Loading branch information
H0R5E authored Feb 24, 2022
1 parent e29f6d9 commit e1d5945
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "0.5.1" %}
{% set version = "0.5.2" %}

package:
name: snl-delft3d-cec-verify
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ From a conda prompt create a named environment in which to install the
for future updates:

```
(base) > conda create -y -n snld3d --override-channels -c conda-forge -c dataonlygreater snl-delft3d-cec-verify=0.5.1
(base) > conda create -y -n snld3d --override-channels -c conda-forge -c dataonlygreater snl-delft3d-cec-verify=0.5.2
(base) > conda activate snld3d
(snld3d) > conda config --env --add channels conda-forge --add channels dataonlygreater
(snld3d) > conda config --env --set channel_priority strict
Expand Down
4 changes: 2 additions & 2 deletions docs/_assets/gh-pages-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Redirecting to latest version</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./v0.5.1/index.html">
<link rel="canonical" href="https://data-only-greater.github.io/SNL-Delft3D-CEC-Verify/v0.5.1/index.html">
<meta http-equiv="refresh" content="0; url=./v0.5.2/index.html">
<link rel="canonical" href="https://data-only-greater.github.io/SNL-Delft3D-CEC-Verify/v0.5.2/index.html">
</head>
</html>
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = 'Mathew Topper'

# The full version, including alpha/beta/rc tags
release = '0.5.1'
release = '0.5.2'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -57,7 +57,7 @@
smv_remote_whitelist = r'^(origin)$'
smv_tag_whitelist = r'^v(\d+\.\d+\.\d+)$' # r'^v(?!0.4.0|0.4.1|0.4.2)\d+\.\d+\.\d+$'
smv_released_pattern = r'^refs/tags/.*$'
smv_latest_version = 'v0.5.1'
smv_latest_version = 'v0.5.2'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = SNL-Delft3D-CEC-Verify
version = 0.5.1
version = 0.5.2
author = Mathew Topper
author_email = [email protected]
description = Automated verification of SNL-Delft3D-CEC based on the 2014 Mycek experiment
Expand Down
10 changes: 6 additions & 4 deletions src/snl_d3d_cec_verify/result/faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,24 +641,26 @@ def _trim_to_faces_frame(trim_path: StrOrPath,
v1 = ds_step.V1.values
w = ds_step.W.values

n_layers = len(ik)

x = x[1:-1, 1:-1]
x = np.repeat(x[np.newaxis, :, :], 3, axis=0)
x = np.repeat(x[np.newaxis, :, :], n_layers, axis=0)

y = y[1:-1, 1:-1]
y = np.repeat(y[np.newaxis, :, :], 3, axis=0)
y = np.repeat(y[np.newaxis, :, :], n_layers, axis=0)

depth = dp0 + s1
z = depth[..., None] * sig_lyr
z = np.rollaxis(z, 2)
z = z[:, 1:-1, 1:-1]

ik = np.flip(ik).reshape(3, 1, 1)
ik = np.flip(ik).reshape(n_layers, 1, 1)
k = np.ones(x.shape, dtype=int) * ik

time = np.tile(time, x.shape)

depth = depth[1:-1, 1:-1]
depth = np.repeat(depth[np.newaxis, :, :], 3, axis=0)
depth = np.repeat(depth[np.newaxis, :, :], n_layers, axis=0)

u1 = u1[:, :-1, 1:-1]
u = np.nansum([u1[:, :-1, :], u1[:, 1:, :]], axis=0) / 2
Expand Down

0 comments on commit e1d5945

Please sign in to comment.