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

[Feat]: Verbose Option to relaxer #59

Open
2 of 4 tasks
dundar11 opened this issue Dec 6, 2024 · 1 comment
Open
2 of 4 tasks

[Feat]: Verbose Option to relaxer #59

dundar11 opened this issue Dec 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dundar11
Copy link

dundar11 commented Dec 6, 2024

Contact Details

No response

Feature Description

relax function of the Relaxer object can have a boolean parameter verbose to let user to print out or suppress the energy and fmax values at each step of relaxation.

Motivation

For a stream lined application, screen output of relaxation steps can be too much to monitor. In that case user may choose to suppress these.

Proposed Solution

In relax.py :
stream = sys.stdout if verbose else io.StringIO()
with contextlib.redirect_stdout(stream):
optimizer = self.optimizer(ecf, **kwargs)
optimizer.run(fmax=fmax, steps=steps)
and of course at function def line:

def relax(
    self,
    atoms: Atoms,
    steps: int = 500,
    fmax: float = 0.01,
    params_filter: dict = {},
    verbose: bool = True,
    **kwargs,
) -> Atoms:

also import necessary modules:

import sys
import contextlib

Contribution Interest

  • I'm interested in potentially implementing this feature
  • I can provide guidance, but cannot implement
  • I'm just suggesting the feature for the community

Code of Conduct

  • I agree to follow the project's Code of Conduct
@yanghan234
Copy link
Collaborator

Dear @dundar11,

Thank you for suggesting this feature! We warmly welcome contributions from the community. Please feel free to submit a pull request once you have implemented this feature. Thank you!

Best regards,
Han

@yanghan234 yanghan234 added the enhancement New feature or request label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants