Classes | |
class | array_deleter |
Used as a std::shared_ptr deleter (second argument) to overload delete ptr with delete[] ptr . More... | |
struct | NameValuePair |
Typedefs | |
using | RecordLookup = std::vector< std::string > |
using | RecordLookupPtr = std::shared_ptr< RecordLookup > |
using | Parameters = std::map< std::string, std::string > |
using | TypeStrs = std::map< std::string, std::string > |
Enumerations | |
enum class | datetime_units { unknown = -1 , Y = 1 , M = 2 , W = 3 , D = 4 , h = 5 , m = 6 , s = 7 , ms = 8 , us = 9 , ns = 10 , ps = 11 , fs = 12 , as = 13 } |
Valid datetime units. Different units of two datetime type Arrays will be normalized to the smallest unit (== a larger enum value). More... | |
enum class | dtype { NOT_PRIMITIVE , boolean , int8 , int16 , int32 , int64 , uint8 , uint16 , uint32 , uint64 , float16 , float32 , float64 , float128 , complex64 , complex128 , complex256 , datetime64 , timedelta64 , size } |
NumPy dtypes that can be interpreted within Awkward C++ (only the primitive, fixed-width types). Non-native-endian types are considered NOT_PRIMITIVE. More... | |
enum class | ForthError { none , not_ready , is_done , user_halt , recursion_depth_exceeded , stack_underflow , stack_overflow , read_beyond , seek_beyond , skip_beyond , rewind_beyond , division_by_zero , varint_too_big , text_number_missing , quoted_string_missing , enumeration_missing , size } |
Exhaustive list of runtime errors possible in the ForthMachine. More... | |
Functions | |
const std::string | format_to_units (const std::string &format) |
Convert a format string into a datetime units string. | |
const std::string | units_to_format (dtype dt, const std::string &units, int64_t step) |
Convert a datetime units string into a format string. | |
template<class Mapping , class V > | |
std::string | name (Mapping a, V value) |
template<class Mapping > | |
Mapping::value_type::value_type | value (Mapping a, const std::string &name) |
std::tuple< std::string, int64_t > | datetime_data (const std::string &format) |
double | scale_from_units (const std::string &format, uint64_t index) |
dtype | name_to_dtype (const std::string &name) |
Returns the name associated with a given dtype. | |
const std::string | dtype_to_name (dtype dt) |
Returns the name associated with a given dtype. | |
dtype | format_to_dtype (const std::string &format, int64_t itemsize) |
Convert a NumPy format string and itemsize into a dtype enum. | |
const std::string | dtype_to_format (dtype dt, const std::string &format="") |
Convert a dtype enum into a NumPy format string. | |
int64_t | dtype_to_itemsize (dtype dt) |
Convert a dtype enum into an itemsize. | |
bool | is_integer (dtype dt) |
True if the dtype is a non-boolean integer (signed or unsigned). | |
bool | is_signed (dtype dt) |
True if the dtype is a signed integer. | |
bool | is_unsigned (dtype dt) |
True if the dtype is an unsigned integer. | |
bool | is_real (dtype dt) |
True if the dtype is a non-complex floating point number. | |
bool | is_complex (dtype dt) |
True if the dtype is a complex number. | |
void | handle_error (const struct Error &err, const std::string &classname=std::string("")) |
If the Error struct contains an error message (from a cpu-kernel through the C interface), raise that error as a C++ exception. | |
std::string | quote (const std::string &x) |
Puts quotation marks around a string and escapes the appropriate characters. | |
RecordLookupPtr | init_recordlookup (int64_t numfields) |
Initializes a RecordLookup by assigning each element with a string representation of its field index position. | |
int64_t | fieldindex (const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields) |
Returns the field index associated with a key, given a RecordLookup and a number of fields. | |
const std::string | key (const RecordLookupPtr &recordlookup, int64_t fieldindex, int64_t numfields) |
Returns the key associated with a field index, given a RecordLookup and a number of fields. | |
bool | haskey (const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields) |
Returns true if a RecordLookup has a given key ; false otherwise. | |
const std::vector< std::string > | keys (const RecordLookupPtr &recordlookup, int64_t numfields) |
Returns a given RecordLookup as keys or generate anonymous ones form a number of fields. | |
bool | json_equals (const std::string &myvalue, const std::string &value) |
Returns true if myvalue is equal to value when interpreted as JSON. | |
bool | parameter_equals (const Parameters ¶meters, const std::string &key, const std::string &value) |
Returns true if the value associated with a key in parameters is equal to the specified value . | |
bool | parameters_equal (const Parameters &self, const Parameters &other, bool check_all) |
Returns true if all key-value pairs in self is equal to all key-value pairs in other . | |
void | merge_parameters (Parameters &output, const Parameters &input) |
Merges a set of input parameters with output , keeping only those that are common to all sets. | |
bool | parameter_isstring (const Parameters ¶meters, const std::string &key) |
Returns true if the parameter associated with key is a string; false otherwise. | |
bool | parameter_isname (const Parameters ¶meters, const std::string &key) |
Returns true if the parameter associated with key is a string that matches [A-Za-z_][A-Za-z_0-9]* ; false otherwise. | |
const std::string | parameter_asstring (const Parameters ¶meters, const std::string &key) |
Returns the parameter associated with key as a string if parameter_isstring; raises an error otherwise. | |
std::string | gettypestr (const Parameters ¶meters, const TypeStrs &typestrs) |
Extracts a custom type string from typestrs if required by one of the parameters or an empty string if there is no match. | |
Variables | |
const std::array< const NameValuePair< datetime_units >, 14 > | units_map |
using Parameters = std::map<std::string, std::string> |
using RecordLookup = std::vector<std::string> |
using RecordLookupPtr = std::shared_ptr<RecordLookup> |
using TypeStrs = std::map<std::string, std::string> |
|
strong |
|
strong |
NumPy dtypes that can be interpreted within Awkward C++ (only the primitive, fixed-width types). Non-native-endian types are considered NOT_PRIMITIVE.
Enumerator | |
---|---|
NOT_PRIMITIVE | |
boolean | |
int8 | |
int16 | |
int32 | |
int64 | |
uint8 | |
uint16 | |
uint32 | |
uint64 | |
float16 | |
float32 | |
float64 | |
float128 | |
complex64 | |
complex128 | |
complex256 | |
datetime64 | |
timedelta64 | |
size |
|
strong |
Exhaustive list of runtime errors possible in the ForthMachine.
std::tuple< std::string, int64_t > datetime_data | ( | const std::string & | format | ) |
const std::string dtype_to_format | ( | dtype | dt, |
const std::string & | format = "" |
||
) |
Convert a dtype enum into a NumPy format string.
int64_t dtype_to_itemsize | ( | dtype | dt | ) |
Convert a dtype enum into an itemsize.
const std::string dtype_to_name | ( | dtype | dt | ) |
Returns the name associated with a given dtype.
int64_t fieldindex | ( | const RecordLookupPtr & | recordlookup, |
const std::string & | key, | ||
int64_t | numfields | ||
) |
Returns the field index associated with a key, given a RecordLookup and a number of fields.
dtype format_to_dtype | ( | const std::string & | format, |
int64_t | itemsize | ||
) |
Convert a NumPy format string and itemsize into a dtype enum.
const std::string format_to_units | ( | const std::string & | format | ) |
Convert a format string into a datetime units string.
std::string gettypestr | ( | const Parameters & | parameters, |
const TypeStrs & | typestrs | ||
) |
Extracts a custom type string from typestrs
if required by one of the parameters
or an empty string if there is no match.
void handle_error | ( | const struct Error & | err, |
const std::string & | classname = std::string("") |
||
) |
bool haskey | ( | const RecordLookupPtr & | recordlookup, |
const std::string & | key, | ||
int64_t | numfields | ||
) |
Returns true
if a RecordLookup has a given key
; false
otherwise.
RecordLookupPtr init_recordlookup | ( | int64_t | numfields | ) |
Initializes a RecordLookup by assigning each element with a string representation of its field index position.
For example, if numfields = 3
, the return value is ["0", "1", "2"]
.
bool is_complex | ( | dtype | dt | ) |
True if the dtype is a complex number.
bool is_integer | ( | dtype | dt | ) |
True if the dtype is a non-boolean integer (signed or unsigned).
bool is_real | ( | dtype | dt | ) |
True if the dtype is a non-complex floating point number.
bool is_signed | ( | dtype | dt | ) |
True if the dtype is a signed integer.
bool is_unsigned | ( | dtype | dt | ) |
True if the dtype is an unsigned integer.
bool json_equals | ( | const std::string & | myvalue, |
const std::string & | value | ||
) |
Returns true
if myvalue
is equal to value
when interpreted as JSON.
const std::string key | ( | const RecordLookupPtr & | recordlookup, |
int64_t | fieldindex, | ||
int64_t | numfields | ||
) |
Returns the key associated with a field index, given a RecordLookup and a number of fields.
const std::vector< std::string > keys | ( | const RecordLookupPtr & | recordlookup, |
int64_t | numfields | ||
) |
Returns a given RecordLookup as keys or generate anonymous ones form a number of fields.
void merge_parameters | ( | Parameters & | output, |
const Parameters & | input | ||
) |
Merges a set of input
parameters with output
, keeping only those that are common to all sets.
std::string name | ( | Mapping | a, |
V | value | ||
) |
dtype name_to_dtype | ( | const std::string & | name | ) |
Returns the name associated with a given dtype.
const std::string parameter_asstring | ( | const Parameters & | parameters, |
const std::string & | key | ||
) |
Returns the parameter associated with key
as a string if parameter_isstring; raises an error otherwise.
bool parameter_equals | ( | const Parameters & | parameters, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Returns true
if the value associated with a key
in parameters
is equal to the specified value
.
Keys are simple strings, but values are JSON-encoded strings. For this reason, values that represent single strings are double-quoted: e.g. "\"actual_value\""
.
bool parameter_isname | ( | const Parameters & | parameters, |
const std::string & | key | ||
) |
Returns true
if the parameter associated with key
is a string that matches [A-Za-z_][A-Za-z_0-9]*
; false
otherwise.
bool parameter_isstring | ( | const Parameters & | parameters, |
const std::string & | key | ||
) |
Returns true
if the parameter associated with key
is a string; false
otherwise.
bool parameters_equal | ( | const Parameters & | self, |
const Parameters & | other, | ||
bool | check_all | ||
) |
Returns true
if all key-value pairs in self
is equal to all key-value pairs in other
.
Keys are simple strings, but values are JSON-encoded strings. For this reason, values that represent single strings are double-quoted: e.g. "\"actual_value\""
.
If check_all
, every parameter is checked; otherwise, only "__array__"
and "__record__"
are checked.
std::string quote | ( | const std::string & | x | ) |
Puts quotation marks around a string and escapes the appropriate characters.
x | The string to quote. |
doublequote | If true , apply double-quotes ("</tt>); if <tt>false</tt>,
apply single-quotes (‘’`).
@note The implementation does not yet escape characters: it only adds
strings. See issue
<a href="https://github.com/scikit-hep/awkward-1.0/issues/186" >scikit-hep/awkward-1.0#186. |
double scale_from_units | ( | const std::string & | format, |
uint64_t | index | ||
) |
const std::string units_to_format | ( | dtype | dt, |
const std::string & | units, | ||
int64_t | step | ||
) |
Convert a datetime units string into a format string.
Mapping::value_type::value_type value | ( | Mapping | a, |
const std::string & | name | ||
) |
const std::array<const NameValuePair<datetime_units>, 14> units_map |