Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fd02d7c
Add CI workflow for Python versions 3.9 to 3.13
nlk36701 Nov 25, 2025
6ab126f
Fix pip install command in workflow
nlk36701 Nov 25, 2025
8d07886
Add build system configuration to pyproject.toml
nlk36701 Nov 25, 2025
24005a2
Add versioneer to build-system requirements
nlk36701 Nov 25, 2025
c7a9caf
Fix spacing in versionfile paths in setup.cfg
nlk36701 Nov 25, 2025
27eaf90
Modify installation step for test dependencies
nlk36701 Nov 25, 2025
ef8545b
Let pytest discover test directory
nlk36701 Nov 25, 2025
9ad59ef
Remove --no-deps from pip install command
nlk36701 Nov 25, 2025
0cc26e3
Add step to install MolSym in workflow
nlk36701 Nov 25, 2025
96d9eb1
Update setup.py
nlk36701 Nov 25, 2025
00fe09c
Create __init__.py
nlk36701 Nov 25, 2025
bc96c4f
Enhance MANIFEST.in for better package inclusion
nlk36701 Nov 25, 2025
655c239
Update package_data to include additional test files
nlk36701 Nov 25, 2025
a6b771e
Upgrade actions/checkout to v5 and modify test path
nlk36701 Nov 25, 2025
4839888
python path
nlk36701 Nov 25, 2025
ebcf9b8
Add pint package installation to workflow
nlk36701 Nov 25, 2025
56ee327
Hide _test_transf_disp.py
nlk36701 Nov 25, 2025
e9c0cac
Changed working directory in workflow.yml
nlk36701 Nov 25, 2025
18b233e
moved tests, addressed it in workflow.yml
nlk36701 Nov 25, 2025
0402c9b
Update workflow.yml
nlk36701 Nov 25, 2025
35c72b3
Revert back
nlk36701 Nov 26, 2025
4bda388
Update pytest command for test directory path
nlk36701 Nov 26, 2025
685d360
Create symlink for ref_data and modify pytest command
nlk36701 Nov 26, 2025
f76e30f
Fix indentation in workflow YAML file
nlk36701 Nov 26, 2025
0c50125
Fix indentation in pytest command in workflow
nlk36701 Nov 26, 2025
89ff2a0
print values in test_zmat
nlk36701 Nov 26, 2025
c95df72
Rename workflow file to CI.yml
nlk36701 Nov 26, 2025
e008e73
fixed zmat test for type error
nlk36701 Nov 26, 2025
93e2e2d
uncommented lines
nlk36701 Nov 26, 2025
0344e51
formatted with black
nlk36701 Nov 26, 2025
b859987
Validate custom indices in test_zmat.py
nlk36701 Dec 4, 2025
92876ac
debug pytest failure
nlk36701 Dec 4, 2025
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
67 changes: 67 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
cfg:
- conda-env: base

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bother with 3.9 and 3.10. conda-forge build system has already dropped 3.9 support iirc.

I would add 3.14.
3.14 has some fairly significant changes (GIL). Psi4 and MolSSI are working on getting everything working with 3.14 rn.

python-version: 3.9
- conda-env: base
python-version: "3.10"
- conda-env: base
python-version: "3.11"
- conda-env: base
python-version: "3.12"
- conda-env: base
python-version: "3.13"
env:
PYVER: ${{ matrix.cfg.python-version }}
CONDA_ENV: ${{ matrix.cfg.conda-env }}
steps:
- uses: actions/checkout@v5

- name: Create Environment
uses: conda-incubator/setup-miniconda@v2
with:
installer-url: https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
activate-environment: test
environment-file: devtools/conda-envs/${{ matrix.cfg.conda-env }}.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false

- name: Install test dependencies
shell: bash -l {0}
run: |
conda install -y pytest pytest-cov
- name: Install MolSym
shell: bash -l {0}
run: |
pip install pint
pip install git+https://github.com/NASymmetry/MolSym.git
- name: Install ConcordantModes
shell: bash -l {0}
run: |
python -m pip install .
- name: Make ref_data available from repo root
shell: bash -l {0}
run: |
ln -sfn "${GITHUB_WORKSPACE}/concordantmodes/tests/ref_data" ref_data
Comment thread
MitchLahm marked this conversation as resolved.
echo "Symlink created:"
ls -l ref_data
- name: Test with pytest
shell: bash -l {0}
run: |
export PYTHONPATH="${GITHUB_WORKSPACE}:${PYTHONPATH}"
pytest --cov="concordantmodes" --color=yes --cov-report=xml concordantmodes/tests
# - name: Upload Coverage to Codecov
# uses: codecov/codecov-action@v5
# with:
# directory: ./coverage/reports/
# env_vars: OS,PYTHON
# fail_ci_if_error: false
# files: ./coverage.xml
# flags: unittests
# name: codecov-umbrella
# verbose: true
38 changes: 30 additions & 8 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
recursive-include concordantmodes *.py
recursive-include examples

include setup.py
include setup.cfg
###############################################
# Core project metadata
###############################################
include README.md
include LICENSE
include MANIFEST.in
include setup.py
include pyproject.toml
include setup.cfg

# Include package source code

recursive-include concordantmodes *.py

# Include test suite

recursive-include concordantmodes/tests *.py
recursive-include concordantmodes/tests/ref_data *

# Include any templates, example files, etc.

recursive-include concordantmodes *.txt
recursive-include concordantmodes *.dat
recursive-include concordantmodes *.json
recursive-include concordantmodes *.yaml
recursive-include concordantmodes *.yml

# junk
Comment thread
MitchLahm marked this conversation as resolved.

