Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
CIBW_TEST_COMMAND: >-
python -c "import importlib.util, XpongeCPP, Xponge,
XpongeCPP.io_bundle, XpongeCPP.metal_assignment;
assert XpongeCPP.__version__ == '0.2.7';
assert XpongeCPP.__version__ == '0.2.8';
assert not hasattr(XpongeCPP, 'MC' + 'PB');
assert importlib.util.find_spec('XpongeCPP.' + ('MC' + 'PB').lower()) is None"
CIBW_BEFORE_ALL_LINUX: >-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
CIBW_TEST_COMMAND: >-
python -c "import importlib.util, XpongeCPP, Xponge,
XpongeCPP.io_bundle, XpongeCPP.metal_assignment;
assert XpongeCPP.__version__ == '0.2.7';
assert XpongeCPP.__version__ == '0.2.8';
assert not hasattr(XpongeCPP, 'MC' + 'PB');
assert importlib.util.find_spec('XpongeCPP.' + ('MC' + 'PB').lower()) is None"
CIBW_BEFORE_ALL_LINUX: >-
Expand Down
15 changes: 15 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# XpongeCPP 0.2.8

Compatibility target: Xponge-origin 1.7.1.

This patch release restores the Python instance-attribute behavior required
by the Xponge RESP diagnostics contract. The pybind-backed `Assign` type now
supports compatibility attributes, allowing `calculate_charge(...,
return_diagnostics=True)` and `return_metadata=True` to retain
`charge_fit_diagnostics` and `charge_fit_metadata` after fitting.

Regression coverage verifies diagnostics, metadata, and general legacy
extension attributes without requiring a QM backend. Release validation also
includes a real PySCF RESP calculation and the complete compatibility suite
against the official Xponge 1.7.1 package.

# XpongeCPP 0.2.7

Compatibility target: Xponge-origin 1.7b11.
Expand Down
2 changes: 1 addition & 1 deletion cpp/python/bindings_assign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void save_assignment_pdb_object(const Assign& assignment, const std::string& fil
} // namespace

void bind_assign_module(py::module_& m) {
py::class_<Assign, std::shared_ptr<Assign>>(m, "Assign")
py::class_<Assign, std::shared_ptr<Assign>>(m, "Assign", py::dynamic_attr())
.def(py::init<std::string>(), py::arg("name") = "ASN")
.def_readwrite("name", &Assign::name)
.def_property_readonly("atom_count", &Assign::atom_count)
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ build-backend = "scikit_build_core.build"

[project]
name = "XpongeCPP"
version = "0.2.7"
description = "C++ core rewrite of Xponge workflows, compatible with Xponge-origin 1.7b11"
version = "0.2.8"
description = "C++ core rewrite of Xponge workflows, compatible with Xponge-origin 1.7.1"
readme = "README.md"
requires-python = ">=3.10,<3.13"
authors = [{ name = "The XpongeCPP contributors" }]
license = { text = "Apache License 2.0" }
keywords = ["molecular-dynamics", "molecular-mechanics", "Xponge-origin-1.7b11"]
keywords = ["molecular-dynamics", "molecular-mechanics", "Xponge-origin-1.7.1"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
Expand Down
2 changes: 1 addition & 1 deletion src/XpongeCPP/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def _get_molecule_charge(molecule):
from .legacy_types import _LegacyResidueTypeHandle
from .template_ops import load_mol2

__version__ = "0.2.7"
__version__ = "0.2.8"
__mokda_backend__ = "xpongecpp"
__implementation_version__ = __version__
pi = np.pi
Expand Down
33 changes: 33 additions & 0 deletions tests/test_compat_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,36 @@ def test_assign_legacy_atom_numbers_and_residuetype_aliases_match_old_mokda_usag

assert residue_type.name == "TES"
assert len(residue_type.atoms) == 1


def test_assign_resp_preserves_diagnostics_and_metadata_attributes(monkeypatch):
import Xponge
from XpongeCPP.assign import resp

assign = Xponge.Assign("RESP_ATTRIBUTES")
assign.add_atom("O", 0.0, 0.0, 0.0, name="O1")
diagnostics = {"max_constraint_residual": 0.0}
metadata = {"backend": "mock"}

def fake_resp_fit(*_args, **kwargs):
assert kwargs["return_diagnostics"] is True
assert kwargs["return_metadata"] is True
return {
"charges": [0.0],
"diagnostics": diagnostics,
"metadata": metadata,
}

monkeypatch.setattr(resp, "resp_fit", fake_resp_fit)

assign.calculate_charge(
"resp",
return_diagnostics=True,
return_metadata=True,
)

assert assign.charges == [0.0]
assert assign.charge_fit_diagnostics == diagnostics
assert assign.charge_fit_metadata == metadata
assign.legacy_extension = "available"
assert assign.legacy_extension == "available"
6 changes: 3 additions & 3 deletions tests/test_release_025.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Release-contract checks for the Xponge-origin 1.7b11 alignment."""
"""Release-contract checks for the Xponge-origin 1.7.1 alignment."""

from __future__ import annotations

Expand All @@ -18,8 +18,8 @@ def test_release_version_and_compatibility_target():
metadata = tomllib.loads(
(ROOT / "pyproject.toml").read_text(encoding="utf-8")
)["project"]
assert metadata["version"] == XpongeCPP.__version__ == "0.2.7"
assert "Xponge-origin 1.7b11" in metadata["description"]
assert metadata["version"] == XpongeCPP.__version__ == "0.2.8"
assert "Xponge-origin 1.7.1" in metadata["description"]
assert metadata["requires-python"] == ">=3.10,<3.13"


Expand Down
Loading