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

Construct ObservationId directly from a value #1408

Merged
merged 3 commits into from Mar 12, 2019

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Mar 1, 2019

Proposed changes

This PR changes the constructor of ObservationId to take a double value directly, instead of a type that has a value() member function. This allows me to remove the wrapper around size_t that I used for the LinearSolver::IterationId. I haven't propagated the change to the other places that construct ObservationId yet, so opening this as a draft PR to confirm the design.

Types of changes:

  • New feature

Component:

  • Code

Code review checklist

  • The PR passes all checks, including unit tests, clang-tidy and IWYU.
    For instructions on how to perform the CI checks locally refer to the Dev
    guide on the Travis CI
    .
  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.

@nilsvu nilsvu requested review from nilsdeppe, markscheel and wthrowe and removed request for nilsdeppe and markscheel March 1, 2019 16:49
@wthrowe
Copy link
Member

wthrowe commented Mar 1, 2019

Yes, this looks good.

@nilsdeppe
Copy link
Member

I'll review, but might not have time until Tuesday or Wednesday :)

@nilsvu nilsvu mentioned this pull request Mar 4, 2019
5 tasks
@nilsvu
Copy link
Member Author

nilsvu commented Mar 4, 2019

@wthrowe How should we handle time here? I can think of the following options:

  • Call time.value() when constructing ObservationIds (I saw that you removed the TimeValue compute tag in some PR, which could have been used for this?)
  • Make TimeId implicitly convertible to double so that we can still pass a TimeId to the constructor of ObservationId.
  • Keep the generic constructor of ObservationId and have it call a .value() member function if the Id template argument is not static-castable to double

@nilsvu nilsvu force-pushed the linsolv_iteration_id branch 2 times, most recently from f1c447b to 29a4466 Compare March 4, 2019 15:55
@nilsvu nilsvu mentioned this pull request Mar 4, 2019
6 tasks
@wthrowe
Copy link
Member

wthrowe commented Mar 4, 2019

Use time.value(). This is a temporary solution until dense output is implemented.

@kidder kidder mentioned this pull request Mar 4, 2019
9 tasks
@nilsvu nilsvu marked this pull request as ready for review March 5, 2019 09:20
@nilsvu
Copy link
Member Author

nilsvu commented Mar 5, 2019

@wthrowe I made the changes, this should be ready for review now

@nilsvu nilsvu force-pushed the linsolv_iteration_id branch 2 times, most recently from 2b2c24a to f761f2e Compare March 5, 2019 10:19
@@ -81,11 +55,11 @@ SPECTRE_TEST_CASE("Unit.IO.Observers.ObservationId", "[Unit][Observers]") {
CHECK(id4.observation_type_hash() != id3.observation_type_hash());
CHECK(id4.value() == 8.0);

ObservationId time0(Time(Slab{0.0, 1.0}, 0),
ObservationId time0(Time(Slab{0.0, 1.0}, 0).value(),
Copy link
Member

Choose a reason for hiding this comment

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

This section (everything with the timeN objects) is a duplicate of the preceding section now.

@nilsvu
Copy link
Member Author

nilsvu commented Mar 6, 2019

fixed @wthrowe. @nilsdeppe and/or @markscheel please review

@nilsvu nilsvu force-pushed the linsolv_iteration_id branch 3 times, most recently from ce865c7 to 4871636 Compare March 6, 2019 17:07
@wthrowe
Copy link
Member

wthrowe commented Mar 6, 2019

Looks good.

@nilsvu
Copy link
Member Author

nilsvu commented Mar 6, 2019

Rebased and squashed

We don't need the wrapper anymore since ObservationId can now
construct directly from a value
@nilsvu
Copy link
Member Author

nilsvu commented Mar 11, 2019

Rebased on #1385

@kidder
Copy link
Member

kidder commented Mar 11, 2019

@wthrowe please look at; you previously gave the go ahead for a squash, so it should be quick; please merge if you are happy with it.

@wthrowe wthrowe merged commit 17e4942 into sxs-collaboration:develop Mar 12, 2019
@kidder kidder mentioned this pull request Mar 12, 2019
5 tasks
@nilsvu nilsvu deleted the linsolv_iteration_id branch September 13, 2019 08:41
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

5 participants