iris-hep / func_adl_xAOD

Client interface to send a hierarchical SQL-like query to an xAOD backend
0 stars 5 forks source link

Support C++ enums #219

Closed gordonwatts closed 4 months ago

gordonwatts commented 8 months ago

A change like this is rather extensive. It would be nice if the design was such that adding a feature like this was localized to a file or two.

Changes

Discussion

This is a "change" from what we usually do because an enum can be referenced as an argument so the user has to explicitly reference it - it isn't something that hangs off a EventDataSet or similar object.

  1. Added infrastructure to handle name spaces and enums.
  2. Added expression parsing to turn a enum value into a cpp_value
  3. Added support for different types to be written to a tree than are passed around in C++. This allows us to have an enum, and convert it to an integer when returning it.

One thing discovered while working with this: we do not want to add "special" information for adding an include file. This should occur when the func_adl types are generated.

Minor

Fixes #218

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 93.92265% with 11 lines in your changes missing coverage. Please review.

Project coverage is 95.05%. Comparing base (6e725f0) to head (2f12ed4).

Files Patch % Lines
func_adl_xAOD/common/ast_to_cpp_translator.py 86.48% 2 Missing and 3 partials :warning:
func_adl_xAOD/common/cpp_representation.py 88.57% 4 Missing :warning:
func_adl_xAOD/common/cpp_types.py 97.22% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #219 +/- ## ======================================== Coverage 95.05% 95.05% ======================================== Files 35 35 Lines 1880 2003 +123 Branches 249 265 +16 ======================================== + Hits 1787 1904 +117 - Misses 60 64 +4 - Partials 33 35 +2 ``` | [Flag](https://app.codecov.io/gh/iris-hep/func_adl_xAOD/pull/219/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iris-hep) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/iris-hep/func_adl_xAOD/pull/219/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iris-hep) | `95.05% <93.92%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iris-hep#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.