earthsciencekit 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. earthsciencekit/__init__.py +6 -0
  2. earthsciencekit/_validation.py +62 -0
  3. earthsciencekit/atmosphere/__init__.py +57 -0
  4. earthsciencekit/atmosphere/core/__init__.py +5 -0
  5. earthsciencekit/atmosphere/core/base.py +10 -0
  6. earthsciencekit/atmosphere/systems/__init__.py +1 -0
  7. earthsciencekit/atmosphere/systems/dynamics.py +208 -0
  8. earthsciencekit/atmosphere/systems/hydrostatics.py +214 -0
  9. earthsciencekit/atmosphere/systems/moisture.py +162 -0
  10. earthsciencekit/atmosphere/systems/thermodynamics.py +222 -0
  11. earthsciencekit/atmosphere/tests/__init__.py +0 -0
  12. earthsciencekit/atmosphere/tests/test_models.py +741 -0
  13. earthsciencekit/atmosphere/tests/test_physics.py +81 -0
  14. earthsciencekit/atmosphere/visualizers/__init__.py +9 -0
  15. earthsciencekit/climate/__init__.py +63 -0
  16. earthsciencekit/climate/core/__init__.py +5 -0
  17. earthsciencekit/climate/core/base.py +10 -0
  18. earthsciencekit/climate/systems/__init__.py +1 -0
  19. earthsciencekit/climate/systems/carbon.py +76 -0
  20. earthsciencekit/climate/systems/forcing.py +124 -0
  21. earthsciencekit/climate/systems/radiation.py +214 -0
  22. earthsciencekit/climate/systems/response.py +402 -0
  23. earthsciencekit/climate/systems/sea_level.py +77 -0
  24. earthsciencekit/climate/tests/__init__.py +0 -0
  25. earthsciencekit/climate/tests/test_models.py +1015 -0
  26. earthsciencekit/climate/tests/test_physics.py +16 -0
  27. earthsciencekit/climate/visualizers/__init__.py +9 -0
  28. earthsciencekit/constants/__init__.py +23 -0
  29. earthsciencekit/geophysics/__init__.py +77 -0
  30. earthsciencekit/geophysics/core/__init__.py +5 -0
  31. earthsciencekit/geophysics/core/base.py +10 -0
  32. earthsciencekit/geophysics/systems/__init__.py +1 -0
  33. earthsciencekit/geophysics/systems/deformation.py +161 -0
  34. earthsciencekit/geophysics/systems/dynamo.py +159 -0
  35. earthsciencekit/geophysics/systems/figure.py +292 -0
  36. earthsciencekit/geophysics/systems/gravity.py +235 -0
  37. earthsciencekit/geophysics/systems/magnetism.py +354 -0
  38. earthsciencekit/geophysics/tests/__init__.py +0 -0
  39. earthsciencekit/geophysics/tests/test_models.py +898 -0
  40. earthsciencekit/geophysics/tests/test_physics.py +171 -0
  41. earthsciencekit/geophysics/visualizers/__init__.py +9 -0
  42. earthsciencekit/integrators/__init__.py +62 -0
  43. earthsciencekit/oceanography/__init__.py +61 -0
  44. earthsciencekit/oceanography/core/__init__.py +5 -0
  45. earthsciencekit/oceanography/core/base.py +10 -0
  46. earthsciencekit/oceanography/systems/__init__.py +1 -0
  47. earthsciencekit/oceanography/systems/circulation.py +388 -0
  48. earthsciencekit/oceanography/systems/hydrography.py +212 -0
  49. earthsciencekit/oceanography/systems/inertial.py +86 -0
  50. earthsciencekit/oceanography/systems/waves.py +281 -0
  51. earthsciencekit/oceanography/tests/__init__.py +0 -0
  52. earthsciencekit/oceanography/tests/test_models.py +916 -0
  53. earthsciencekit/oceanography/tests/test_physics.py +102 -0
  54. earthsciencekit/oceanography/visualizers/__init__.py +9 -0
  55. earthsciencekit/plate_tectonics/__init__.py +59 -0
  56. earthsciencekit/plate_tectonics/core/__init__.py +5 -0
  57. earthsciencekit/plate_tectonics/core/base.py +10 -0
  58. earthsciencekit/plate_tectonics/systems/__init__.py +1 -0
  59. earthsciencekit/plate_tectonics/systems/boundaries.py +201 -0
  60. earthsciencekit/plate_tectonics/systems/cooling.py +238 -0
  61. earthsciencekit/plate_tectonics/systems/isostasy.py +157 -0
  62. earthsciencekit/plate_tectonics/systems/kinematics.py +290 -0
  63. earthsciencekit/plate_tectonics/tests/__init__.py +0 -0
  64. earthsciencekit/plate_tectonics/tests/test_models.py +920 -0
  65. earthsciencekit/plate_tectonics/tests/test_physics.py +94 -0
  66. earthsciencekit/plate_tectonics/visualizers/__init__.py +9 -0
  67. earthsciencekit/py.typed +0 -0
  68. earthsciencekit/results.py +73 -0
  69. earthsciencekit/seismology/__init__.py +59 -0
  70. earthsciencekit/seismology/core/__init__.py +5 -0
  71. earthsciencekit/seismology/core/base.py +10 -0
  72. earthsciencekit/seismology/systems/__init__.py +1 -0
  73. earthsciencekit/seismology/systems/interfaces.py +102 -0
  74. earthsciencekit/seismology/systems/rays.py +221 -0
  75. earthsciencekit/seismology/systems/sources.py +249 -0
  76. earthsciencekit/seismology/systems/waves.py +268 -0
  77. earthsciencekit/seismology/tests/__init__.py +0 -0
  78. earthsciencekit/seismology/tests/test_models.py +852 -0
  79. earthsciencekit/seismology/tests/test_physics.py +100 -0
  80. earthsciencekit/seismology/visualizers/__init__.py +9 -0
  81. earthsciencekit/tests/__init__.py +0 -0
  82. earthsciencekit/tests/test_core.py +181 -0
  83. earthsciencekit/tests/test_relations.py +36 -0
  84. earthsciencekit/units/__init__.py +66 -0
  85. earthsciencekit/visualizers/__init__.py +45 -0
  86. earthsciencekit/volcanology/__init__.py +61 -0
  87. earthsciencekit/volcanology/core/__init__.py +5 -0
  88. earthsciencekit/volcanology/core/base.py +10 -0
  89. earthsciencekit/volcanology/systems/__init__.py +1 -0
  90. earthsciencekit/volcanology/systems/eruptions.py +161 -0
  91. earthsciencekit/volcanology/systems/geochemistry.py +226 -0
  92. earthsciencekit/volcanology/systems/geochronology.py +304 -0
  93. earthsciencekit/volcanology/systems/magma.py +190 -0
  94. earthsciencekit/volcanology/tests/__init__.py +0 -0
  95. earthsciencekit/volcanology/tests/test_models.py +485 -0
  96. earthsciencekit/volcanology/tests/test_physics.py +176 -0
  97. earthsciencekit/volcanology/visualizers/__init__.py +9 -0
  98. earthsciencekit-0.2.0.dist-info/METADATA +127 -0
  99. earthsciencekit-0.2.0.dist-info/RECORD +102 -0
  100. earthsciencekit-0.2.0.dist-info/WHEEL +5 -0
  101. earthsciencekit-0.2.0.dist-info/licenses/LICENSE +15 -0
  102. earthsciencekit-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,898 @@
