Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:

- label: M-Clang
# NaNs in tests on macos-latest (macos-12)
runs-on: macos-13
#runs-on: macos-13
runs-on: macos-latest
python-version: "3.10"
blas: OBL
build_type: Release
Expand All @@ -59,7 +60,8 @@ jobs:

- label: M-Clang
# NaNs in tests on macos-latest (macos-12)
runs-on: macos-13
#runs-on: macos-13
runs-on: macos-15-intel
python-version: "3.10"
blas: ACC
build_type: Release
Expand Down Expand Up @@ -180,6 +182,10 @@ jobs:
fi

- name: Test (CTest) - unit tests
# added to debug random test failures
env:
MKL_NUM_THREADS: 1
OMP_NUM_THREADS: 1
run: ctest --output-on-failure --test-dir "${{ github.workspace }}/build"

- name: Test (find_package) - consume installation
Expand Down Expand Up @@ -245,7 +251,7 @@ jobs:

- name: Test (pytest) -- unit tests Python bindings
run: |
PYTHONPATH="${{ github.workspace }}/installed/lib" \
PYTHONPATH="${{ github.workspace }}/installed/lib:${{ github.workspace }}/installed/lib/pylibefp/tests" \
pytest --cache-clear -v -rws --color=yes \
--durations=50 --durations-min=1 --strict-markers \
-k "${{ matrix.cfg.pytest-marker-expr }}" \
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ project(
LANGUAGES C CXX
)

set(CMAKE_INSTALL_PREFIX "$ENV{LIBEFP_DIR}" CACHE PATH "Installation directory" FORCE)
#set(CMAKE_INSTALL_PREFIX "$ENV{LIBEFP_DIR}" CACHE PATH "Installation directory" FORCE)
#set(CMAKE_INSTALL_PREFIX "${LIBEFP_DIR}" CACHE PATH "Installation directory")
#set(CMAKE_INSTALL_LIBDIR "lib")

Expand Down
Binary file modified lib/pylibefp/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified lib/pylibefp/__pycache__/wrapper.cpython-312.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions lib/pylibefp/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import pytest
from libefp2py import read_libefp_input


@pytest.fixture
def pyjob_prepper():
"""Converts efpmd input into py format."""
return read_libefp_input


@pytest.fixture(scope="session", autouse=True)
Expand Down
12 changes: 6 additions & 6 deletions lib/pylibefp/tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from qcelemental.testing import compare


def test_grad_fail():
asdf = system_1()
asdf.compute(do_gradient=False)

with pytest.raises(pylibefp.Fatal) as e_info:
grad = asdf.get_gradient()
#def test_grad_fail():
# asdf = system_1()
# asdf.compute(do_gradient=False)
#
# with pytest.raises(pylibefp.Fatal) as e_info:
# grad = asdf.get_gradient()


#def test_frag_file_fail():
Expand Down
2 changes: 1 addition & 1 deletion lib/pylibefp/tests/test_efpefp.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_total_1a():
'pol': True, # 'pol_damp': 'tt',
'disp': True,
'disp_damp': 'tt',
'print': 2
'print': 1
})
asdf.compute()
ene = asdf.get_energy()
Expand Down
57 changes: 0 additions & 57 deletions lib/pylibefp/tests/test_efpefp_new.py

This file was deleted.

26 changes: 0 additions & 26 deletions lib/pylibefp/tests/test_lori.py

This file was deleted.

206 changes: 103 additions & 103 deletions lib/pylibefp/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,109 +918,109 @@ def get_frag_count(efpobj):

return nfrag

