From 0896666f9292cbded2bec25ed00ef7ebd0f2b883 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 3 Dec 2025 10:59:36 +0000 Subject: [PATCH 1/7] change asserts to not throw clang warnings --- expui/BiorthBasis.cc | 1 + expui/CoefStruct.cc | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index 3b0e3bef2..6ffb82db5 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -1658,6 +1658,7 @@ namespace BasisClasses case DiskType::doubleexpon: case DiskType::exponential: case DiskType::diskbulge: + default: std::cout << "---- pyEXP uses sech^2(z/h) rather than the more common sech^2(z/(2h))" << std::endl << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl << "---- pyEXP will assume sech^2(z/(2h)) by default in v 7.9.0 and later" << std::endl; diff --git a/expui/CoefStruct.cc b/expui/CoefStruct.cc index 786c4eaa3..7baaff24c 100644 --- a/expui/CoefStruct.cc +++ b/expui/CoefStruct.cc @@ -110,8 +110,7 @@ namespace CoefClasses copyfields(ret); - assert(("CylStruct::deepcopy dimension mismatch", - (mmax+1)*nmax == store.size())); + assert((mmax+1)*nmax == store.size() && "CylStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared(ret->store.data(), mmax+1, nmax); @@ -128,8 +127,7 @@ namespace CoefClasses copyfields(ret); - assert(("SphStruct::deepcopy dimension mismatch", - (lmax+1)*(lmax+2)/2*nmax == store.size())); + assert((lmax+1)*(lmax+2)/2*nmax == store.size() && "SphStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared @@ -149,7 +147,7 @@ namespace CoefClasses copyfields(ret); - assert(("SlabStruct::deepcopy dimension mismatch", dim == store.size())); + assert((dim == store.size()) && "SlabStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared(ret->store.data(), nx, ny, nz); @@ -171,7 +169,7 @@ namespace CoefClasses copyfields(ret); - assert(("CubeStruct::deepcopy dimension mismatch", dim == store.size())); + assert((dim == store.size()) && "CubeStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared(ret->store.data(), nx, ny, nz); @@ -193,8 +191,7 @@ namespace CoefClasses copyfields(ret); - assert(("TblStruct::deepcopy dimension mismatch", - cols == store.size())); + assert((cols == store.size()) && "TblStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared(ret->store.data(), cols); @@ -209,8 +206,7 @@ namespace CoefClasses copyfields(ret); - assert(("TrajStruct::deepcopy dimension mismatch", - traj*rank == store.size())); + assert((traj*rank == store.size()) && "TrajStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared(ret->store.data(), traj, rank); @@ -226,8 +222,7 @@ namespace CoefClasses copyfields(ret); - assert(("SphFldStruct::deepcopy dimension mismatch", - nfld*(lmax+1)*(lmax+2)/2*nmax == store.size())); + assert(nfld*(lmax+1)*(lmax+2)/2*nmax == store.size() && "SphFldStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared @@ -246,8 +241,7 @@ namespace CoefClasses copyfields(ret); - assert(("CylFldStruct::deepcopy dimension mismatch", - nfld*(mmax+1)*nmax == store.size())); + assert((nfld*(mmax+1)*nmax == store.size()) && "CylFldStruct::deepcopy dimension mismatch"); ret->C = C; ret->coefs = std::make_shared From c3cba299021bf7167d3a141a10740bc81032d906 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 3 Dec 2025 11:29:01 +0000 Subject: [PATCH 2/7] fix enum default; clean up deprecations --- expui/BiorthBasis.H | 2 +- expui/BiorthBasis.cc | 8 +++++--- exputil/EmpCylSL.cc | 4 ++-- src/Cylinder.H | 2 +- src/Cylinder.cc | 6 +++--- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/expui/BiorthBasis.H b/expui/BiorthBasis.H index dba7b1671..f40875985 100644 --- a/expui/BiorthBasis.H +++ b/expui/BiorthBasis.H @@ -969,7 +969,7 @@ namespace BasisClasses int ncylodd, ncylnx, ncylny, ncylr, cmap, cmapR, cmapZ, vflag; int rnum, pnum, tnum; double rcylmin, rcylmax, acyl, hcyl; - bool expcond, logarithmic, density, EVEN_M, sech2 = false; + bool expcond, logarithmic, density, EVEN_M, sech2 = true; std::vector potd, dpot, dpt2, dend; std::vector legs, dlegs, d2legs; diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index 6ffb82db5..d8574afcb 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -1658,10 +1658,12 @@ namespace BasisClasses case DiskType::doubleexpon: case DiskType::exponential: case DiskType::diskbulge: + std::cout << "---- pyEXP assumes sech^2(z/(2h)) by default in v7.9.0 and later" << std::endl + << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl + << "---- This warning will be removed in v7.10.0." << std::endl; + break; default: - std::cout << "---- pyEXP uses sech^2(z/h) rather than the more common sech^2(z/(2h))" << std::endl - << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl - << "---- pyEXP will assume sech^2(z/(2h)) by default in v 7.9.0 and later" << std::endl; + break; } } } diff --git a/exputil/EmpCylSL.cc b/exputil/EmpCylSL.cc index b99ddbb3e..a89afa68e 100644 --- a/exputil/EmpCylSL.cc +++ b/exputil/EmpCylSL.cc @@ -267,7 +267,7 @@ EmpCylSL::EmpCylSL(int mlim, std::string cachename) if (myid==0) std::cout << "---- EmpCylSL::ReadH5Cache: " << "using a workaround for a HighFive HDF5 wrapper bug. " - << "this workaround will be removed in EXP 7.9.0. " + << "this workaround will be removed in EXP 7.10.0. " << "Please consider rebuilding your cache if possible!" << std::endl; } @@ -7502,7 +7502,7 @@ bool EmpCylSL::ReadH5Cache() if (myid==0) std::cout << "---- EmpCylSL::ReadH5Cache: " << "using a workaround for a HighFive HDF5 wrapper bug. " - << "this workaround will be removed in EXP 7.9.0. " + << "this workaround will be removed in EXP 7.10.0. " << "Please consider rebuilding your cache if possible!" << std::endl; } else { diff --git a/src/Cylinder.H b/src/Cylinder.H index 0b39901e6..d7fcac153 100644 --- a/src/Cylinder.H +++ b/src/Cylinder.H @@ -127,7 +127,7 @@ class Cylinder : public Basis { private: - bool precond, EVEN_M, subsamp, sech2 = false; + bool precond, EVEN_M, subsamp, sech2 = true; int rnum, pnum, tnum; double ashift; unsigned int vflag; diff --git a/src/Cylinder.cc b/src/Cylinder.cc index b33e5132e..b894cbaf9 100644 --- a/src/Cylinder.cc +++ b/src/Cylinder.cc @@ -461,9 +461,9 @@ void Cylinder::initialize() // Deprecation warning if (not sech2 and not conf["pyname"]) { if (myid==0) - std::cout << "---- Cylinder uses sech^2(z/h) rather than the more common sech^2(z/(2h))" << std::endl - << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl - << "---- Cylinder will assume sech^2(z/(2h)) by default in v 7.9.0 and later" << std::endl; + std::cout << "---- Cylinder assumes sech^2(z/(2h)) by default in v7.9.0 and later" << std::endl + << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl + << "---- This warning will be removed in v7.10.0." << std::endl; } // Deprecation warning From 9f3c0ea002d447fe41d75b12d436858ff636236c Mon Sep 17 00:00:00 2001 From: Michael Petersen Date: Wed, 3 Dec 2025 11:36:11 +0000 Subject: [PATCH 3/7] Update src/Cylinder.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Cylinder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cylinder.cc b/src/Cylinder.cc index b894cbaf9..448a5f769 100644 --- a/src/Cylinder.cc +++ b/src/Cylinder.cc @@ -462,8 +462,8 @@ void Cylinder::initialize() if (not sech2 and not conf["pyname"]) { if (myid==0) std::cout << "---- Cylinder assumes sech^2(z/(2h)) by default in v7.9.0 and later" << std::endl - << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl - << "---- This warning will be removed in v7.10.0." << std::endl; + << "---- Use the 'sech2: true' in your YAML config to use sech^2(z/(2h))" << std::endl + << "---- This warning will be removed in v7.10.0." << std::endl; } // Deprecation warning From faaa08c29afcc7899eb978da2e85c3fad8ebe454 Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 3 Dec 2025 12:04:48 +0000 Subject: [PATCH 4/7] fix version number; fix doc typo --- CMakeLists.txt | 2 +- pyEXP/CoefWrappers.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7926ab243..1e0ecc5bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25) # Needed for CUDA, MPI, and CTest features project( EXP - VERSION "7.9.1" + VERSION "7.9.0" HOMEPAGE_URL https://github.com/EXP-code/EXP LANGUAGES C CXX Fortran) diff --git a/pyEXP/CoefWrappers.cc b/pyEXP/CoefWrappers.cc index d8dead5ec..d81054bb1 100644 --- a/pyEXP/CoefWrappers.cc +++ b/pyEXP/CoefWrappers.cc @@ -1281,7 +1281,7 @@ void CoefficientClasses(py::module &m) { .def("WriteH5Coefs", [](CoefClasses::Coefs& self, const std::string& filename) { if (self.getUnits().size()!=4) { - std::cout << "Coefs::WriteH5Coefs: please set units for your coefficient set using the `setUnit()` member," << std::endl + std::cout << "Coefs::WriteH5Coefs: please set units for your coefficient set using the `setUnits()` member," << std::endl << " one for each unit. We suggest explicitly setting 'G', 'Length', 'Mass'," << std::endl << " 'Time', or optionally 'Velocity' before writing HDF5 coefficients" << std::endl; } From b91b964fd42d95ddd74b16fa42eab2be1a3a751b Mon Sep 17 00:00:00 2001 From: michael-petersen Date: Wed, 3 Dec 2025 14:34:23 +0000 Subject: [PATCH 5/7] restore intended behaviour? --- pyEXP/BasisWrappers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyEXP/BasisWrappers.cc b/pyEXP/BasisWrappers.cc index 79a4e2f0d..f16390a64 100644 --- a/pyEXP/BasisWrappers.cc +++ b/pyEXP/BasisWrappers.cc @@ -906,7 +906,7 @@ void BasisFactoryClasses(py::module &m) py::class_, PyBasis> (m, "Basis") - .def("factory", &BasisClasses::BiorthBasis::factory_string, + .def("factory", &BasisClasses::Basis::factory_string, R"( Generate a basis from a YAML configuration supplied as a string From 4c9000a74137e4e0d5737b0007d90cfd72e0adf3 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Wed, 3 Dec 2025 22:37:01 -0500 Subject: [PATCH 6/7] Made a virtual boolean member function to request populated Unit checking; the request is _on_ by default and is _off_ for non-biorthogonal field classes. --- expui/Coefficients.H | 15 +++++++++++++++ expui/Coefficients.cc | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/expui/Coefficients.H b/expui/Coefficients.H index 98fbed4f6..061f42ac9 100644 --- a/expui/Coefficients.H +++ b/expui/Coefficients.H @@ -120,6 +120,9 @@ namespace CoefClasses //! Unit validator static UnitValidator check; + //! Units required for HDF5 + virtual bool unitsRequired() { return true; } + public: //! Constructor @@ -849,6 +852,9 @@ namespace CoefClasses //! Write coefficient data in H5 virtual unsigned WriteH5Times(HighFive::Group& group, unsigned count); + //! Units required for HDF5 + virtual bool unitsRequired() { return false; } + public: //! Constructor @@ -955,6 +961,9 @@ namespace CoefClasses //! Write coefficient data in H5 virtual unsigned WriteH5Times(HighFive::Group& group, unsigned count); + //! Units required for HDF5 + virtual bool unitsRequired() { return false; } + public: //! Constructor @@ -1066,6 +1075,9 @@ namespace CoefClasses //! Write coefficient data in H5 virtual unsigned WriteH5Times(HighFive::Group& group, unsigned count); + //! Units required for HDF5 + virtual bool unitsRequired() { return false; } + public: //! Constructor @@ -1193,6 +1205,9 @@ namespace CoefClasses //! Write coefficient data in H5 virtual unsigned WriteH5Times(HighFive::Group& group, unsigned count); + //! Units required for HDF5 + virtual bool unitsRequired() { return false; } + public: //! Constructor diff --git a/expui/Coefficients.cc b/expui/Coefficients.cc index 77b9b68a0..dc7444dca 100644 --- a/expui/Coefficients.cc +++ b/expui/Coefficients.cc @@ -151,7 +151,7 @@ namespace CoefClasses void Coefs::WriteH5Units(HighFive::File& file) { - if (units.size() != 4) { + if (unitsRequired() and units.size() != 4) { std::ostringstream sout; sout << "---- Coefs::WriteH5Units: Warning, expected 4 units: " << "(length, mass, time, G) or (length, mass, velocity, G), etc. " From c1cd3a965f8fe81bc0985477196ff0f88d8df46b Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Mon, 8 Dec 2025 11:28:17 -0500 Subject: [PATCH 7/7] Updated OutVel for the recently changed FieldBasis::accumulate() call signature --- src/OutVel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OutVel.cc b/src/OutVel.cc index 5d4830d1c..8f3a6447d 100644 --- a/src/OutVel.cc +++ b/src/OutVel.cc @@ -186,7 +186,7 @@ void OutVel::Run(int n, int mstep, bool last) double v = it->second->vel[1]; double w = it->second->vel[2]; - basis->accumulate(M, x, y, z, u, v, w); + basis->accumulate(x, y, z, u, v, w, M); } } }