From d033755561e1954b22ca82dc3e3d9922966782ec Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Thu, 21 Nov 2024 01:51:31 -0500 Subject: [PATCH] [bug] apply patch in #235 to pmcx, bump pmcx to v0.3.6 --- pmcx/README.md | 2 +- pmcx/pmcx/__init__.py | 2 +- pmcx/setup.py | 2 +- src/pmcx.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pmcx/README.md b/pmcx/README.md index 06c44f27..5e243b47 100644 --- a/pmcx/README.md +++ b/pmcx/README.md @@ -4,7 +4,7 @@ - Copyright: (C) Matin Raayai Ardakani (2022-2023) , Qianqian Fang (2019-2024) , Fan-Yu Yen (2023-2024) - License: GNU Public License V3 or later -- Version: 0.3.5 +- Version: 0.3.6 - URL: https://pypi.org/project/pmcx/ - Github: https://github.com/fangq/mcx diff --git a/pmcx/pmcx/__init__.py b/pmcx/pmcx/__init__.py index 6761665b..2c64bb49 100644 --- a/pmcx/pmcx/__init__.py +++ b/pmcx/pmcx/__init__.py @@ -49,7 +49,7 @@ # from .files import loadmc2, loadmch, load, save from .bench import bench -__version__ = "0.3.5" +__version__ = "0.3.6" __all__ = ( "gpuinfo", diff --git a/pmcx/setup.py b/pmcx/setup.py index 71c1fe97..2fd5c22b 100644 --- a/pmcx/setup.py +++ b/pmcx/setup.py @@ -123,7 +123,7 @@ def build_extension(self, ext): setup( name="pmcx", packages=["pmcx"], - version="0.3.5", + version="0.3.6", requires=["numpy"], license="GPLv3+", author="Matin Raayai Ardakani, Qianqian Fang, Fan-Yu Yen", diff --git a/src/pmcx.cpp b/src/pmcx.cpp index 84b3ae4b..f9b78257 100644 --- a/src/pmcx.cpp +++ b/src/pmcx.cpp @@ -105,7 +105,7 @@ void parseVolume(const py::dict& user_cfg, Config& mcx_config) { free(mcx_config.vol); } - unsigned int dim_xyz = 0; + size_t dim_xyz = 0; // Data type-specific logic if (py::array_t::check_(volume_handle)) { @@ -1091,9 +1091,9 @@ py::dict pmcx_interface(const py::dict& user_cfg) { /** Initialize all buffers necessary to store the output variables */ if (mcx_config.issave2pt == 1) { - int field_len = + size_t field_len = static_cast(mcx_config.dim.x) * static_cast(mcx_config.dim.y) * static_cast(mcx_config.dim.z) * - (int) ((mcx_config.tend - mcx_config.tstart) / mcx_config.tstep + 0.5) * mcx_config.srcnum; + (size_t) ((mcx_config.tend - mcx_config.tstart) / mcx_config.tstep + 0.5) * mcx_config.srcnum; if (mcx_config.replay.seed != nullptr && mcx_config.replaydet == -1) { field_len *= mcx_config.detnum; @@ -1218,7 +1218,7 @@ py::dict pmcx_interface(const py::dict& user_cfg) { } if (mcx_config.issave2pt) { - int field_len; + size_t field_len; field_dim[0] = mcx_config.srcnum * mcx_config.dim.x; field_dim[1] = mcx_config.dim.y; field_dim[2] = mcx_config.dim.z;