diff --git a/.github/workflows/header-only-test.yml b/.github/workflows/header-only-test.yml index 1b3ba57ff9..e6cba830e9 100644 --- a/.github/workflows/header-only-test.yml +++ b/.github/workflows/header-only-test.yml @@ -2,8 +2,8 @@ name: Header-only Tests on: pull_request: - # paths: - # - 'header-only' + paths: + - 'header-only' workflow_dispatch: diff --git a/header-only/layout-builder/awkward/LayoutBuilder.h b/header-only/layout-builder/awkward/LayoutBuilder.h index 08e08e73c5..e66e09785d 100644 --- a/header-only/layout-builder/awkward/LayoutBuilder.h +++ b/header-only/layout-builder/awkward/LayoutBuilder.h @@ -13,14 +13,14 @@ #include #include +/// @brief Object of {@link BuilderOptions BuilderOptions} which sets the +/// values of the default options. +#define AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS awkward::BuilderOptions(1024, 1) + namespace awkward { namespace LayoutBuilder { - /// @brief Object of {@link BuilderOptions BuilderOptions} which sets the - /// values of the default options. - awkward::BuilderOptions default_options(1024, 1); - /// @class Field /// /// @brief Helper class for sending a pair of field names (as enum) and field @@ -55,10 +55,10 @@ namespace awkward { class Numpy { public: /// @brief Creates a new Numpy layout builder by allocating a new buffer, - /// using `default_options` for initializing the buffer. + /// using `AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS` for initializing the buffer. Numpy() : data_( - awkward::GrowableBuffer(default_options)) { + awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)) { size_t id = 0; set_id(id); } @@ -210,10 +210,10 @@ namespace awkward { class ListOffset { public: /// @brief Creates a new ListOffset layout builder by allocating a new `offset` - /// buffer, using `default_options` for initializing the buffer. + /// buffer, using `AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS` for initializing the buffer. ListOffset() : offsets_( - awkward::GrowableBuffer(default_options)) { + awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)) { offsets_.append(0); size_t id = 0; set_id(id); @@ -415,7 +415,7 @@ namespace awkward { /// contents in the form of a JSON-like string. std::string form() const noexcept { - return "{ \"class\": \"EmptyArray\", \"parameters\": {} }"; + return "{ \"class\": \"EmptyArray\" }"; } private: @@ -1034,10 +1034,10 @@ namespace awkward { class IndexedOption { public: /// @brief Creates a new IndexedOption layout builder by allocating a new `index` - /// buffer, using `default_options` for initializing the buffer. + /// buffer, using `AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS` for initializing the buffer. IndexedOption() : index_( - awkward::GrowableBuffer(default_options)), + awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)), last_valid_(-1) { size_t id = 0; set_id(id); @@ -1358,9 +1358,9 @@ namespace awkward { class ByteMasked { public: /// @brief Creates a new ByteMasked layout builder by allocating a new `mask` - /// buffer, using `default_options` for initializing the buffer. + /// buffer, using `AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS` for initializing the buffer. ByteMasked() - : mask_(awkward::GrowableBuffer(default_options)) { + : mask_(awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)) { size_t id = 0; set_id(id); } @@ -1571,9 +1571,9 @@ namespace awkward { class BitMasked { public: /// @brief Creates a new BitMasked layout builder by allocating a new `mask` - /// buffer, using `default_options` for initializing the buffer. + /// buffer, using `AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS` for initializing the buffer. BitMasked() - : mask_(awkward::GrowableBuffer(default_options)), + : mask_(awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)), current_byte_(uint8_t(0)), current_byte_ref_(mask_.append_and_get_ref(current_byte_)), current_index_(0) { @@ -1877,10 +1877,10 @@ namespace awkward { using ContentType = std::tuple_element_t; /// @brief Creates a new Union layout builder by allocating new tags and - /// index buffers, using `default_options` for initializing the buffer. + /// index buffers, using `AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS` for initializing the buffer. Union() - : tags_(awkward::GrowableBuffer(default_options)), - index_(awkward::GrowableBuffer(default_options)) { + : tags_(awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)), + index_(awkward::GrowableBuffer(AWKWARD_LAYOUTBUILDER_DEFAULT_OPTIONS)) { size_t id = 0; set_id(id); for (size_t i = 0; i < contents_count_; i++) diff --git a/header-only/layout-builder/awkward/utils.h b/header-only/layout-builder/awkward/utils.h index f6df00a6d8..929c13774d 100644 --- a/header-only/layout-builder/awkward/utils.h +++ b/header-only/layout-builder/awkward/utils.h @@ -30,7 +30,7 @@ namespace awkward { /// @brief Returns the name of a primitive type as a string. template - const std::string + inline const std::string type_to_name() { if (is_integral_v) { if (is_signed_v) { @@ -81,7 +81,7 @@ namespace awkward { } template <> - const std::string + inline const std::string type_to_name() { // This takes precedence over the unspecialized template, and therefore any // 8-bit data that is not named bool will be mapped to "int8" or "uint8". @@ -89,7 +89,7 @@ namespace awkward { } template <> - const std::string + inline const std::string type_to_name() { // This takes precedence over the unspecialized template, and therefore any // 8-bit data that is not named char will be mapped to "int8" or "uint8". @@ -100,7 +100,7 @@ namespace awkward { /// @brief Returns `char` string when the primitive type /// is a character. template - const std::string + inline const std::string type_to_numpy_like() { return type_to_name(); } @@ -108,7 +108,7 @@ namespace awkward { /// @brief Returns numpy-like character code of a primitive /// type as a string. template <> - const std::string + inline const std::string type_to_numpy_like() { return "u8"; } @@ -116,7 +116,7 @@ namespace awkward { /// @brief Returns numpy-like character code `i8`, when the /// primitive type is an 8-bit signed integer. template <> - const std::string + inline const std::string type_to_numpy_like() { return "i8"; } @@ -124,7 +124,7 @@ namespace awkward { /// @brief Returns numpy-like character code `u32`, when the /// primitive type is a 32-bit unsigned integer. template <> - const std::string + inline const std::string type_to_numpy_like() { return "u32"; } @@ -132,7 +132,7 @@ namespace awkward { /// @brief Returns numpy-like character code `i32`, when the /// primitive type is a 32-bit signed integer. template <> - const std::string + inline const std::string type_to_numpy_like() { return "i32"; } @@ -140,7 +140,7 @@ namespace awkward { /// @brief Returns numpy-like character code `i64`, when the /// primitive type is a 64-bit signed integer. template <> - const std::string + inline const std::string type_to_numpy_like() { return "i64"; }