Skip to content

Commit 6b83dd5

Browse files
committed
add: comments for walkarounds, small fixes
1 parent 9c4788c commit 6b83dd5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/PyPartMC/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from contextlib import contextmanager
1111
from pathlib import Path
1212

13+
import nanobind
14+
1315

1416
# https://github.com/diegoferigo/cmake-build-extension/blob/master/src/cmake_build_extension/__init__.py
1517
@contextmanager
@@ -76,7 +78,5 @@ def __generate_si():
7678

7779
__version__ = importlib.metadata.version(__package__)
7880

79-
import nanobind
80-
81-
meta_cls = type(_PyPartMC.AeroData)
82-
setattr(nanobind, "nb_type_0", meta_cls)
81+
# walkaround for MATLAB bindings
82+
setattr(nanobind, "nb_type_0", type(_PyPartMC.AeroData))

src/pypartmc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "nanobind/stl/tuple.h"
1313
#include "nanobind/stl/detail/nb_optional.h"
1414
#include "nanobind/ndarray.h"
15-
#undef snprintf
15+
#undef snprintf // required to fix an issue with std::snprintf in nlohmann::json
1616
#include "nlohmann/json.hpp"
1717
#include "nanobind_json/nanobind_json.hpp"
1818
#include "sundials/sundials_config.h"

0 commit comments

Comments
 (0)