Skip to content

Commit

Permalink
Merge pull request #28 from prisms-center/2.0a7
Browse files Browse the repository at this point in the history
2.0a7
  • Loading branch information
bpuchala authored Nov 14, 2023
2 parents 3ae434c + f956e38 commit 5bf9cfc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [2.0a7] - 2023-11-14

### Changed

- Add py::is_operator() in the bindings of the `__mul__` operators xtal.SymOp and xtal.IntegralSiteCoordinateRep so it possible to add `__rmul__` operators to classes in other modules.


## [2.0a6] - 2023-11-07

### Changed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "libcasm-xtal"
version = "2.0a6"
version = "2.0a7"
authors = [
{ name="CASM developers", email="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion python/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
# The short X.Y version.
version = "2.0"
# The full version, including alpha/beta/rc tags.
release = "2.0a6"
release = "2.0a7"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

__version__ = "2.0a6"
__version__ = "2.0a7"

# Available at setup time due to pyproject.toml
from pybind11.setup_helpers import Pybind11Extension, build_ext
Expand Down
19 changes: 12 additions & 7 deletions python/src/xtal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,8 @@ PYBIND11_MODULE(_xtal, m) {
return get_matrix(op) * coordinate_cart + get_translation(op);
},
py::arg("coordinate_cart"),
"Transform Cartesian coordinates, represented as a 1d array")
"Transform Cartesian coordinates, represented as a 1d array",
py::is_operator())
.def(
"__mul__",
[](xtal::SymOp const &op, Eigen::MatrixXd const &coordinate_cart) {
Expand All @@ -2116,34 +2117,37 @@ PYBIND11_MODULE(_xtal, m) {
},
py::arg("coordinate_cart"),
"Transform multiple Cartesian coordinates, represented as columns of "
"a matrix.")
"a matrix.",
py::is_operator())
.def(
"__mul__",
[](xtal::SymOp const &lhs, xtal::SymOp const &rhs) {
return lhs * rhs;
},
py::arg("rhs"),
"Construct the SymOp equivalent to applying first `rhs`, then this.")
"Construct the SymOp equivalent to applying first `rhs`, then this.",
py::is_operator())
.def(
"__mul__",
[](xtal::SymOp const &op,
std::map<std::string, Eigen::MatrixXd> const &properties) {
return copy_apply(op, properties);
},
py::arg("rhs"),
"Transform CASM-supported properties (local or global).")
"Transform CASM-supported properties (local or global).",
py::is_operator())
.def(
"__mul__",
[](xtal::SymOp const &op, xtal::Lattice const &lattice) {
return sym::copy_apply(op, lattice);
},
py::arg("lattice"), "Transform a Lattice.")
py::arg("lattice"), "Transform a Lattice.", py::is_operator())
.def(
"__mul__",
[](xtal::SymOp const &op, xtal::SimpleStructure const &simple) {
return copy_apply(op, simple);
},
py::arg("structure"), "Transform a Structure.")
py::arg("structure"), "Transform a Structure.", py::is_operator())
.def_static(
"from_dict",
[](const nlohmann::json &data) {
Expand Down Expand Up @@ -3199,7 +3203,8 @@ PYBIND11_MODULE(_xtal, m) {
return copy_apply(rep, integral_site_coordinate);
},
py::arg("integral_site_coordinate"),
"Transform an :class:`~libcasm.xtal.IntegralSiteCoordinate`");
"Transform an :class:`~libcasm.xtal.IntegralSiteCoordinate`",
py::is_operator());

m.def(
"apply",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="libcasm-xtal",
version="2.0a6",
version="2.0a7",
packages=["libcasm", "libcasm.xtal"],
package_dir={"": "python"},
cmake_install_dir="python/libcasm",
Expand Down

0 comments on commit 5bf9cfc

Please sign in to comment.