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

refactor: Use std::optional for event range end requested #790

Merged

Conversation

paulgessinger
Copy link
Member

Previously, SIZE_MAX was used to indicate that the full available end range of an input file was to be used. This caused issues when no input file was present (for example in the geometry examples) and --events was not given., since it would run SIZE_MAX events (see #707).

This PR changes this to use std::optional<size_t>, so that the default is clearly communicated. The geometry example should now default to 1 if --events isn't supplied.

Fixes #707

@paulgessinger paulgessinger added this to the next milestone May 3, 2021
@codecov
Copy link

codecov bot commented May 3, 2021

Codecov Report

Merging #790 (098595f) into master (45e5289) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #790   +/-   ##
=======================================
  Coverage   48.65%   48.65%           
=======================================
  Files         328      328           
  Lines       16895    16895           
  Branches     7932     7932           
=======================================
  Hits         8220     8220           
  Misses       3078     3078           
  Partials     5597     5597           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45e5289...098595f. Read the comment docs.

Copy link
Contributor

@HadrienG2 HadrienG2 left a comment

Choose a reason for hiding this comment

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

🎉

@asalzburger asalzburger merged commit db1ce93 into acts-project:master May 5, 2021
@paulgessinger paulgessinger modified the milestones: next, v8.2.0 May 10, 2021
gagnonlg pushed a commit to gagnonlg/acts that referenced this pull request May 11, 2021
…ct#790)

Previously, SIZE_MAX was used to indicate that the full available end range of an input file was to be used. This caused issues when no input file was present (for example in the geometry examples) and --events was not given., since it would run SIZE_MAX events (see acts-project#707).

This PR changes this to use std::optional<size_t>, so that the default is clearly communicated. The geometry example should now default to 1 if --events isn't supplied.

Fixes acts-project#707
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.

Geometry examples behave badly when --events is not specified
3 participants