-
Notifications
You must be signed in to change notification settings - Fork 183
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
Convert all 0/1 flags to True, False in the python interface #1942
Comments
That is probably a remnant from the TCL interface. On the other hand, the integers are implicitly convertible to boolean, so the “wrong” syntax will remain valid. Furthermore I believe that Relevant lines: espresso/src/core/constraints/ShapeBasedConstraint.hpp Lines 47 to 48 in ea28f3c
espresso/src/core/constraints/ShapeBasedConstraint.hpp Lines 67 to 68 in ea28f3c
All the rest is done by type inference in the |
The only implicit type conversions in the script interface are int -> float, this is on purpose because implicit conversions are evil. For the constraints class you can just change the core variable to bool, the rest is automatic, as Henri pointed out. |
I want this to be replaced everywhere, shape based constraints are not the only occasion. Another arbitrary occasion is create_polymer(...,constraints=0) etc. I guess there are so many occasions that a student assistent could look for all these occasions and remove them. |
2915: Checkpointing: lbboundaries, constraints, auto_update_accumulators +test r=fweik a=RudolfWeeber 2927: Conversion of int-flags to bool in python interface r=fweik a=reinaual Fixes #1942 also changed flags in ELC/MMM2D code 2932: Improve maintainability of build_cmake.sh r=fweik a=jngrad The number of pitfalls in a shell script can be reduced if Google's [Shell Style Guide](https://google.github.io/styleguide/shell.xml#Variable_expansion) is followed: - no more cryptic `if [ ! -z "${var+x}" ]` to test if a variable is undeclared (also, the conditional was used incorrectly and caused the error message `line 94: curl: command not found` in Travis-CI without triggering the trap) - use CMake-like boolean values and test explicitly if a variable is equal to `true` or `false` (we had a mix of `true`, `yes` and empty strings) - every variable is brace-quoted - every string variable is quoted (no more `build_dir="build maxset"; cd ${build_dir}` causing `bash: cd: too many arguments`) Co-authored-by: Rudolf Weeber <weeber@icp.uni-stuttgart.de> Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de> Co-authored-by: Alexander Reinauer <st144434@stud.uni-stuttgart.de>
E.g. (and at all the other occations - which one would need to find)
should read:
this can be easily achieved e.g. in the interface. It would be a task for a Hiwi.
The text was updated successfully, but these errors were encountered: