Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builder options and layout builder updates #1560

Merged
merged 12 commits into from
Jul 28, 2022
Merged

Conversation

ianna
Copy link
Collaborator

@ianna ianna commented Jul 22, 2022

ArrayBuilder, LayoutBuilder, and GrowableBuffer are using BuildOptions now. There two options defined at the moment - an initial which is int64_t and a resize factor which is double. The Options is a tuple and can accept other parameters. A test is added.

This PR also drops requirements on C++ version for LayoutBuilder from C++17 to C++14. Both GrowableBuffer and BuildOptions can be used with C++11.

BitMasked mask is fixed.

@ianna ianna marked this pull request as draft July 22, 2022 15:49
@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #1560 (65a73ee) into main (78a6535) will increase coverage by 0.24%.
The diff coverage is 73.86%.

Impacted Files Coverage Δ
src/awkward/_v2/contents/indexedoptionarray.py 89.14% <54.54%> (-0.70%) ⬇️
src/awkward/_v2/highlevel.py 70.77% <57.60%> (-2.76%) ⬇️
src/awkward/_v2/operations/ak_from_parquet.py 87.02% <88.09%> (+37.87%) ⬆️
src/awkward/_v2/operations/ak_to_parquet.py 51.02% <95.23%> (+3.02%) ⬆️
src/awkward/_v2/_connect/numba/arrayview.py 96.76% <100.00%> (ø)
src/awkward/_v2/contents/content.py 76.61% <100.00%> (ø)
src/awkward/_v2/operations/ak_copy.py 100.00% <100.00%> (ø)
src/awkward/_v2/operations/ak_is_none.py 96.55% <100.00%> (+0.39%) ⬆️
...awkward/_v2/operations/ak_metadata_from_parquet.py 100.00% <100.00%> (+68.42%) ⬆️
src/awkward/_v2/record.py 77.53% <100.00%> (+0.49%) ⬆️
... and 21 more

@ianna ianna requested a review from jpivarski July 25, 2022 21:06
@ianna ianna marked this pull request as ready for review July 25, 2022 21:06
@ianna
Copy link
Collaborator Author

ianna commented Jul 25, 2022

@jpivarski - please, check when you have time. Thanks!

@ianna ianna mentioned this pull request Jul 25, 2022
15 tasks
@ianna ianna marked this pull request as draft July 26, 2022 07:01
@ianna ianna force-pushed the ianna/array-builder-options branch from 647d0d2 to 3d16a35 Compare July 26, 2022 07:19
@ianna ianna marked this pull request as ready for review July 26, 2022 16:35
@ianna ianna changed the title restore array builder options builder options and layout builder updates Jul 27, 2022
@ianna
Copy link
Collaborator Author

ianna commented Jul 27, 2022

@jpivarski - this PR is complete. Please, check when you have time. Thanks.

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, this PR does a few things:

  • It passes BuilderOptions through a lot of constructors, rather than a single integer (initial). That will allow us to expand the options, such as a distinction between the initial GrowableBuffer panel size and subsequent ones. (We'll want to make those arguments not template parameters in LayoutBuilder, since I doubt an object like BuilderOptions can be a compile-time constant. If LayoutBuilder needs to have a default constructor, maybe the default constructor can supply default BuilderOptions?) I see that you did that already.
  • Various clean-ups, which cause indentation diffs.

On closer inspection, it looks to me like the only substantial change is that initialoptions, with all the supporting changes that needs. Is this right? (Have I missed anything?)

The only thing I would say needs to be changed is that a C++ user sees these options with a class name like awkward::BuilderOptions, not awkward::Options, because these options are specifically for builders.

src/awkward/_v2/cpp-headers/awkward/GrowableBuffer.h Outdated Show resolved Hide resolved
tests-cpp/test_1560-builder-options.cpp Outdated Show resolved Hide resolved
@ianna
Copy link
Collaborator Author

ianna commented Jul 28, 2022

As far as I can see, this PR does a few things:

  • It passes BuilderOptions through a lot of constructors, rather than a single integer (initial). That will allow us to expand the options, such as a distinction between the initial GrowableBuffer panel size and subsequent ones. (We'll want to make those arguments not template parameters in LayoutBuilder, since I doubt an object like BuilderOptions can be a compile-time constant. If LayoutBuilder needs to have a default constructor, maybe the default constructor can supply default BuilderOptions?) I see that you did that already.
  • Various clean-ups, which cause indentation diffs.

On closer inspection, it looks to me like the only substantial change is that initialoptions, with all the supporting changes that needs. Is this right? (Have I missed anything?)

just small stuff:

  • std::void_t has been replaced as it is C++17
  • BitMasked mask was fixed. That required additional GrowableBuffer concatenate method with an offset defined.
  • cleanup LayoutBuilder API - remove temporary/legacy to_buffer method

The only thing I would say needs to be changed is that a C++ user sees these options with a class name like awkward::BuilderOptions, not awkward::Options, because these options are specifically for builders.

@ianna ianna requested a review from jpivarski July 28, 2022 15:03
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, great—it's ready to merge, then!

@jpivarski jpivarski merged commit 28218f3 into main Jul 28, 2022
@jpivarski jpivarski deleted the ianna/array-builder-options branch July 28, 2022 17:14
ManasviGoyal pushed a commit that referenced this pull request Aug 6, 2022
* restore array builder options

* GrowableBuffer and its test updated

* builder options added

* introduce builder options to layout builder

* drop C++17 requirement for cpp-only tests to C++14; work-around missing std::tuple_element_t on all MacOS CI nodes

* fix compilation error and cleanup

* clang format

* remove default parameters from build options

* remove initializer list

* fix bitmasked mask and add builder options test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* address Jim's comments

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants