-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added maxoptcycles configuration to .censorc. #32
base: main
Are you sure you want to change the base?
Conversation
This pull request introduces 1 alert when merging 75b4939 into ed326c9 - view on LGTM.com new alerts:
|
- Keeping old behaviour as "maxoptcycles: old" - Adding new automatic setup (50 + 3*nat) as "maxoptcycles: automatic" - Allows manual setting of maximum optimization cyles for part 2. Signed-off-by: MtoLStoN <[email protected]>
@@ -1674,6 +1676,7 @@ def __init__(self, **kwargs): | |||
"crestcheck": ["on", "off"], | |||
"maxthreads": ["number of threads e.g. 2"], | |||
"omp": ["number cores per thread e.g. 4"], | |||
"maxoptcycles": ["old", "automatic", "number of maximum cycles e.g. 200"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the values can be string or int you should add a check in the function check_logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be added here:
CENSO/censo_qm/inputhandling.py
Line 2759 in ed326c9
if self.part2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this:
if self.maxoptcycles not in ['old','automatic']
try:
int(self.maxoptcycles)
except ValueError:
error_logical = True
- add printout warning
else: | ||
stopcycle = 200 | ||
stopcycle = int(config.maxoptcycles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be dangerous if you do not check that config.maxoptycle can be converted to int
Signed-off-by: MtoLStoN <[email protected]>
Signed-off-by: MtoLStoN [email protected]