1
+ """Golden checks and invalid-input contracts for every public model."""
2
+
3
+ import numpy as np
4
+ import pytest
5
+
6
+ from earthsciencekit import geophysics as domain
7
+
8
+
9
+ def test_sphere_gravity_reference():
10
+ result = domain.sphere_gravity(*[3, 4, 1, 447111334967.41797])
11
+ np.testing.assert_allclose(result, [-3, 4], rtol=1e-11, atol=1e-12)
12
+
13
+
14
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
15
+ def test_sphere_gravity_rejects_invalid(bad):
16
+ args = [3, 4, 1, 447111334967.41797]
17
+ args[0] = bad
18
+ with pytest.raises(ValueError):
19
+ domain.sphere_gravity(*args)
20
+
21
+
22
+ def test_sphere_gravity_broadcasting():
23
+ args = [3, 4, 1, 447111334967.41797]
24
+ reference = domain.sphere_gravity(*args)
25
+ args[0] = np.full((2, 1), args[0])
26
+ result = domain.sphere_gravity(*args)
27
+ assert result.shape == (2, 1, 2)
28
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
29
+
30
+
31
+ @pytest.mark.parametrize("index,value", [(2, 0)])
32
+ def test_sphere_gravity_physical_bound(index, value):
33
+ args = [3, 4, 1, 447111334967.41797]
34
+ args[index] = value
35
+ with pytest.raises(ValueError):
36
+ domain.sphere_gravity(*args)
37
+
38
+
39
+ def test_bouguer_correction_reference():
40
+ result = domain.bouguer_correction(*[2384593786.492896, 3])
41
+ np.testing.assert_allclose(result, 3, rtol=1e-11, atol=1e-12)
42
+
43
+
44
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
45
+ def test_bouguer_correction_rejects_invalid(bad):
46
+ args = [2384593786.492896, 3]
47
+ args[0] = bad
48
+ with pytest.raises(ValueError):
49
+ domain.bouguer_correction(*args)
50
+
51
+
52
+ def test_bouguer_correction_broadcasting():
53
+ args = [2384593786.492896, 3]
54
+ reference = domain.bouguer_correction(*args)
55
+ args[0] = np.full((2, 1), args[0])
56
+ result = domain.bouguer_correction(*args)
57
+ assert result.shape == (2, 1)
58
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
59
+
60
+
61
+ @pytest.mark.parametrize("index,value", [(0, 0)])
62
+ def test_bouguer_correction_physical_bound(index, value):
63
+ args = [2384593786.492896, 3]
64
+ args[index] = value
65
+ with pytest.raises(ValueError):
66
+ domain.bouguer_correction(*args)
67
+
68
+
69
+ def test_free_air_correction_reference():
70
+ result = domain.free_air_correction(*[100, 9.8, 6400000])
71
+ np.testing.assert_allclose(result, 2 * 9.8 * 100 / 6.4e6, rtol=1e-11, atol=1e-12)
72
+
73
+
74
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
75
+ def test_free_air_correction_rejects_invalid(bad):
76
+ args = [100, 9.8, 6400000]
77
+ args[0] = bad
78
+ with pytest.raises(ValueError):
79
+ domain.free_air_correction(*args)
80
+
81
+
82
+ def test_free_air_correction_broadcasting():
83
+ args = [100, 9.8, 6400000]
84
+ reference = domain.free_air_correction(*args)
85
+ args[0] = np.full((2, 1), args[0])
86
+ result = domain.free_air_correction(*args)
87
+ assert result.shape == (2, 1)
88
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
89
+
90
+
91
+ @pytest.mark.parametrize("index,value", [(1, 0), (2, 0)])
92
+ def test_free_air_correction_physical_bound(index, value):
93
+ args = [100, 9.8, 6400000]
94
+ args[index] = value
95
+ with pytest.raises(ValueError):
96
+ domain.free_air_correction(*args)
97
+
98
+
99
+ def test_bouguer_anomaly_reference():
100
+ result = domain.bouguer_anomaly(*[9.81, 9.8, 100, 2384.5937864928956, 6400000])
101
+ np.testing.assert_allclose(result, 0.01 + 3.0625e-4 - 1e-4, rtol=1e-11, atol=1e-12)
102
+
103
+
104
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
105
+ def test_bouguer_anomaly_rejects_invalid(bad):
106
+ args = [9.81, 9.8, 100, 2384.5937864928956, 6400000]
107
+ args[0] = bad
108
+ with pytest.raises(ValueError):
109
+ domain.bouguer_anomaly(*args)
110
+
111
+
112
+ def test_bouguer_anomaly_broadcasting():
113
+ args = [9.81, 9.8, 100, 2384.5937864928956, 6400000]
114
+ reference = domain.bouguer_anomaly(*args)
115
+ args[0] = np.full((2, 1), args[0])
116
+ result = domain.bouguer_anomaly(*args)
117
+ assert result.shape == (2, 1)
118
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
119
+
120
+
121
+ @pytest.mark.parametrize("index,value", [(0, 0), (1, 0), (3, 0), (4, 0)])
122
+ def test_bouguer_anomaly_physical_bound(index, value):
123
+ args = [9.81, 9.8, 100, 2384.5937864928956, 6400000]
124
+ args[index] = value
125
+ with pytest.raises(ValueError):
126
+ domain.bouguer_anomaly(*args)
127
+
128
+
129
+ def test_torsion_balance_gravitational_constant_reference():
130
+ result = domain.torsion_balance_gravitational_constant(*[1, 2, 3, 4, 5])
131
+ np.testing.assert_allclose(result, 0.24 * np.pi**2, rtol=1e-11, atol=1e-12)
132
+
133
+
134
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
135
+ def test_torsion_balance_gravitational_constant_rejects_invalid(bad):
136
+ args = [1, 2, 3, 4, 5]
137
+ args[0] = bad
138
+ with pytest.raises(ValueError):
139
+ domain.torsion_balance_gravitational_constant(*args)
140
+
141
+
142
+ def test_torsion_balance_gravitational_constant_broadcasting():
143
+ args = [1, 2, 3, 4, 5]
144
+ reference = domain.torsion_balance_gravitational_constant(*args)
145
+ args[0] = np.full((2, 1), args[0])
146
+ result = domain.torsion_balance_gravitational_constant(*args)
147
+ assert result.shape == (2, 1)
148
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
149
+
150
+
151
+ @pytest.mark.parametrize("index,value", [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0)])
152
+ def test_torsion_balance_gravitational_constant_physical_bound(index, value):
153
+ args = [1, 2, 3, 4, 5]
154
+ args[index] = value
155
+ with pytest.raises(ValueError):
156
+ domain.torsion_balance_gravitational_constant(*args)
157
+
158
+
159
+ def test_earth_mean_density_reference():
160
+ result = domain.earth_mean_density(*[12.566370614359172, 3, 1])
161
+ np.testing.assert_allclose(result, 1, rtol=1e-11, atol=1e-12)
162
+
163
+
164
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
165
+ def test_earth_mean_density_rejects_invalid(bad):
166
+ args = [12.566370614359172, 3, 1]
167
+ args[0] = bad
168
+ with pytest.raises(ValueError):
169
+ domain.earth_mean_density(*args)
170
+
171
+
172
+ def test_earth_mean_density_broadcasting():
173
+ args = [12.566370614359172, 3, 1]
174
+ reference = domain.earth_mean_density(*args)
175
+ args[0] = np.full((2, 1), args[0])
176
+ result = domain.earth_mean_density(*args)
177
+ assert result.shape == (2, 1)
178
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
179
+
180
+
181
+ @pytest.mark.parametrize("index,value", [(0, 0), (1, 0), (2, 0)])
182
+ def test_earth_mean_density_physical_bound(index, value):
183
+ args = [12.566370614359172, 3, 1]
184
+ args[index] = value
185
+ with pytest.raises(ValueError):
186
+ domain.earth_mean_density(*args)
187
+
188
+
189
+ def test_centrifugal_ratio_reference():
190
+ result = domain.centrifugal_ratio(*[2, 3, 4])
191
+ np.testing.assert_allclose(result, 3, rtol=1e-11, atol=1e-12)
192
+
193
+
194
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
195
+ def test_centrifugal_ratio_rejects_invalid(bad):
196
+ args = [2, 3, 4]
197
+ args[0] = bad
198
+ with pytest.raises(ValueError):
199
+ domain.centrifugal_ratio(*args)
200
+
201
+
202
+ def test_centrifugal_ratio_broadcasting():
203
+ args = [2, 3, 4]
204
+ reference = domain.centrifugal_ratio(*args)
205
+ args[0] = np.full((2, 1), args[0])
206
+ result = domain.centrifugal_ratio(*args)
207
+ assert result.shape == (2, 1)
208
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
209
+
210
+
211
+ @pytest.mark.parametrize("index,value", [(0, -1), (1, 0), (2, 0)])
212
+ def test_centrifugal_ratio_physical_bound(index, value):
213
+ args = [2, 3, 4]
214
+ args[index] = value
215
+ with pytest.raises(ValueError):
216
+ domain.centrifugal_ratio(*args)
217
+
218
+
219
+ def test_homogeneous_flattening_reference():
220
+ result = domain.homogeneous_flattening(*[0.08])
221
+ np.testing.assert_allclose(result, 0.1, rtol=1e-11, atol=1e-12)
222
+
223
+
224
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
225
+ def test_homogeneous_flattening_rejects_invalid(bad):
226
+ args = [0.08]
227
+ args[0] = bad
228
+ with pytest.raises(ValueError):
229
+ domain.homogeneous_flattening(*args)
230
+
231
+
232
+ def test_homogeneous_flattening_broadcasting():
233
+ args = [0.08]
234
+ reference = domain.homogeneous_flattening(*args)
235
+ args[0] = np.full((2, 1), args[0])
236
+ result = domain.homogeneous_flattening(*args)
237
+ assert result.shape == (2, 1)
238
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
239
+
240
+
241
+ @pytest.mark.parametrize("index,value", [(0, -0.01), (0, 0.2)])
242
+ def test_homogeneous_flattening_physical_bound(index, value):
243
+ args = [0.08]
244
+ args[index] = value
245
+ with pytest.raises(ValueError):
246
+ domain.homogeneous_flattening(*args)
247
+
248
+
249
+ def test_clairaut_gravity_reference():
250
+ result = domain.clairaut_gravity(*[0.5235987755982988, 10, 0.003, 0.004])
251
+ np.testing.assert_allclose(result, 10.0175, rtol=1e-11, atol=1e-12)
252
+
253
+
254
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
255
+ def test_clairaut_gravity_rejects_invalid(bad):
256
+ args = [0.5235987755982988, 10, 0.003, 0.004]
257
+ args[0] = bad
258
+ with pytest.raises(ValueError):
259
+ domain.clairaut_gravity(*args)
260
+
261
+
262
+ def test_clairaut_gravity_broadcasting():
263
+ args = [0.5235987755982988, 10, 0.003, 0.004]
264
+ reference = domain.clairaut_gravity(*args)
265
+ args[0] = np.full((2, 1), args[0])
266
+ result = domain.clairaut_gravity(*args)
267
+ assert result.shape == (2, 1)
268
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
269
+
270
+
271
+ @pytest.mark.parametrize("index,value", [(0, 2), (1, 0), (2, -0.1), (2, 1), (3, -1)])
272
+ def test_clairaut_gravity_physical_bound(index, value):
273
+ args = [0.5235987755982988, 10, 0.003, 0.004]
274
+ args[index] = value
275
+ with pytest.raises(ValueError):
276
+ domain.clairaut_gravity(*args)
277
+
278
+
279
+ def test_normal_gravity_reference():
280
+ result = domain.normal_gravity(*[1.5707963267948966])
281
+ np.testing.assert_allclose(result, 9.8321863685, rtol=1e-11, atol=1e-12)
282
+
283
+
284
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
285
+ def test_normal_gravity_rejects_invalid(bad):
286
+ args = [1.5707963267948966]
287
+ args[0] = bad
288
+ with pytest.raises(ValueError):
289
+ domain.normal_gravity(*args)
290
+
291
+
292
+ def test_normal_gravity_broadcasting():
293
+ args = [1.5707963267948966]
294
+ reference = domain.normal_gravity(*args)
295
+ args[0] = np.full((2, 1), args[0])
296
+ result = domain.normal_gravity(*args)
297
+ assert result.shape == (2, 1)
298
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
299
+
300
+
301
+ @pytest.mark.parametrize("index,value", [(0, 2), (0, -2)])
302
+ def test_normal_gravity_physical_bound(index, value):
303
+ args = [1.5707963267948966]
304
+ args[index] = value
305
+ with pytest.raises(ValueError):
306
+ domain.normal_gravity(*args)
307
+
308
+
309
+ def test_flattening_from_j2_reference():
310
+ result = domain.flattening_from_j2(*[0.002, 0.004])
311
+ np.testing.assert_allclose(result, 0.005, rtol=1e-11, atol=1e-12)
312
+
313
+
314
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
315
+ def test_flattening_from_j2_rejects_invalid(bad):
316
+ args = [0.002, 0.004]
317
+ args[0] = bad
318
+ with pytest.raises(ValueError):
319
+ domain.flattening_from_j2(*args)
320
+
321
+
322
+ def test_flattening_from_j2_broadcasting():
323
+ args = [0.002, 0.004]
324
+ reference = domain.flattening_from_j2(*args)
325
+ args[0] = np.full((2, 1), args[0])
326
+ result = domain.flattening_from_j2(*args)
327
+ assert result.shape == (2, 1)
328
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
329
+
330
+
331
+ @pytest.mark.parametrize("index,value", [(1, -1)])
332
+ def test_flattening_from_j2_physical_bound(index, value):
333
+ args = [0.002, 0.004]
334
+ args[index] = value
335
+ with pytest.raises(ValueError):
336
+ domain.flattening_from_j2(*args)
337
+
338
+
339
+ def test_nodal_precession_rate_reference():
340
+ result = domain.nodal_precession_rate(*[2, 0, 0, 1, 1, 8])
341
+ np.testing.assert_allclose(result, -0.375, rtol=1e-11, atol=1e-12)
342
+
343
+
344
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
345
+ def test_nodal_precession_rate_rejects_invalid(bad):
346
+ args = [2, 0, 0, 1, 1, 8]
347
+ args[0] = bad
348
+ with pytest.raises(ValueError):
349
+ domain.nodal_precession_rate(*args)
350
+
351
+
352
+ def test_nodal_precession_rate_broadcasting():
353
+ args = [2, 0, 0, 1, 1, 8]
354
+ reference = domain.nodal_precession_rate(*args)
355
+ args[0] = np.full((2, 1), args[0])
356
+ result = domain.nodal_precession_rate(*args)
357
+ assert result.shape == (2, 1)
358
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
359
+
360
+
361
+ @pytest.mark.parametrize("index,value", [(0, 0), (1, -0.1), (1, 1), (2, -1), (2, 4), (4, 0), (5, 0)])
362
+ def test_nodal_precession_rate_physical_bound(index, value):
363
+ args = [2, 0, 0, 1, 1, 8]
364
+ args[index] = value
365
+ with pytest.raises(ValueError):
366
+ domain.nodal_precession_rate(*args)
367
+
368
+
369
+ def test_stokes_function_reference():
370
+ result = domain.stokes_function(*[3.141592653589793])
371
+ np.testing.assert_allclose(result, 1 + 3 * np.log(2), rtol=1e-11, atol=1e-12)
372
+
373
+
374
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
375
+ def test_stokes_function_rejects_invalid(bad):
376
+ args = [3.141592653589793]
377
+ args[0] = bad
378
+ with pytest.raises(ValueError):
379
+ domain.stokes_function(*args)
380
+
381
+
382
+ def test_stokes_function_broadcasting():
383
+ args = [3.141592653589793]
384
+ reference = domain.stokes_function(*args)
385
+ args[0] = np.full((2, 1), args[0])
386
+ result = domain.stokes_function(*args)
387
+ assert result.shape == (2, 1)
388
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
389
+
390
+
391
+ @pytest.mark.parametrize("index,value", [(0, 0), (0, 4)])
392
+ def test_stokes_function_physical_bound(index, value):
393
+ args = [3.141592653589793]
394
+ args[index] = value
395
+ with pytest.raises(ValueError):
396
+ domain.stokes_function(*args)
397
+
398
+
399
+ def test_degree_geoid_height_reference():
400
+ result = domain.degree_geoid_height(*[6, 4, 2, 4])
401
+ np.testing.assert_allclose(result, 1, rtol=1e-11, atol=1e-12)
402
+
403
+
404
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
405
+ def test_degree_geoid_height_rejects_invalid(bad):
406
+ args = [6, 4, 2, 4]
407
+ args[0] = bad
408
+ with pytest.raises(ValueError):
409
+ domain.degree_geoid_height(*args)
410
+
411
+
412
+ def test_degree_geoid_height_broadcasting():
413
+ args = [6, 4, 2, 4]
414
+ reference = domain.degree_geoid_height(*args)
415
+ args[0] = np.full((2, 1), args[0])
416
+ result = domain.degree_geoid_height(*args)
417
+ assert result.shape == (2, 1)
418
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
419
+
420
+
421
+ @pytest.mark.parametrize("index,value", [(1, 1), (1, 2.5), (2, 0), (3, 0)])
422
+ def test_degree_geoid_height_physical_bound(index, value):
423
+ args = [6, 4, 2, 4]
424
+ args[index] = value
425
+ with pytest.raises(ValueError):
426
+ domain.degree_geoid_height(*args)
427
+
428
+
429
+ def test_dipole_field_reference():
430
+ result = domain.dipole_field(*[0, 1, 10000000])
431
+ np.testing.assert_allclose(result, [1, 0], rtol=1e-11, atol=1e-12)
432
+
433
+
434
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
435
+ def test_dipole_field_rejects_invalid(bad):
436
+ args = [0, 1, 10000000]
437
+ args[0] = bad
438
+ with pytest.raises(ValueError):
439
+ domain.dipole_field(*args)
440
+
441
+
442
+ def test_dipole_field_broadcasting():
443
+ args = [0, 1, 10000000]
444
+ reference = domain.dipole_field(*args)
445
+ args[0] = np.full((2, 1), args[0])
446
+ result = domain.dipole_field(*args)
447
+ assert result.shape == (2, 1, 2)
448
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
449
+
450
+
451
+ @pytest.mark.parametrize("index,value", [(0, 2), (1, 0)])
452
+ def test_dipole_field_physical_bound(index, value):
453
+ args = [0, 1, 10000000]
454
+ args[index] = value
455
+ with pytest.raises(ValueError):
456
+ domain.dipole_field(*args)
457
+
458
+
459
+ def test_dipole_inclination_reference():
460
+ result = domain.dipole_inclination(*[0.7853981633974483])
461
+ np.testing.assert_allclose(result, np.arctan(2), rtol=1e-11, atol=1e-12)
462
+
463
+
464
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
465
+ def test_dipole_inclination_rejects_invalid(bad):
466
+ args = [0.7853981633974483]
467
+ args[0] = bad
468
+ with pytest.raises(ValueError):
469
+ domain.dipole_inclination(*args)
470
+
471
+
472
+ def test_dipole_inclination_broadcasting():
473
+ args = [0.7853981633974483]
474
+ reference = domain.dipole_inclination(*args)
475
+ args[0] = np.full((2, 1), args[0])
476
+ result = domain.dipole_inclination(*args)
477
+ assert result.shape == (2, 1)
478
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
479
+
480
+
481
+ @pytest.mark.parametrize("index,value", [(0, 2)])
482
+ def test_dipole_inclination_physical_bound(index, value):
483
+ args = [0.7853981633974483]
484
+ args[index] = value
485
+ with pytest.raises(ValueError):
486
+ domain.dipole_inclination(*args)
487
+
488
+
489
+ def test_paleolatitude_reference():
490
+ result = domain.paleolatitude(*[1.1071487177940906])
491
+ np.testing.assert_allclose(result, np.pi / 4, rtol=1e-11, atol=1e-12)
492
+
493
+
494
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
495
+ def test_paleolatitude_rejects_invalid(bad):
496
+ args = [1.1071487177940906]
497
+ args[0] = bad
498
+ with pytest.raises(ValueError):
499
+ domain.paleolatitude(*args)
500
+
501
+
502
+ def test_paleolatitude_broadcasting():
503
+ args = [1.1071487177940906]
504
+ reference = domain.paleolatitude(*args)
505
+ args[0] = np.full((2, 1), args[0])
506
+ result = domain.paleolatitude(*args)
507
+ assert result.shape == (2, 1)
508
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
509
+
510
+
511
+ @pytest.mark.parametrize("index,value", [(0, -2)])
512
+ def test_paleolatitude_physical_bound(index, value):
513
+ args = [1.1071487177940906]
514
+ args[index] = value
515
+ with pytest.raises(ValueError):
516
+ domain.paleolatitude(*args)
517
+
518
+
519
+ def test_zonal_field_reference():
520
+ result = domain.zonal_field(*[0.5235987755982988, 1, 2, 1, 1])
521
+ np.testing.assert_allclose(result, [-0.75 * np.sqrt(3), 0.375], rtol=1e-11, atol=1e-12)
522
+
523
+
524
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
525
+ def test_zonal_field_rejects_invalid(bad):
526
+ args = [0.5235987755982988, 1, 2, 1, 1]
527
+ args[0] = bad
528
+ with pytest.raises(ValueError):
529
+ domain.zonal_field(*args)
530
+
531
+
532
+ def test_zonal_field_broadcasting():
533
+ args = [0.5235987755982988, 1, 2, 1, 1]
534
+ reference = domain.zonal_field(*args)
535
+ args[0] = np.full((2, 1), args[0])
536
+ result = domain.zonal_field(*args)
537
+ assert result.shape == (2, 1, 2)
538
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
539
+
540
+
541
+ @pytest.mark.parametrize("index,value", [(0, 2), (1, 0), (2, 0), (2, 1.5), (4, 0)])
542
+ def test_zonal_field_physical_bound(index, value):
543
+ args = [0.5235987755982988, 1, 2, 1, 1]
544
+ args[index] = value
545
+ with pytest.raises(ValueError):
546
+ domain.zonal_field(*args)
547
+
548
+
549
+ def test_gauss_dipole_moment_reference():
550
+ result = domain.gauss_dipole_moment(*[3, 4, 12, 1])
551
+ np.testing.assert_allclose(result, 4 * np.pi * 13 / 1.2566370614359173e-6, rtol=1e-11, atol=1e-12)
552
+
553
+
554
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
555
+ def test_gauss_dipole_moment_rejects_invalid(bad):
556
+ args = [3, 4, 12, 1]
557
+ args[0] = bad
558
+ with pytest.raises(ValueError):
559
+ domain.gauss_dipole_moment(*args)
560
+
561
+
562
+ def test_gauss_dipole_moment_broadcasting():
563
+ args = [3, 4, 12, 1]
564
+ reference = domain.gauss_dipole_moment(*args)
565
+ args[0] = np.full((2, 1), args[0])
566
+ result = domain.gauss_dipole_moment(*args)
567
+ assert result.shape == (2, 1)
568
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
569
+
570
+
571
+ @pytest.mark.parametrize("index,value", [(3, 0)])
572
+ def test_gauss_dipole_moment_physical_bound(index, value):
573
+ args = [3, 4, 12, 1]
574
+ args[index] = value
575
+ with pytest.raises(ValueError):
576
+ domain.gauss_dipole_moment(*args)
577
+
578
+
579
+ def test_field_elements_reference():
580
+ result = domain.field_elements(*[1, 1, 1.4142135623730951])
581
+ np.testing.assert_allclose(result, [np.pi / 4, np.pi / 4, 2], rtol=1e-11, atol=1e-12)
582
+
583
+
584
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
585
+ def test_field_elements_rejects_invalid(bad):
586
+ args = [1, 1, 1.4142135623730951]
587
+ args[0] = bad
588
+ with pytest.raises(ValueError):
589
+ domain.field_elements(*args)
590
+
591
+
592
+ def test_field_elements_broadcasting():
593
+ args = [1, 1, 1.4142135623730951]
594
+ reference = domain.field_elements(*args)
595
+ args[0] = np.full((2, 1), args[0])
596
+ result = domain.field_elements(*args)
597
+ assert result.shape == (2, 1, 3)
598
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
599
+
600
+
601
+ def test_direction_angle_reference():
602
+ result = domain.direction_angle(*[0, 0.5, 0, -0.5])
603
+ np.testing.assert_allclose(result, 1, rtol=1e-11, atol=1e-12)
604
+
605
+
606
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
607
+ def test_direction_angle_rejects_invalid(bad):
608
+ args = [0, 0.5, 0, -0.5]
609
+ args[0] = bad
610
+ with pytest.raises(ValueError):
611
+ domain.direction_angle(*args)
612
+
613
+
614
+ def test_direction_angle_broadcasting():
615
+ args = [0, 0.5, 0, -0.5]
616
+ reference = domain.direction_angle(*args)
617
+ args[0] = np.full((2, 1), args[0])
618
+ result = domain.direction_angle(*args)
619
+ assert result.shape == (2, 1)
620
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
621
+
622
+
623
+ @pytest.mark.parametrize("index,value", [(1, 2), (3, -2)])
624
+ def test_direction_angle_physical_bound(index, value):
625
+ args = [0, 0.5, 0, -0.5]
626
+ args[index] = value
627
+ with pytest.raises(ValueError):
628
+ domain.direction_angle(*args)
629
+
630
+
631
+ def test_virtual_geomagnetic_pole_reference():
632
+ result = domain.virtual_geomagnetic_pole(*[0, 0, 1.5707963267948966, 0])
633
+ np.testing.assert_allclose(result, [0, np.pi / 2], rtol=1e-11, atol=1e-12)
634
+
635
+
636
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
637
+ def test_virtual_geomagnetic_pole_rejects_invalid(bad):
638
+ args = [0, 0, 1.5707963267948966, 0]
639
+ args[0] = bad
640
+ with pytest.raises(ValueError):
641
+ domain.virtual_geomagnetic_pole(*args)
642
+
643
+
644
+ def test_virtual_geomagnetic_pole_broadcasting():
645
+ args = [0, 0, 1.5707963267948966, 0]
646
+ reference = domain.virtual_geomagnetic_pole(*args)
647
+ args[0] = np.full((2, 1), args[0])
648
+ result = domain.virtual_geomagnetic_pole(*args)
649
+ assert result.shape == (2, 1, 2)
650
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
651
+
652
+
653
+ @pytest.mark.parametrize("index,value", [(0, 2), (3, 2)])
654
+ def test_virtual_geomagnetic_pole_physical_bound(index, value):
655
+ args = [0, 0, 1.5707963267948966, 0]
656
+ args[index] = value
657
+ with pytest.raises(ValueError):
658
+ domain.virtual_geomagnetic_pole(*args)
659
+
660
+
661
+ def test_block_magnetic_anomaly_reference():
662
+ result = domain.block_magnetic_anomaly(*[0, -1, 1, 1, 1.7320508075688772, 9549296.58551372])
663
+ np.testing.assert_allclose(result, 1, rtol=1e-11, atol=1e-12)
664
+
665
+
666
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
667
+ def test_block_magnetic_anomaly_rejects_invalid(bad):
668
+ args = [0, -1, 1, 1, 1.7320508075688772, 9549296.58551372]
669
+ args[0] = bad
670
+ with pytest.raises(ValueError):
671
+ domain.block_magnetic_anomaly(*args)
672
+
673
+
674
+ def test_block_magnetic_anomaly_broadcasting():
675
+ args = [0, -1, 1, 1, 1.7320508075688772, 9549296.58551372]
676
+ reference = domain.block_magnetic_anomaly(*args)
677
+ args[0] = np.full((2, 1), args[0])
678
+ result = domain.block_magnetic_anomaly(*args)
679
+ assert result.shape == (2, 1)
680
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
681
+
682
+
683
+ @pytest.mark.parametrize("index,value", [(3, 0), (4, 0)])
684
+ def test_block_magnetic_anomaly_physical_bound(index, value):
685
+ args = [0, -1, 1, 1, 1.7320508075688772, 9549296.58551372]
686
+ args[index] = value
687
+ with pytest.raises(ValueError):
688
+ domain.block_magnetic_anomaly(*args)
689
+
690
+
691
+ def test_magnetic_reynolds_number_reference():
692
+ result = domain.magnetic_reynolds_number(*[2, 3, 795774.7154594767])
693
+ np.testing.assert_allclose(result, 6, rtol=1e-11, atol=1e-12)
694
+
695
+
696
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
697
+ def test_magnetic_reynolds_number_rejects_invalid(bad):
698
+ args = [2, 3, 795774.7154594767]
699
+ args[0] = bad
700
+ with pytest.raises(ValueError):
701
+ domain.magnetic_reynolds_number(*args)
702
+
703
+
704
+ def test_magnetic_reynolds_number_broadcasting():
705
+ args = [2, 3, 795774.7154594767]
706
+ reference = domain.magnetic_reynolds_number(*args)
707
+ args[0] = np.full((2, 1), args[0])
708
+ result = domain.magnetic_reynolds_number(*args)
709
+ assert result.shape == (2, 1)
710
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
711
+
712
+
713
+ @pytest.mark.parametrize("index,value", [(0, -1), (1, 0), (2, 0)])
714
+ def test_magnetic_reynolds_number_physical_bound(index, value):
715
+ args = [2, 3, 795774.7154594767]
716
+ args[index] = value
717
+ with pytest.raises(ValueError):
718
+ domain.magnetic_reynolds_number(*args)
719
+
720
+
721
+ def test_magnetic_decay_time_reference():
722
+ result = domain.magnetic_decay_time(*[3.141592653589793, 795774.7154594767])
723
+ np.testing.assert_allclose(result, 1, rtol=1e-11, atol=1e-12)
724
+
725
+
726
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
727
+ def test_magnetic_decay_time_rejects_invalid(bad):
728
+ args = [3.141592653589793, 795774.7154594767]
729
+ args[0] = bad
730
+ with pytest.raises(ValueError):
731
+ domain.magnetic_decay_time(*args)
732
+
733
+
734
+ def test_magnetic_decay_time_broadcasting():
735
+ args = [3.141592653589793, 795774.7154594767]
736
+ reference = domain.magnetic_decay_time(*args)
737
+ args[0] = np.full((2, 1), args[0])
738
+ result = domain.magnetic_decay_time(*args)
739
+ assert result.shape == (2, 1)
740
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
741
+
742
+
743
+ @pytest.mark.parametrize("index,value", [(0, 0), (1, 0)])
744
+ def test_magnetic_decay_time_physical_bound(index, value):
745
+ args = [3.141592653589793, 795774.7154594767]
746
+ args[index] = value
747
+ with pytest.raises(ValueError):
748
+ domain.magnetic_decay_time(*args)
749
+
750
+
751
+ def test_rikitake_fixed_point_reference():
752
+ result = domain.rikitake_fixed_point(*[3, 2])
753
+ np.testing.assert_allclose(result, [2, 0.5, 12], rtol=1e-11, atol=1e-12)
754
+
755
+
756
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
757
+ def test_rikitake_fixed_point_rejects_invalid(bad):
758
+ args = [3, 2]
759
+ args[0] = bad
760
+ with pytest.raises(ValueError):
761
+ domain.rikitake_fixed_point(*args)
762
+
763
+
764
+ def test_rikitake_fixed_point_broadcasting():
765
+ args = [3, 2]
766
+ reference = domain.rikitake_fixed_point(*args)
767
+ args[0] = np.full((2, 1), args[0])
768
+ result = domain.rikitake_fixed_point(*args)
769
+ assert result.shape == (2, 1, 3)
770
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
771
+
772
+
773
+ @pytest.mark.parametrize("index,value", [(0, 0), (1, 0)])
774
+ def test_rikitake_fixed_point_physical_bound(index, value):
775
+ args = [3, 2]
776
+ args[index] = value
777
+ with pytest.raises(ValueError):
778
+ domain.rikitake_fixed_point(*args)
779
+
780
+
781
+ def test_love_number_h2_reference():
782
+ result = domain.love_number_h2(*[1.5, 1, 1, 9.5])
783
+ np.testing.assert_allclose(result, 1, rtol=1e-11, atol=1e-12)
784
+
785
+
786
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
787
+ def test_love_number_h2_rejects_invalid(bad):
788
+ args = [1.5, 1, 1, 9.5]
789
+ args[0] = bad
790
+ with pytest.raises(ValueError):
791
+ domain.love_number_h2(*args)
792
+
793
+
794
+ def test_love_number_h2_broadcasting():
795
+ args = [1.5, 1, 1, 9.5]
796
+ reference = domain.love_number_h2(*args)
797
+ args[0] = np.full((2, 1), args[0])
798
+ result = domain.love_number_h2(*args)
799
+ assert result.shape == (2, 1)
800
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
801
+
802
+
803
+ @pytest.mark.parametrize("index,value", [(0, -1), (1, 0), (2, 0), (3, 0)])
804
+ def test_love_number_h2_physical_bound(index, value):
805
+ args = [1.5, 1, 1, 9.5]
806
+ args[index] = value
807
+ with pytest.raises(ValueError):
808
+ domain.love_number_h2(*args)
809
+
810
+
811
+ def test_love_number_k2_reference():
812
+ result = domain.love_number_k2(*[1.5, 1, 1, 9.5])
813
+ np.testing.assert_allclose(result, 0.6, rtol=1e-11, atol=1e-12)
814
+
815
+
816
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
817
+ def test_love_number_k2_rejects_invalid(bad):
818
+ args = [1.5, 1, 1, 9.5]
819
+ args[0] = bad
820
+ with pytest.raises(ValueError):
821
+ domain.love_number_k2(*args)
822
+
823
+
824
+ def test_love_number_k2_broadcasting():
825
+ args = [1.5, 1, 1, 9.5]
826
+ reference = domain.love_number_k2(*args)
827
+ args[0] = np.full((2, 1), args[0])
828
+ result = domain.love_number_k2(*args)
829
+ assert result.shape == (2, 1)
830
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
831
+
832
+
833
+ @pytest.mark.parametrize("index,value", [(0, -1), (1, 0), (2, 0), (3, 0)])
834
+ def test_love_number_k2_physical_bound(index, value):
835
+ args = [1.5, 1, 1, 9.5]
836
+ args[index] = value
837
+ with pytest.raises(ValueError):
838
+ domain.love_number_k2(*args)
839
+
840
+
841
+ def test_tidal_gravimetric_factor_reference():
842
+ result = domain.tidal_gravimetric_factor(*[0.6, 0.3])
843
+ np.testing.assert_allclose(result, 1.15, rtol=1e-11, atol=1e-12)
844
+
845
+
846
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
847
+ def test_tidal_gravimetric_factor_rejects_invalid(bad):
848
+ args = [0.6, 0.3]
849
+ args[0] = bad
850
+ with pytest.raises(ValueError):
851
+ domain.tidal_gravimetric_factor(*args)
852
+
853
+
854
+ def test_tidal_gravimetric_factor_broadcasting():
855
+ args = [0.6, 0.3]
856
+ reference = domain.tidal_gravimetric_factor(*args)
857
+ args[0] = np.full((2, 1), args[0])
858
+ result = domain.tidal_gravimetric_factor(*args)
859
+ assert result.shape == (2, 1)
860
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
861
+
862
+
863
+ @pytest.mark.parametrize("index,value", [(0, -1), (1, -1)])
864
+ def test_tidal_gravimetric_factor_physical_bound(index, value):
865
+ args = [0.6, 0.3]
866
+ args[index] = value
867
+ with pytest.raises(ValueError):
868
+ domain.tidal_gravimetric_factor(*args)
869
+
870
+
871
+ def test_equivalent_water_height_reference():
872
+ result = domain.equivalent_water_height(*[2, 1, 0.5, 3, 3, 2])
873
+ np.testing.assert_allclose(result, 6, rtol=1e-11, atol=1e-12)
874
+
875
+
876
+ @pytest.mark.parametrize("bad", [np.nan, np.inf, -np.inf, [], "bad", True, 1j])
877
+ def test_equivalent_water_height_rejects_invalid(bad):
878
+ args = [2, 1, 0.5, 3, 3, 2]
879
+ args[0] = bad
880
+ with pytest.raises(ValueError):
881
+ domain.equivalent_water_height(*args)
882
+
883
+
884
+ def test_equivalent_water_height_broadcasting():
885
+ args = [2, 1, 0.5, 3, 3, 2]
886
+ reference = domain.equivalent_water_height(*args)
887
+ args[0] = np.full((2, 1), args[0])
888
+ result = domain.equivalent_water_height(*args)
889
+ assert result.shape == (2, 1)
890
+ np.testing.assert_allclose(result, np.broadcast_to(reference, result.shape))
891
+
892
+
893
+ @pytest.mark.parametrize("index,value", [(1, -1), (1, 0.5), (2, -1), (3, 0), (4, 0), (5, 0)])
894
+ def test_equivalent_water_height_physical_bound(index, value):
895
+ args = [2, 1, 0.5, 3, 3, 2]
896
+ args[index] = value
897
+ with pytest.raises(ValueError):
898
+ domain.equivalent_water_height(*args)