include versioneer.py
include concordantmodes/_version.py
global-exclude __pycache__/*
global-exclude *.pyc
global-exclude *.pyo
global-exclude *.swp
global-exclude *.swo
3 changes: 1 addition & 2 deletions concordantmodes/cma.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ def run(self, sym_sort=[]):
)
s_vec.run(self.zmat_obj.cartesians_a, False, proj=self.TED_obj.proj)


transf_disp = TransfDisp(
s_vec,
self.zmat_obj,
Expand Down Expand Up @@ -632,7 +631,7 @@ def run(self, sym_sort=[]):

self.F = fc_a.FC
# f_b = np.dot(
# np.dot(LA.inv(transf_disp.eig_inv).T, f_b), LA.inv(transf_disp.eig_inv)
# np.dot(LA.inv(transf_disp.eig_inv).T, f_b), LA.inv(transf_disp.eig_inv)
# )
# print("Level B FC in same basis:")
# print(f_b)
Expand Down
4 changes: 2 additions & 2 deletions concordantmodes/off_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def run(self):
od_inds = self.od_inds
temp = copy.copy(f_diag)
if off_diag == 1:
# print("Adding on these off-diagonals:")
# print(od_inds)
print("Adding on these off-diagonals:")
print(od_inds)
1 change: 0 additions & 1 deletion concordantmodes/reap.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,3 @@ def reap_gradients(self, direc, grad_regex1, grad_regex2):
os.chdir("..")

return grad_array

1 change: 1 addition & 0 deletions concordantmodes/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numpy.linalg import inv
from numpy import linalg as LA

from suite_execute import execute_suite
from .suite_execute import execute_suite

from concordantmodes.algorithm import Algorithm
from concordantmodes.f_convert import FcConv
Expand Down Expand Up @@ -51,4 +51,5 @@ def test_transf_disp():

assert np.allclose(np.asarray(disp_ref), disps.p_disp[3][3], rtol=0.0, atol=1e-5)


test_transf_disp()
1 change: 1 addition & 0 deletions concordantmodes/tests/test_directory_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


def test_make_input():

os.chdir("./ref_data/dir_tree/")

options = Options()
Expand Down
2 changes: 1 addition & 1 deletion concordantmodes/tests/test_f_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from numpy.linalg import inv
from numpy import linalg as LA

from suite_execute import execute_suite
from .suite_execute import execute_suite

from concordantmodes.f_convert import FcConv
from concordantmodes.f_read import FcRead
Expand Down
2 changes: 1 addition & 1 deletion concordantmodes/tests/test_g_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numpy.linalg import inv
from numpy import linalg as LA

from suite_execute import execute_suite
from .suite_execute import execute_suite

from concordantmodes.g_matrix import GMatrix
from concordantmodes.options import Options
Expand Down
2 changes: 1 addition & 1 deletion concordantmodes/tests/test_gf_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numpy.linalg import inv
from numpy import linalg as LA

from suite_execute import execute_suite
from .suite_execute import execute_suite

from concordantmodes.f_convert import FcConv
from concordantmodes.f_read import FcRead
Expand Down
2 changes: 1 addition & 1 deletion concordantmodes/tests/test_reap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numpy.linalg import inv
from numpy import linalg as LA

from suite_execute import execute_suite
from .suite_execute import execute_suite

from concordantmodes.algorithm import Algorithm
from concordantmodes.f_convert import FcConv
Expand Down
2 changes: 1 addition & 1 deletion concordantmodes/tests/test_s_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numpy.linalg import inv
from numpy import linalg as LA

from suite_execute import execute_suite
from .suite_execute import execute_suite

from concordantmodes.options import Options
from concordantmodes.s_vectors import SVectors
Expand Down
18 changes: 16 additions & 2 deletions concordantmodes/tests/test_zmat.py
Comment thread
MitchLahm marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ def test_zmat_calc():
"Ly1": -0.0022793163188044303,
}
var_dict_custom = ZMAT.variable_dictionary_a

if np.setdiff1d(var_dict_ref, var_dict_custom).size:
errors.append("Custom variables do not match.")

Expand Down Expand Up @@ -327,8 +326,23 @@ def test_zmat_compile():
}
index_dict_custom = ZMAT.index_dictionary

errors = []
if np.setdiff1d(index_dict_ref, index_dict_custom).size:
errors.append("Custom indices do not match.")

os.chdir("../../")
assert not errors, "errors occured:\n{}".format("\n".join(errors))
# for key, ref_val in index_dict_ref.items():
#
# if key not in index_dict_custom:
# errors.append(f"Missing key {key}")
# continue

# custom_val = index_dict_custom[key]

# # Compare tuples of strings literally
# if ref_val != custom_val:
# errors.append(
# f"Index mismatch for {key}: expected {ref_val}, got {custom_val}"
# )

# assert not errors, "errors occured:\n{}".format("\n".join(errors))
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"versioneer"
Comment thread
MitchLahm marked this conversation as resolved.
]
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versioneer]
VCS = git
style = pep440
versionfile_source = concordantmodes / _version.py
versionfile_build = concordantmodes / _version.py
versionfile_source = concordantmodes/_version.py
versionfile_build = concordantmodes/_version.py
tag_prefix = ""
7 changes: 7 additions & 0 deletions setup.py
Comment thread
MitchLahm marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
cmdclass=versioneer.get_cmdclass(),
packages=setuptools.find_packages(),
include_package_data=True,
package_data={
"concordantmodes": [
"tests/*.py",
"tests/ref_data/*",
"tests/ref_data/**/*",
],
Comment thread
MitchLahm marked this conversation as resolved.
},
install_requires=[
"numpy>=1.13.3",
"qcelemental>=0.24.0",
Expand Down
Loading