From e9838d13731b241ca695f138d8889b888a79ecc8 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Mon, 6 Oct 2025 14:40:22 -0400 Subject: [PATCH] feat(libcomposition): version bump to libcomposition 1.8.0 bumped version to libcomposition version with proper Ye handling and fixed conversion from number fraction to mass fraction --- meson.build | 2 +- src-pybind/composition/bindings.cpp | 10 +++------- src-pybind/composition/bindings.h | 2 +- subprojects/libcomposition.wrap | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 794929a..4137d6f 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('fourdst', 'cpp', version: 'v0.8.0', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') +project('fourdst', 'cpp', version: 'v0.8.1', default_options: ['cpp_std=c++23'], meson_version: '>=1.5.0') add_project_arguments('-fvisibility=default', language: 'cpp') diff --git a/src-pybind/composition/bindings.cpp b/src-pybind/composition/bindings.cpp index 939bf25..b825388 100644 --- a/src-pybind/composition/bindings.cpp +++ b/src-pybind/composition/bindings.cpp @@ -1,6 +1,6 @@ #include #include // Needed for vectors, maps, sets, strings -#include // Needed for binding std::vector, std::map etc if needed directly +#include // Needed for binding std::vector, std::map etc. if needed directly #include @@ -29,7 +29,7 @@ void register_comp_bindings(const pybind11::module &comp_submodule) { .def_readonly("X", &fourdst::composition::CanonicalComposition::X) .def_readonly("Y", &fourdst::composition::CanonicalComposition::Y) .def_readonly("Z", &fourdst::composition::CanonicalComposition::Z) - .def("__repr__", // Add a string representation for easy printing in Python) + .def("__repr__", // Add a string representation for easy printing in Python [](const fourdst::composition::CanonicalComposition &cc) { return "(&fourdst::composition::CompositionEntry::mass_fraction, py::const_), "Gets the mass fraction of the species.") - .def("mass_fraction", - py::overload_cast(&fourdst::composition::CompositionEntry::mass_fraction, py::const_), - py::arg("meanMolarMass"), // Name the argument in Python - "Gets the mass fraction of the species given the mean molar mass.") .def("number_fraction", py::overload_cast<>(&fourdst::composition::CompositionEntry::number_fraction, py::const_), "Gets the number fraction of the species.") @@ -194,7 +190,7 @@ void register_comp_bindings(const pybind11::module &comp_submodule) { } -void register_species_bindings(pybind11::module &chem_submodule) { +void register_species_bindings(const pybind11::module &chem_submodule) { // --- Bindings for species module --- py::class_(chem_submodule, "Species") .def("mass", &fourdst::atomic::Species::mass, "Get atomic mass (amu)") diff --git a/src-pybind/composition/bindings.h b/src-pybind/composition/bindings.h index c7a201f..2706351 100644 --- a/src-pybind/composition/bindings.h +++ b/src-pybind/composition/bindings.h @@ -3,4 +3,4 @@ #include void register_comp_bindings(const pybind11::module &m); -void register_species_bindings(pybind11::module &m); +void register_species_bindings(const pybind11::module &m); diff --git a/subprojects/libcomposition.wrap b/subprojects/libcomposition.wrap index 45b1390..177a9e1 100644 --- a/subprojects/libcomposition.wrap +++ b/subprojects/libcomposition.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://github.com/4D-STAR/libcomposition.git -revision = v1.7.0 +revision = v1.8.0 depth = 1