Skip to content

Commit 066ab0c

Browse files
committed
ABI compat
1 parent 83158ff commit 066ab0c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies = [
2929
"numpy >= 1.22"
3030
]
3131

32-
version="1.5.1"
32+
version="1.5.2"
3333

3434
[project.optional-dependencies]
3535
test = [ ]

src/pdal/io/NumpyReader.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545

4646
#include "../plang/Environment.hpp"
4747

48+
#if NPY_ABI_VERSION < 0x02000000
49+
#define PyDataType_FIELDS(descr) ((descr)->fields)
50+
#define PyDataType_ELSIZE(descr) ((descr)->elsize)
51+
#endif
4852

4953
std::string toString(PyObject *pname)
5054
{

src/pdal/plang/Invocation.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ bool Invocation::execute(PointViewPtr& v, MetadataNode stageMetadata)
235235
}
236236

237237

238+
#if NPY_ABI_VERSION < 0x02000000
239+
#define PyDataType_FIELDS(descr) ((descr)->fields)
240+
#define PyDataType_ELSIZE(descr) ((descr)->elsize)
241+
#endif
242+
238243
// Returns a pointer to the data in Numpy array, 'array'.
239244
void *Invocation::extractArray(PyObject *array, std::string const& name,
240245
Dimension::Type t, size_t& num_elements)

0 commit comments

Comments
 (0)