Skip to content

Commit

Permalink
changed np array back to list, since array couldn't handle input of d…
Browse files Browse the repository at this point in the history
…ifferent sizes
  • Loading branch information
reinhold-willcox committed Dec 5, 2023
1 parent d9e8299 commit 65ffbb5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions misc/unsupported_utils/compasUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@


########################################################################
# ##
# ## Function to print the data from a given COMPAS HDF5 group
# ## in a readable pandas template
# ##
# #######################################################################
###
### Function to print the data from a given COMPAS HDF5 group
### in a readable pandas template
###
########################################################################

def printCompasDetails(data, *seeds, mask=()):
"""
Expand Down Expand Up @@ -64,10 +64,10 @@ def convert_strings(param_array):


########################################################################
# ##
# ## Get event histories of MT data, SN data, and combined MT, SN data
# ##
# #######################################################################
###
### Get event histories of MT data, SN data, and combined MT, SN data
###
########################################################################

def getMtEvents(MT):
"""
Expand Down Expand Up @@ -230,9 +230,8 @@ def getEventHistory(h5file, exclude_null=False):
seedsToIterate = allSeeds

idxOrdered = np.argsort(seedsToIterate)
# set arrays of dummy value -1
returnedSeeds = np.empty(seedsToIterate.shape) # array of seeds - will only contain seeds that have events (of any type)
returnedEvents = np.empty(seedsToIterate.shape) # array of seeds - will only contain seeds that have events (of any type)
returnedSeeds = [None] * np.size(seedsToIterate) # array of seeds - will only contain seeds that have events (of any type)
returnedEvents = [None] * np.size(seedsToIterate) # array of events - same size as returnedSeeds (includes event times)

for idx in idxOrdered:
seed = seedsToIterate[idx]
Expand All @@ -258,6 +257,7 @@ def getEventHistory(h5file, exclude_null=False):
return returnedSeeds, returnedEvents # see above for details



###########################################
###
### Produce strings of the event histories
Expand Down

0 comments on commit 65ffbb5

Please sign in to comment.