Skip to content

Commit a2f5836

Browse files
Bump toml11 to 4.4.0, nlohmann_json to 3.12.0 (#1842)
* Bump versions for toml11 nlohmann_json pybind11 * Return py::object instead of std::variant to pybind11
1 parent 63d3e07 commit a2f5836

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

cmake/dependencies/json.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ set(openPMD_json_src ""
5656
"Local path to nlohmann_json source directory (preferred if set)")
5757

5858
# tarball fetcher
59-
set(openPMD_json_tar "https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz"
59+
set(openPMD_json_tar "https://github.com/nlohmann/json/archive/refs/tags/v3.12.0.tar.gz"
6060
CACHE STRING
6161
"Remote tarball link to pull and build nlohmann_json from if(openPMD_USE_INTERNAL_JSON)")
62-
set(openPMD_json_tar_hash "SHA256=0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406"
62+
set(openPMD_json_tar_hash "SHA256=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187"
6363
CACHE STRING
6464
"Hash checksum of the tarball of nlohmann_json if(openPMD_USE_INTERNAL_JSON)")
6565

6666
# Git fetcher
6767
set(openPMD_json_repo "https://github.com/nlohmann/json.git"
6868
CACHE STRING
6969
"Repository URI to pull and build nlohmann_json from if(openPMD_USE_INTERNAL_JSON)")
70-
set(openPMD_json_branch "v3.11.3"
70+
set(openPMD_json_branch "v3.12.0"
7171
CACHE STRING
7272
"Repository branch for openPMD_json_repo if(openPMD_USE_INTERNAL_JSON)")
7373

cmake/dependencies/toml11.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ set(openPMD_toml11_src ""
6464
"Local path to toml11 source directory (preferred if set)")
6565

6666
# tarball fetcher
67-
set(openPMD_toml11_tar "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.2.0.tar.gz"
67+
set(openPMD_toml11_tar "https://github.com/ToruNiina/toml11/archive/refs/tags/v4.4.0.tar.gz"
6868
CACHE STRING
6969
"Remote tarball link to pull and build toml11 from if(openPMD_USE_INTERNAL_TOML11)")
70-
set(openPMD_toml11_tar_hash "SHA256=9287971cd4a1a3992ef37e7b95a3972d1ae56410e7f8e3f300727ab1d6c79c2c"
70+
set(openPMD_toml11_tar_hash "SHA256=815bfe6792aa11a13a133b86e7f0f45edc5d71eb78f5fb6686c49c7f792b9049"
7171
CACHE STRING
7272
"Hash checksum of the tarball of toml11 if(openPMD_USE_INTERNAL_TOML11)")
7373

7474
# Git fetcher
7575
set(openPMD_toml11_repo "https://github.com/ToruNiina/toml11.git"
7676
CACHE STRING
7777
"Repository URI to pull and build toml11 from if(openPMD_USE_INTERNAL_TOML11)")
78-
set(openPMD_toml11_branch "v3.7.1"
78+
set(openPMD_toml11_branch "v4.4.0"
7979
CACHE STRING
8080
"Repository branch for openPMD_toml11_repo if(openPMD_USE_INTERNAL_TOML11)")
8181

src/binding/python/Attributable.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,9 @@ void init_Attributable(py::module &m)
618618
"get_attribute",
619619
[](Attributable &attr, std::string const &key) {
620620
auto v = attr.getAttribute(key);
621-
return v.getVariant<attribute_types>();
621+
return std::visit(
622+
[](auto const &val) { return py::cast(val); },
623+
v.getVariant<attribute_types>());
622624
// TODO instead of returning lists, return all arrays (ndim > 0)
623625
// as numpy arrays?
624626
})

0 commit comments

Comments
 (0)