EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/sPHENIX/thirdparty/dfelibs/dfe/dfe_io_numpy.hpp>
Public Member Functions | |
NamedTupleNumpyWriter ()=delete | |
NamedTupleNumpyWriter (const NamedTupleNumpyWriter &)=delete | |
NamedTupleNumpyWriter (NamedTupleNumpyWriter &&)=default | |
~NamedTupleNumpyWriter () | |
NamedTupleNumpyWriter & | operator= (const NamedTupleNumpyWriter &)=delete |
NamedTupleNumpyWriter & | operator= (NamedTupleNumpyWriter &&)=default |
NamedTupleNumpyWriter (const std::string &path) | |
Create a npy file at the given path. Overwrites existing data. | |
void | append (const NamedTuple &record) |
Append a record to the end of the file. | |
Private Types | |
using | Tuple = typename NamedTuple::Tuple |
Private Member Functions | |
void | write_header (std::size_t num_tuples) |
template<std::size_t... I> | |
void | write_record (const NamedTuple &record, std::index_sequence< I...>) |
template<typename T > | |
void | write_bytes (const T *ptr) |
Private Attributes | |
std::ofstream | m_file |
std::size_t | m_fixed_header_length |
std::size_t | m_num_tuples |
Write records into a binary NumPy-compatible .npy
file.
See https://docs.scipy.org/doc/numpy/reference/generated/numpy.lib.format.html for an explanation of the file format.
Definition at line 44 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 44 of file dfe_io_numpy.hpp
|
private |
Definition at line 61 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 61 of file dfe_io_numpy.hpp
|
delete |
|
delete |
|
default |
|
inline |
Definition at line 169 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 169 of file dfe_io_numpy.hpp
|
inline |
Create a npy file at the given path. Overwrites existing data.
Definition at line 154 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 154 of file dfe_io_numpy.hpp
References dfe::NamedTupleNumpyWriter< NamedTuple >::m_file, and dfe::NamedTupleNumpyWriter< NamedTuple >::write_header().
|
inline |
Append a record to the end of the file.
Definition at line 179 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 179 of file dfe_io_numpy.hpp
References value.
|
delete |
|
default |
|
inlineprivate |
Definition at line 241 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 241 of file dfe_io_numpy.hpp
References T.
|
inlineprivate |
Definition at line 187 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 187 of file dfe_io_numpy.hpp
References dfe::io_npy_impl::dtypes_description(), and nlohmann::to_string().
Referenced by dfe::NamedTupleNumpyWriter< NamedTuple >::NamedTupleNumpyWriter().
|
inlineprivate |
Definition at line 230 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 230 of file dfe_io_numpy.hpp
References nlohmann::detail::get(), and nlohmann::detail::void().
|
private |
Definition at line 63 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 63 of file dfe_io_numpy.hpp
Referenced by dfe::NamedTupleNumpyWriter< NamedTuple >::NamedTupleNumpyWriter().
|
private |
Definition at line 64 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 64 of file dfe_io_numpy.hpp
|
private |
Definition at line 65 of file dfe_io_numpy.hpp.
View newest version in sPHENIX GitHub at line 65 of file dfe_io_numpy.hpp