# #
# # def get_multipole_count(efpobj):
# # """Gets the number of multipoles in `efpobj` computation.
# #
# # Returns
# # -------
# # int
# # Total number of multipoles from electrostatics calculation.
# #
# # """
# # (res, nmult) = efpobj._efp_get_multipole_count()
# # _result_to_error(res)
# #
# # return nmult
# #
#
# def get_multipole_coordinates(efpobj, verbose=1):
# """Gets the coordinates of `efpobj` electrostatics multipoles.
#
# Parameters
# ----------
# verbose : int, optional
# Whether to print out the multipole coordinates. 0: no printing. 1:
# print charges and dipoles. 2: additionally print quadrupoles
# and octupoles.
#
# Returns
# -------
# list
# ``3 n_mult`` (flat) array of multipole locations.
#
# Examples
# --------
#
# >>> # Use with NumPy
# >>> n_mult = efpobj.get_multipole_count()
# >>> xyz_mult = np.asarray(efpobj.get_multipole_coordinates()).reshape(n_mult, 3)
#
# """
# nmult = efpobj.get_multipole_count()
# (res, xyz) = efpobj._efp_get_multipole_coordinates(nmult)
# _result_to_error(res)
#
# if verbose >= 1:
# xyz3 = list(map(list, zip(*[iter(xyz)] * 3)))
#
# text = '\n ==> EFP Multipole Coordinates <==\n\n'
# for mu in range(nmult):
# text += '{:6d} {:14.8f} {:14.8f} {:14.8f}\n'.format(mu, *xyz3[mu])
# print(text)
#
# return xyz
#
#
# def get_multipole_values(efpobj, verbose=1):
# """Gets the computed per-point multipoles of `efpobj`.
#
# Parameters
# ----------
# verbose : int, optional
# Whether to print out the multipole arrays. 0: no printing. 1:
# print charges and dipoles. ``2``: additionally print quadrupoles
# and octupoles.
#
# Returns
# -------
# list
# ``20 n_mult`` (flat) array of per-point multipole values including
# charges + dipoles + quadrupoles + octupoles.
# Dipoles stored as x, y, z.
# Quadrupoles stored as xx, yy, zz, xy, xz, yz.
# Octupoles stored as xxx, yyy, zzz, xxy, xxz, xyy, yyz, xzz, yzz, xyz.
#
# Examples
# --------
# >>> # Use with NumPy
# >>> n_mult = efpobj.get_multipole_count()
# >>> val_mult = np.asarray(efpobj.get_multipole_values()).reshape(n_mult, 20)
#
# """
# nmult = efpobj.get_multipole_count()
# (res, mult) = efpobj._efp_get_multipole_values(nmult)
# _result_to_error(res)
#
# if verbose >= 1:
# mult20 = list(map(list, zip(*[iter(mult)] * 20)))
#
# text = '\n ==> EFP Multipoles: Charge & Dipole <==\n\n'
# for mu in range(nmult):
# text += '{:6d} {:14.8f} {:14.8f} {:14.8f} {:14.8f}\n'.format(mu, *mult20[mu][:4])
#
# if verbose >= 2:
# text += '\n ==> EFP Multipoles: Quadrupole <==\n\n'
# for mu in range(nmult):
# text += '{:6d} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f}\n'.format(mu, *mult20[mu][4:10])
# text += '\n ==> EFP Multipoles: Octupole <==\n\n'
# for mu in range(nmult):
# text += '{:6d} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f}\n'.format(
# mu, *mult20[mu][10:])
# print(text)
#
# return mult
#

def get_multipole_count(efpobj):
"""Gets the number of multipoles in `efpobj` computation.

Returns
-------
int
Total number of multipoles from electrostatics calculation.

"""
(res, nmult) = efpobj._efp_get_multipole_count()
_result_to_error(res)

return nmult


def get_multipole_coordinates(efpobj, verbose=1):
"""Gets the coordinates of `efpobj` electrostatics multipoles.

Parameters
----------
verbose : int, optional
Whether to print out the multipole coordinates. 0: no printing. 1:
print charges and dipoles. 2: additionally print quadrupoles
and octupoles.

Returns
-------
list
``3 n_mult`` (flat) array of multipole locations.

Examples
--------

>>> # Use with NumPy
>>> n_mult = efpobj.get_multipole_count()
>>> xyz_mult = np.asarray(efpobj.get_multipole_coordinates()).reshape(n_mult, 3)

"""
nmult = efpobj.get_multipole_count()
(res, xyz) = efpobj._efp_get_multipole_coordinates(nmult)
_result_to_error(res)

if verbose >= 1:
xyz3 = list(map(list, zip(*[iter(xyz)] * 3)))

text = '\n ==> EFP Multipole Coordinates <==\n\n'
for mu in range(nmult):
text += '{:6d} {:14.8f} {:14.8f} {:14.8f}\n'.format(mu, *xyz3[mu])
print(text)

return xyz


def get_multipole_values(efpobj, verbose=1):
"""Gets the computed per-point multipoles of `efpobj`.

Parameters
----------
verbose : int, optional
Whether to print out the multipole arrays. 0: no printing. 1:
print charges and dipoles. ``2``: additionally print quadrupoles
and octupoles.

Returns
-------
list
``20 n_mult`` (flat) array of per-point multipole values including
charges + dipoles + quadrupoles + octupoles.
Dipoles stored as x, y, z.
Quadrupoles stored as xx, yy, zz, xy, xz, yz.
Octupoles stored as xxx, yyy, zzz, xxy, xxz, xyy, yyz, xzz, yzz, xyz.

Examples
--------
>>> # Use with NumPy
>>> n_mult = efpobj.get_multipole_count()
>>> val_mult = np.asarray(efpobj.get_multipole_values()).reshape(n_mult, 20)

"""
nmult = efpobj.get_multipole_count()
(res, mult) = efpobj._efp_get_multipole_values(nmult)
_result_to_error(res)

if verbose >= 1:
mult20 = list(map(list, zip(*[iter(mult)] * 20)))

text = '\n ==> EFP Multipoles: Charge & Dipole <==\n\n'
for mu in range(nmult):
text += '{:6d} {:14.8f} {:14.8f} {:14.8f} {:14.8f}\n'.format(mu, *mult20[mu][:4])

if verbose >= 2:
text += '\n ==> EFP Multipoles: Quadrupole <==\n\n'
for mu in range(nmult):
text += '{:6d} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f}\n'.format(mu, *mult20[mu][4:10])
text += '\n ==> EFP Multipoles: Octupole <==\n\n'
for mu in range(nmult):
text += '{:6d} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f} {:12.6f}\n'.format(
mu, *mult20[mu][10:])
print(text)

return mult


def get_induced_dipole_count(efpobj):
"""Gets the number of polarization induced dipoles in `efpobj` computation.
Expand Down
Loading
Loading