Skip to content

Commit c52b2a4

Browse files
committed
fix metadata handling with PRV class
1 parent d659d4d commit c52b2a4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

pypop/prv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def _write_binarycache(self):
278278

279279
for evtkey, evtvals in self.event_vals.items():
280280
hdfstore.put(
281-
"".join([self._eventvaluekey, evtkey]),
281+
"".join([self._eventvaluekey, str(evtkey)]),
282282
pd.Series(evtvals),
283283
format="t",
284284
)

pypop/trace/tracemetadata.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class TraceMetadata:
2828
_tracesubclasskey: str,
2929
"capture_time": str,
3030
"elapsed_seconds": numpy.float64,
31-
"num_nodes": numpy.int64,
32-
"cores_per_node": numpy.int64,
33-
"num_processes": numpy.int64,
34-
"threads_per_process": numpy.int64,
31+
"num_nodes": int,
32+
"cores_per_node": int,
33+
"num_processes": int,
34+
"threads_per_process": int,
3535
# "layout": str,
3636
"tracefile_name": str,
3737
"fingerprint": str,
@@ -105,11 +105,15 @@ def unpack_layout(packed, vartype):
105105

106106
@staticmethod
107107
def pack_threads_per_process(data, dtype):
108-
return pandas.Series(data=data, dtype=dtype)
108+
data = "|".join(str(x) for x in data)
109+
return pandas.Series(data=data, dtype=str)
109110

110111
@staticmethod
111112
def unpack_threads_per_process(data, dtype):
112-
return list(data)
113+
try:
114+
return [dtype(x) for x in data[0].split("|")]
115+
except AttributeError:
116+
return list(data)
113117

114118
def __bool__(self):
115119
return self.fingerprint is not None

0 commit comments

Comments
 (0)