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

Add tests for first C++ types #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

hahnjo
Copy link
Member

@hahnjo hahnjo commented Feb 18, 2025

@hahnjo hahnjo added the types label Feb 18, 2025
@hahnjo hahnjo self-assigned this Feb 18, 2025
RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options);

// First entry: std::int32_t
*value = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Should we also test the case of Fill without a value set?

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC a default-constructed std::variant has a default-constructed value of its first alternative, so std::int32_t{0} in this case. For me, that's more of a C++ detail than specific to RNTuple.

What we are really missing is valueless_by_exception, but for that we need a type to throw an exception during move assignment (see https://en.cppreference.com/w/cpp/utility/variant/valueless_by_exception). I added a note to README.md.

Copy link

@enirolf enirolf left a comment

Choose a reason for hiding this comment

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

Thanks! I have a few minor comments.

Copy link

@enirolf enirolf left a comment

Choose a reason for hiding this comment

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

One final suggestion but LGTM otherwise!


## Entries

1. One character strings, with ascending values
Copy link
Member

@pcanal pcanal Feb 19, 2025

Choose a reason for hiding this comment

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

General comment/question. Was the README intended to be sufficient to know what is in the file? As is the README(s) are general description and knowing what is really in the file require parsing/reading the write.C (or later the reference file). Is that the intent?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good question and I haven't fully made up my mind yet. I think I see arguments for both ways (basically a full standalone description vs duplication in multiple places), so for now I was lazy and decided not to duplicate. If we decide that we want a full description in the READMEs, I can put the following structure (in a follow-up PR):

  1. One character strings, with ascending values:
    • Index32: "a"
    • Index64: "b"
    • SplitIndex32: "c"
    • SplitIndex64: "d"

but it would literally by the same as in the write.C...

... with all possible index column types.

Closes root-project#2
... with all possible index column types.

Closes root-project#3
@hahnjo hahnjo added this to the 1.0 milestone Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test for std::variant type Tests for std::vector type Test for std::string type
3 participants