Skip to content

Commit 6ab89ea

Browse files
committed
[BUG]
- Fixed bug when surface is 0 for the assert of multiple faults in a series [test] - fixing travis: emg3d
1 parent 458eefb commit 6ab89ea

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

gempy/core/model.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,13 @@ def set_is_fault(self, series_fault: Union[str, list] = None, toggle: bool = Fal
321321
322322
"""
323323
series_fault = np.atleast_1d(series_fault)
324-
if twofins == False:
324+
if twofins is False:
325325
for fault in series_fault:
326-
if len(self.surfaces.df[self.surfaces.df.series == fault]) != 1:
327-
raise AssertionError('Having more than one fault in a series is generally rather bad. Better go back '
328-
'to the function map_series_to_surfaces and give each fault its own series. '
329-
'If you are really sure what you are doing, you can set twofins to True to '
330-
'suppress this error.')
326+
assert np.sum(self.surfaces.df['series'] == fault) < 2,\
327+
'Having more than one fault in a series is generally rather bad. Better go' \
328+
' back to the function map_series_to_surfaces and give each fault its own' \
329+
' series. If you are really sure what you are doing, you can set twofins to' \
330+
' True to suppress this error.'
331331

332332
self.faults.set_is_fault(series_fault, toggle=toggle)
333333

notebooks/integrations/GemPy-discretize-emg3d.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3991,7 +3991,11 @@
39913991
{
39923992
"cell_type": "code",
39933993
"execution_count": 20,
3994-
"metadata": {},
3994+
"metadata": {
3995+
"tags": [
3996+
"nbval-skip"
3997+
]
3998+
},
39953999
"outputs": [
39964000
{
39974001
"data": {

0 commit comments

Comments
 (0)