Skip to content

Commit d53ca6a

Browse files
authored
Merge pull request #50 from AdaptiveParticles/read_uint64
Allow detecting and reading uint64 particles
2 parents 757ee9e + 5f38417 commit d53ca6a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyapr/io/PyAPRFile.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ void AddPyAPRFile(pybind11::module &m, const std::string &modulename) {
7676
py::arg("particles_name"), py::arg("particles"), py::arg("apr_or_tree")=true, py::arg("t")=0, py::arg("channel_name")="t")
7777
.def("read_particles", &PyAPRFile::read_particles_py2<uint16_t>, "read particles from file",
7878
py::arg("particles_name"), py::arg("particles"), py::arg("apr_or_tree")=true, py::arg("t")=0, py::arg("channel_name")="t")
79+
.def("read_particles", &PyAPRFile::read_particles_py2<uint64_t>, "read particles from file",
80+
py::arg("particles_name"), py::arg("particles"), py::arg("apr_or_tree")=true, py::arg("t")=0, py::arg("channel_name")="t")
7981
.def("read_particles", &PyAPRFile::read_particles_py2<float>, "read particles from file",
8082
py::arg("particles_name"), py::arg("particles"), py::arg("apr_or_tree")=true, py::arg("t")=0, py::arg("channel_name")="t")
8183

pyapr/io/io_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ def initialize_particles_type(typestr):
122122
return pyapr.FloatParticles()
123123
if typestr == 'uint8':
124124
return pyapr.ByteParticles()
125+
if typestr == 'uint64':
126+
return pyapr.LongParticles()
125127

126-
print('deduced datatype {} is currently not supported - returning None'.format(typestr))
128+
print('Deducted datatype {} is currently not supported - returning None'.format(typestr))
127129
return None
128130

129131

0 commit comments

Comments
 (0)