ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dfe_io_numpy.hpp File Reference

Write numpy-compatible .npy binary files. More...

#include <array>
#include <cstdint>
#include <fstream>
#include <string>
#include <tuple>
#include <utility>
+ Include dependency graph for dfe_io_numpy.hpp:

Go to the source code of this file.

Classes

class  dfe::NamedTupleNumpyWriter< NamedTuple >
 

Namespaces

namespace  dfe
 
namespace  dfe::io_npy_impl
 

Functions

template<typename... Types>
constexpr std::array< const
char *, sizeof...(Types)> 
dfe::io_npy_impl::dtypes_codes (const std::tuple< Types...> &)
 
char dfe::io_npy_impl::dtype_endianness_modifier ()
 
template<typename NamedTuple >
std::string dfe::io_npy_impl::dtypes_description (const NamedTuple &nt)
 

Variables

template<typename T >
constexpr std::enable_if_t
< false, T
dfe::io_npy_impl::kNumpyDtypeCode
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< uint8_t > = "u1"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< uint16_t > = "u2"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< uint32_t > = "u4"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< uint64_t > = "u8"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< int8_t > = "i1"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< int16_t > = "i2"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< int32_t > = "i4"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< int64_t > = "i8"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< float > = "f4"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< double > = "f8"
 
template<>
constexpr const char * dfe::io_npy_impl::kNumpyDtypeCode< bool > = "?"
 

Detailed Description

Write numpy-compatible .npy binary files.

Author
Moritz Kiehn msmk@.nosp@m.cern.nosp@m..ch
Date
2019-09-08, Split numpy i/o from the namedtuple library

Definition in file dfe_io_numpy.hpp.