Merge branch 'python-lint' into collected-small-changes

This commit is contained in:
Axel Kohlmeyer
2024-09-05 04:04:52 -04:00
5 changed files with 21 additions and 10 deletions

View File

@ -18,12 +18,20 @@ from __future__ import print_function
import os import os
import sys import sys
from ctypes import * # lgtm [py/polluting-import] from ctypes import CDLL, POINTER, RTLD_GLOBAL, CFUNCTYPE, py_object, byref, cast, sizeof, \
from os.path import dirname,abspath,join create_string_buffer, c_int, c_int32, c_int64, c_double, c_void_p, c_char_p, pythonapi
from os.path import dirname, abspath, join
from inspect import getsourcefile from inspect import getsourcefile
from .constants import * # lgtm [py/polluting-import] from lammps.constants import LAMMPS_AUTODETECT, LAMMPS_STRING, \
from .data import * # lgtm [py/polluting-import] LAMMPS_INT, LAMMPS_INT_2D, LAMMPS_DOUBLE, LAMMPS_DOUBLE_2D, LAMMPS_INT64, LAMMPS_INT64_2D, \
LMP_STYLE_GLOBAL, LMP_STYLE_ATOM, LMP_STYLE_LOCAL, \
LMP_TYPE_SCALAR, LMP_TYPE_VECTOR, LMP_TYPE_ARRAY, \
LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS, \
LMP_VAR_EQUAL, LMP_VAR_ATOM, LMP_VAR_VECTOR, LMP_VAR_STRING, \
get_ctypes_int
from lammps.data import NeighList
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
@ -2258,7 +2266,6 @@ class lammps(object):
:param caller: reference to some object passed to the callback function :param caller: reference to some object passed to the callback function
:type: object, optional :type: object, optional
""" """
import numpy as np
def callback_wrapper(caller, ntimestep, nlocal, tag_ptr, x_ptr, fext_ptr): def callback_wrapper(caller, ntimestep, nlocal, tag_ptr, x_ptr, fext_ptr):
tag = self.numpy.iarray(self.c_tagint, tag_ptr, nlocal, 1) tag = self.numpy.iarray(self.c_tagint, tag_ptr, nlocal, 1)

View File

@ -18,11 +18,15 @@
from ctypes import POINTER, c_void_p, c_char_p, c_double, c_int, c_int32, c_int64, cast from ctypes import POINTER, c_void_p, c_char_p, c_double, c_int, c_int32, c_int64, cast
from .constants import LAMMPS_AUTODETECT, LAMMPS_INT, LAMMPS_INT_2D, \
LAMMPS_DOUBLE, LAMMPS_DOUBLE_2D, LAMMPS_INT64, LAMMPS_INT64_2D, \
LMP_STYLE_GLOBAL, LMP_STYLE_ATOM, LMP_STYLE_LOCAL, \
LMP_TYPE_SCALAR, LMP_TYPE_VECTOR, LMP_TYPE_ARRAY, \
LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS, \
LMP_VAR_EQUAL, LMP_VAR_ATOM, LMP_VAR_VECTOR, LMP_VAR_STRING
from .constants import * # lgtm [py/polluting-import]
from .data import NeighList from .data import NeighList
class numpy_wrapper: class numpy_wrapper:
"""lammps API NumPy Wrapper """lammps API NumPy Wrapper

View File

@ -27,8 +27,8 @@ import sys
import tempfile import tempfile
from collections import namedtuple from collections import namedtuple
from .core import lammps from lammps.core import lammps
from .constants import * # lgtm [py/polluting-import] from lammps.constants import LMP_VAR_EQUAL, LMP_VAR_ATOM, LMP_VAR_VECTOR, LMP_VAR_STRING
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------

View File

@ -28,6 +28,7 @@ MLIAPDescriptor::MLIAPDescriptor(LAMMPS *lmp) :
cutghost(nullptr), radelem(nullptr), wjelem(nullptr) cutghost(nullptr), radelem(nullptr), wjelem(nullptr)
{ {
cutmax = 0.0; cutmax = 0.0;
allocated_elements = 0;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -57,7 +57,6 @@ MLIAPDescriptorACE::MLIAPDescriptorACE(LAMMPS *_lmp, char *yacefilename) :
{ {
acemlimpl = new ACE_ML_impl; acemlimpl = new ACE_ML_impl;
allocated_elements = 0;
//read in file with CG coefficients or c_tilde coefficients //read in file with CG coefficients or c_tilde coefficients
ctilde_file = yacefilename; ctilde_file = yacefilename;
delete acemlimpl->basis_set; delete acemlimpl->basis_set;