Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Disentangle boolean flags from input variables #511

Closed
felipeZ opened this issue Jul 16, 2020 · 0 comments · Fixed by votca/xtp-tutorials#38
Closed

Disentangle boolean flags from input variables #511

felipeZ opened this issue Jul 16, 2020 · 0 comments · Fixed by votca/xtp-tutorials#38
Assignees
Labels

Comments

@felipeZ
Copy link
Member

felipeZ commented Jul 16, 2020

Problem

The user input is merged with the defaults of a given calculator to form a hierarchical Property object. The problem arises when the initialization method of the calculator must choose between procedure A or B, and there is a default property associated with A or B, for instance A.foo or B.bar.
During the initialization the following pseudo-code is run:

const Property& input = ....
if (input.exists("foo")){
  run(A)
} else {
  run(B)
}

Because A.foo is always present as default, the program will always run A.

Solution

  1. Create a flag that indicates whether A or B must be run, disentangling the properties from the boolean flags.
  2. Remove all the calls to exists avoiding collisions with the default values.
@felipeZ felipeZ added the bug label Jul 16, 2020
@felipeZ felipeZ self-assigned this Jul 16, 2020
felipeZ added a commit that referenced this issue Jul 16, 2020
Signed-off-by: felipez <tifonzafel@gmail.com>
felipeZ added a commit that referenced this issue Jul 16, 2020
felipeZ added a commit that referenced this issue Jul 16, 2020
felipeZ added a commit that referenced this issue Jul 17, 2020
felipeZ added a commit that referenced this issue Jul 17, 2020
felipeZ added a commit that referenced this issue Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant