Skip to content

Commit

Permalink
Import candidate for v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed Jun 6, 2023
1 parent befbb9b commit 1f0609e
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 28 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v1.6.2 2023-06-06
* Work again with latest numpy by removing usage of deprecated numpy.float
and numpy.int aliases (Thanks Milan Klausz and Jose Robledo, see also
github issue #72).

v1.6.1 2022-12-08
* Fixed mcplexample_pyread so it is able to work without the user setting
PYTHONPATH (this is still not very robust as it for now assumes that the
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif()

cmake_policy( SET CMP0048 NEW )#Not sure if this is really needed

project( MCPL VERSION 1.6.1 ${_project_metadata} )
project( MCPL VERSION 1.6.2 ${_project_metadata} )

unset( _project_metadata )

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1
1.6.2
6 changes: 3 additions & 3 deletions src/mcpl/mcpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

#define MCPL_VERSION_MAJOR 1
#define MCPL_VERSION_MINOR 6
#define MCPL_VERSION_PATCH 1
#define MCPL_VERSION 10601 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.1"
#define MCPL_VERSION_PATCH 2
#define MCPL_VERSION 10602 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.2"
#define MCPL_FORMATVERSION 3 /* Format version of written files */

#ifdef __cplusplus
Expand Down
8 changes: 4 additions & 4 deletions src/python/mcpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

__license__ = _str('CC0 1.0 Universal')
__copyright__ = _str('Copyright 2017-2022')
__version__ = _str('1.6.1')
__version__ = _str('1.6.2')
__status__ = _str('Production')
__author__ = _str('Thomas Kittelmann')
__maintainer__ = _str('Thomas Kittelmann')
Expand Down Expand Up @@ -848,7 +848,7 @@ def _loadhdr(self):
(nparticles,(ncomments,nblobs,opt_userflags,opt_polarisation,opt_singleprec),
opt_universalpdgcode,(particlesize,_tmp)) = y[0]
#convert all int types to python 'int' (which is 64bit), to avoid
#conversions like int+np.uint64->np.float64, and flags to bool:
#conversions like int+np.uint64->float, and flags to bool:
nparticles = int(nparticles)
self._np = nparticles#needs frequent access
particlesize = int(particlesize)
Expand Down Expand Up @@ -1268,7 +1268,7 @@ def _pdg_database(pdgcode):
def _unique_count(a,weights=None):
"""returns (unique,count) where unique is an array of sorted unique values in a, and count is the corresponding frequency counts"""
unique, inverse = np_unique(a, return_inverse=True)
count = np.zeros(len(unique), np.int if weights is None else np_dtype(type(weights[0])))
count = np.zeros(len(unique), int if weights is None else np_dtype(type(weights[0])))
_np_add_at(count, inverse, 1 if weights is None else weights)
return (unique, count)

Expand Down Expand Up @@ -1411,7 +1411,7 @@ def collect_stats(mcplfile,stats=_str('all'),bin_data=True):
ranges[s] = (ranges[s][0]-1.0,ranges[s][1]+1.0)

hists={}
freq_uc=dict((s,(np.asarray([],dtype=np.int),np.asarray([],dtype=np.float))) for s in freq_stats)
freq_uc=dict((s,(np.asarray([],dtype=int),np.asarray([],dtype=float))) for s in freq_stats)
if (std_stats and bin_data) or freq_stats:
#pass through and collect data:
if weight_sum is None:
Expand Down
6 changes: 3 additions & 3 deletions src_fat/mcpl2phits_app_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@

#define MCPL_VERSION_MAJOR 1
#define MCPL_VERSION_MINOR 6
#define MCPL_VERSION_PATCH 1
#define MCPL_VERSION 10601 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.1"
#define MCPL_VERSION_PATCH 2
#define MCPL_VERSION 10602 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.2"
#define MCPL_FORMATVERSION 3 /* Format version of written files */

#ifdef __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions src_fat/mcpl2ssw_app_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@

#define MCPL_VERSION_MAJOR 1
#define MCPL_VERSION_MINOR 6
#define MCPL_VERSION_PATCH 1
#define MCPL_VERSION 10601 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.1"
#define MCPL_VERSION_PATCH 2
#define MCPL_VERSION 10602 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.2"
#define MCPL_FORMATVERSION 3 /* Format version of written files */

#ifdef __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions src_fat/mcpltool_app_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@

#define MCPL_VERSION_MAJOR 1
#define MCPL_VERSION_MINOR 6
#define MCPL_VERSION_PATCH 1
#define MCPL_VERSION 10601 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.1"
#define MCPL_VERSION_PATCH 2
#define MCPL_VERSION 10602 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.2"
#define MCPL_FORMATVERSION 3 /* Format version of written files */

#ifdef __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions src_fat/phits2mcpl_app_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@

#define MCPL_VERSION_MAJOR 1
#define MCPL_VERSION_MINOR 6
#define MCPL_VERSION_PATCH 1
#define MCPL_VERSION 10601 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.1"
#define MCPL_VERSION_PATCH 2
#define MCPL_VERSION 10602 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.2"
#define MCPL_FORMATVERSION 3 /* Format version of written files */

#ifdef __cplusplus
Expand Down
8 changes: 4 additions & 4 deletions src_fat/pymcpltool
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ except SyntaxError:

__license__ = _str('CC0 1.0 Universal')
__copyright__ = _str('Copyright 2017-2022')
__version__ = _str('1.6.1')
__version__ = _str('1.6.2')
__status__ = _str('Production')
__author__ = _str('Thomas Kittelmann')
__maintainer__ = _str('Thomas Kittelmann')
Expand Down Expand Up @@ -848,7 +848,7 @@ class MCPLFile:
(nparticles,(ncomments,nblobs,opt_userflags,opt_polarisation,opt_singleprec),
opt_universalpdgcode,(particlesize,_tmp)) = y[0]
#convert all int types to python 'int' (which is 64bit), to avoid
#conversions like int+np.uint64->np.float64, and flags to bool:
#conversions like int+np.uint64->float, and flags to bool:
nparticles = int(nparticles)
self._np = nparticles#needs frequent access
particlesize = int(particlesize)
Expand Down Expand Up @@ -1268,7 +1268,7 @@ def _pdg_database(pdgcode):
def _unique_count(a,weights=None):
"""returns (unique,count) where unique is an array of sorted unique values in a, and count is the corresponding frequency counts"""
unique, inverse = np_unique(a, return_inverse=True)
count = np.zeros(len(unique), np.int if weights is None else np_dtype(type(weights[0])))
count = np.zeros(len(unique), int if weights is None else np_dtype(type(weights[0])))
_np_add_at(count, inverse, 1 if weights is None else weights)
return (unique, count)

Expand Down Expand Up @@ -1411,7 +1411,7 @@ def collect_stats(mcplfile,stats=_str('all'),bin_data=True):
ranges[s] = (ranges[s][0]-1.0,ranges[s][1]+1.0)

hists={}
freq_uc=dict((s,(np.asarray([],dtype=np.int),np.asarray([],dtype=np.float))) for s in freq_stats)
freq_uc=dict((s,(np.asarray([],dtype=int),np.asarray([],dtype=float))) for s in freq_stats)
if (std_stats and bin_data) or freq_stats:
#pass through and collect data:
if weight_sum is None:
Expand Down
6 changes: 3 additions & 3 deletions src_fat/ssw2mcpl_app_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@

#define MCPL_VERSION_MAJOR 1
#define MCPL_VERSION_MINOR 6
#define MCPL_VERSION_PATCH 1
#define MCPL_VERSION 10601 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.1"
#define MCPL_VERSION_PATCH 2
#define MCPL_VERSION 10602 /* (10000*MAJOR+100*MINOR+PATCH) */
#define MCPL_VERSION_STR "1.6.2"
#define MCPL_FORMATVERSION 3 /* Format version of written files */

#ifdef __cplusplus
Expand Down

0 comments on commit 1f0609e

Please sign in to comment.