From fedc049ef6075591c2514e92b8496ea9c9e0af0b Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Sun, 24 Sep 2023 22:51:30 -0400 Subject: [PATCH] add example to pmcx.mcxlab(), bump pmcx to 0.2.2 --- pmcx/README.md | 8 +++++--- pmcx/pmcx/__init__.py | 2 +- pmcx/setup.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pmcx/README.md b/pmcx/README.md index a1bf7218..d82ad5dd 100644 --- a/pmcx/README.md +++ b/pmcx/README.md @@ -4,7 +4,7 @@ - Copyright: (C) Matin Raayai Ardakani (2022-2023) , Qianqian Fang (2019-2023) , Fan-Yu Yen (2023) - License: GNU Public License V3 or later -- Version: 0.2.1 +- Version: 0.2.2 - URL: https://pypi.org/project/pmcx/ - Github: https://github.com/fangq/mcx @@ -134,12 +134,14 @@ plt.show() ``` * Alternatively, one can also define a Python dict object containing each setting -as a key, and pass on the dict object to `pmcx.run()` +as a key, and pass on the dict object to `pmcx.run()`, or preferably, `pmcx.mcxlab()` ```python3 import pmcx import numpy as np cfg = {'nphoton': 1000000, 'vol':np.ones([60,60,60],dtype='uint8'), 'tstart':0, 'tend':5e-9, 'tstep':5e-9, 'srcpos': [30,30,0], 'srcdir':[0,0,1], 'prop':[[0,0,1,1],[0.005,1,0.01,1.37]]} -res = pmcx.run(cfg) +res = pmcx.run(cfg) # pmcx.run returns detected photon data as a concatenated 2D array res['detp'], same for res['traj'] +# or alternatively/preferably +res = pmcx.mcxlab(cfg) # pmcx.mcxlab calls pmcx.run, and postprocess res['detp'] and res['traj'] raw data into dict form ``` diff --git a/pmcx/pmcx/__init__.py b/pmcx/pmcx/__init__.py index 847ed5a9..b582bb80 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.2.1" +__version__ = "0.2.2" __all__ = ( "gpuinfo", diff --git a/pmcx/setup.py b/pmcx/setup.py index 5f96cad7..6a0561a1 100644 --- a/pmcx/setup.py +++ b/pmcx/setup.py @@ -119,7 +119,7 @@ def build_extension(self, ext): setup( name="pmcx", packages=['pmcx'], - version="0.2.1", + version="0.2.2", requires=['numpy'], license='GPLv3+', author="Matin Raayai Ardakani, Qianqian Fang, Fan-Yu Yen",