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

Added maxoptcycles configuration to .censorc. #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MtoLStoN
Copy link
Member

  • 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]

@MtoLStoN MtoLStoN requested a review from fabothch June 29, 2022 13:46
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 29, 2022

This pull request introduces 1 alert when merging 75b4939 into ed326c9 - view on LGTM.com

new alerts:

  • 1 for Unused import

- 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"],
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

Should be added here:

if self.part2:

Copy link
Member

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)
Copy link
Member

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

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

2 participants