From c03f98739328438a8bee76696af0fc6d1969e155 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Sun, 19 May 2024 21:56:24 -0500 Subject: [PATCH 1/2] bump up checkout action version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eff5ecc8..17ab0125 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup micromamba uses: conda-incubator/setup-miniconda@v3 with: From c70fd363926f49b11b6e75ddfe79fc844305a1c3 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Mon, 17 Jun 2024 17:16:36 -0500 Subject: [PATCH 2/2] use dtype's fields PyObject* now (#170) * use dtype's fields PyObject* now * bump version for this to 3.4.4 --- src/pdal/PyArray.cpp | 8 +++++--- src/pdal/__init__.py | 2 +- src/pdal/__main__.py | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pdal/PyArray.cpp b/src/pdal/PyArray.cpp index 66b6bd45..d3521173 100644 --- a/src/pdal/PyArray.cpp +++ b/src/pdal/PyArray.cpp @@ -97,9 +97,11 @@ Array::Array(PyArrayObject* array) : m_array(array), m_rowMajor(true) PyArray_Descr *dtype = PyArray_DTYPE(m_array); npy_intp ndims = PyArray_NDIM(m_array); npy_intp *shape = PyArray_SHAPE(m_array); - int numFields = (dtype->fields == Py_None) ? + + PyObject* fields = PyDataType_FIELDS(dtype); + int numFields = (fields == Py_None) ? 0 : - static_cast(PyDict_Size(dtype->fields)); + static_cast(PyDict_Size(fields)); int xyz = 0; if (numFields == 0) @@ -110,7 +112,7 @@ Array::Array(PyArrayObject* array) : m_array(array), m_rowMajor(true) } else { - PyObject *names_dict = dtype->fields; + PyObject *names_dict = fields; PyObject *names = PyDict_Keys(names_dict); PyObject *values = PyDict_Values(names_dict); if (!names || !values) diff --git a/src/pdal/__init__.py b/src/pdal/__init__.py index 5c2feabb..41b36121 100644 --- a/src/pdal/__init__.py +++ b/src/pdal/__init__.py @@ -1,5 +1,5 @@ __all__ = ["Pipeline", "Stage", "Reader", "Filter", "Writer", "dimensions", "info"] -__version__ = '3.4.3' +__version__ = '3.4.4' from . import libpdalpython from .drivers import inject_pdal_drivers diff --git a/src/pdal/__main__.py b/src/pdal/__main__.py index 8c85020c..4569e522 100644 --- a/src/pdal/__main__.py +++ b/src/pdal/__main__.py @@ -48,7 +48,10 @@ def print_version(args): line = '----------------------------------------------------------------------------------------------------------------------------\n' version = f'PDAL version {pdal_version}\nPython bindings version {__version__}\n' - plugin = f"Environment-set PDAL_DRIVER_PATH: {os.environ['PDAL_DRIVER_PATH']}" + driver_path = 'PDAL_DRIVER_PATH not set!' + if 'PDAL_DRIVER_PATH' in os.environ: + driver_path = os.environ['PDAL_DRIVER_PATH'] + plugin = f"Environment-set PDAL_DRIVER_PATH: {driver_path}" output = f'{line}{version}{plugin}\n{line}\n{debug}' print (output)