add comments to suppress useless warnings from LGTM

This commit is contained in:
Axel Kohlmeyer
2021-05-15 23:35:14 -04:00
parent 185664824e
commit fde2295685
5 changed files with 20 additions and 20 deletions

View File

@ -18,12 +18,12 @@ from __future__ import print_function
import os
import sys
from ctypes import *
from ctypes import * # lgtm [py/polluting-import]
from os.path import dirname,abspath,join
from inspect import getsourcefile
from .constants import *
from .data import *
from .constants import * # lgtm [py/polluting-import]
from .data import * # lgtm [py/polluting-import]
# -------------------------------------------------------------------------
@ -100,7 +100,7 @@ class lammps(object):
try:
if ptr: self.lib = CDLL("",RTLD_GLOBAL)
except:
except: # lgtm [py/catch-base-exception]
self.lib = None
# load liblammps.so unless name is given
@ -307,7 +307,7 @@ class lammps(object):
from mpi4py import __version__ as mpi4py_version
# tested to work with mpi4py versions 2 and 3
self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3']
except:
except: # lgtm [py/catch-base-exception]
# ignore failing import
pass
@ -1352,7 +1352,7 @@ class lammps(object):
id_lmp = (self.c_tagint*n)()
try:
id_lmp[:] = id[0:n]
except:
except: # lgtm [py/catch-base-exception]
return 0
else:
id_lmp = None
@ -1360,21 +1360,21 @@ class lammps(object):
type_lmp = (c_int*n)()
try:
type_lmp[:] = type[0:n]
except:
except: # lgtm [py/catch-base-exception]
return 0
three_n = 3*n
x_lmp = (c_double*three_n)()
try:
x_lmp[:] = x[0:three_n]
except:
except: # lgtm [py/catch-base-exception]
return 0
if v:
v_lmp = (c_double*(three_n))()
try:
v_lmp[:] = v[0:three_n]
except:
except: # lgtm [py/catch-base-exception]
return 0
else:
v_lmp = None
@ -1383,7 +1383,7 @@ class lammps(object):
img_lmp = (self.c_imageint*n)()
try:
img_lmp[:] = image[0:n]
except:
except: # lgtm [py/catch-base-exception]
return 0
else:
img_lmp = None