mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-31 17:17:50 -05:00
Python ruff fixes
* Python: Clean up imports. * Python: Clean up error handling example. * Python: Remove unused local variables * Python: Avoid comparing against True/False. * Python: Remove unused name variable. * Python: Reuse class definition type variable. * Python: Fix more unused imports * Black fixes
This commit is contained in:
1 parent
dc4cd33c6e
commit
7899736f05
41 files changed
+64
-106
No files matched your search
@@ -4,7 +4,6 @@
|
||||
###################################################################
|
||||
|
||||
import rips
|
||||
import grpc
|
||||
import tempfile
|
||||
|
||||
|
||||
@@ -49,8 +48,8 @@ if case is not None:
|
||||
try:
|
||||
case.set_active_cell_property(results, "GENERATED", "POROAPPENDED", 0)
|
||||
print("Everything went well as expected")
|
||||
except: # Match any exception, but it should not happen
|
||||
print("Ooops!")
|
||||
except Exception as e: # Match any exception, but it should not happen
|
||||
print("Ooops!", e)
|
||||
|
||||
# Add another value, so this is outside the bounds of the active cell result storage
|
||||
results.append(1.0)
|
||||
@@ -59,7 +58,7 @@ if case is not None:
|
||||
try:
|
||||
case.set_active_cell_property(results, "GENERATED", "POROAPPENDED", 0)
|
||||
print("Everything went well??")
|
||||
except RipsError as e:
|
||||
except rips.RipsError as e:
|
||||
print("Server Exception Received: ", e)
|
||||
except IndexError:
|
||||
print("Got index out of bounds error. This shouldn't happen here")
|
||||
@@ -72,7 +71,7 @@ if case is not None:
|
||||
try:
|
||||
case.set_active_cell_property(results, "GENERATED", "POROAPPENDED", 0)
|
||||
print("Everything went well??")
|
||||
except grpc.RpcError as e:
|
||||
except rips.RipsError as e:
|
||||
print("Got unexpected server exception", e, "This should not happen now")
|
||||
except IndexError:
|
||||
print("Got expected index out of bounds error on client side")
|
||||
Reference in new issue
Block a user