From db4fffd60047deeea33a7544bb5a39b300323c46 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Wed, 25 Jul 2018 10:40:00 +1000 Subject: [PATCH] Suppress numpy floating point arithmetic warnings --- nielsen_volumes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nielsen_volumes.py b/nielsen_volumes.py index 858ac58..5f918e1 100644 --- a/nielsen_volumes.py +++ b/nielsen_volumes.py @@ -132,7 +132,9 @@ def findZerochainage(chainage0, elevation0, max_beach_slope=5, min_beach_slope=5 else: #find the slope between the last two points try: + np.seterr(all='ignore') beachslope = 1/((elevation0[-2] - elevation0[-1])/(chainage0[-1] - chainage0[-2])) + np.seterr(all=None) except ZeroDivisionError: beachslope= 999 if beachslope>min_beach_slope: