Skip to content

Commit df86cc5

Browse files
authored
v1.7.1 : Bugfix trimmed z-vector (#294)
* Fix vector-domain-seasurface * Update workflows
1 parent bd515ba commit df86cc5

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

.github/workflows/linkcheck.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020

2121
steps:
2222

23-
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
23+
# Cancel any previous run of the test job; [pin v0.10.0 (2022-06-27)]
2424
- name: Cancel Previous Runs
25-
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
25+
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7
2626
with:
2727
access_token: ${{ github.token }}
2828

.github/workflows/linux.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ jobs:
6767

6868
steps:
6969

70-
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
70+
# Cancel any previous run of the test job; [pin v0.10.0 (2022-06-27)]
7171
- name: Cancel Previous Runs
72-
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
72+
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7
7373
with:
7474
access_token: ${{ github.token }}
7575

@@ -109,8 +109,7 @@ jobs:
109109
conda config --set always_yes yes --set changeps1 no
110110
conda config --show-sources
111111
conda config --show
112-
conda install ${{ matrix.case.conda }} pytest pytest-cov pytest-console-scripts pip
113-
pip install setuptools_scm coveralls pytest-flake8
112+
conda install ${{ matrix.case.conda }} pytest pytest-cov pytest-console-scripts coveralls pytest-flake8 setuptools_scm
114113
conda info -a
115114
conda list
116115
@@ -166,7 +165,7 @@ jobs:
166165
- name: Setup Python
167166
uses: actions/setup-python@v2
168167
with:
169-
python-version: "3.8"
168+
python-version: "3.9"
170169

171170
- name: Install dependencies
172171
run: |

.github/workflows/macos_windows.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434

3535
steps:
3636

37-
# Cancel any previous run of the test job; [pin v0.8.0 (2021-02-13)]
37+
# Cancel any previous run of the test job; [pin v0.10.0 (2022-06-27)]
3838
- name: Cancel Previous Runs
39-
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d
39+
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7
4040
with:
4141
access_token: ${{ github.token }}
4242

@@ -66,7 +66,7 @@ jobs:
6666
python-version: ${{ matrix.python }}
6767
miniforge-variant: Mambaforge
6868
use-mamba: true
69-
# The following should not be necessary with Mambaforg(?).
69+
# The following should not be necessary with Mambaforge(?).
7070
channels: conda-forge,defaults
7171
channel-priority: strict
7272

@@ -76,8 +76,7 @@ jobs:
7676
conda config --set always_yes yes --set changeps1 no
7777
conda config --show-sources
7878
conda config --show
79-
conda install numba scipy pytest pytest-console-scripts pip
80-
pip install setuptools_scm pytest-flake8
79+
conda install numba scipy pytest pytest-console-scripts pytest-flake8 scooby setuptools_scm
8180
conda info -a
8281
conda list
8382

CHANGELOG.rst

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ Changelog
66
""""""""""
77

88

9+
v1.7.1 : Bugfix trimmed z-vector
10+
--------------------------------
11+
12+
- Meshing: Small fix to the automatic gridding from v1.5.0 (non-backwards
13+
compatible). A provided z-vector is new trimmed to the domain before the
14+
domain might be expanded due to the provided seasurface (which is as it was
15+
always intended, but not as it was implemented).
16+
- Few small maintenance things in the meta files.
17+
18+
919
v1.7.0 : CLI-clean
1020
------------------
1121

emg3d/meshes.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -671,16 +671,6 @@ def origin_and_widths(frequency, properties, center, domain=None, vector=None,
671671
"At least one of `domain`/`distance`/`vector` must be provided."
672672
)
673673

674-
# Check seasurface.
675-
if seasurface is not None:
676-
677-
# Check that seasurface > center.
678-
if seasurface <= center:
679-
raise ValueError("The `seasurface` must be bigger than `center`.")
680-
681-
# Expand domain to include seasurface if necessary.
682-
domain[1] = max(domain[1], seasurface)
683-
684674
# Check vector if provided
685675
if vector is not None:
686676

@@ -697,6 +687,16 @@ def origin_and_widths(frequency, properties, center, domain=None, vector=None,
697687
if len(vector) < 3:
698688
vector = None
699689

690+
# Check seasurface.
691+
if seasurface is not None:
692+
693+
# Check that seasurface > center.
694+
if seasurface <= center:
695+
raise ValueError("The `seasurface` must be bigger than `center`.")
696+
697+
# Expand domain to include seasurface if necessary.
698+
domain[1] = max(domain[1], seasurface)
699+
700700
# If center_on_edge and no vector, we create a vector.
701701
if vector is None and center_on_edge:
702702
vector = np.r_[center-dmin, center, center+dmin]

0 commit comments

Comments
 (0)