Skip to content

feat: add verbose option to Relaxer.relax#152

Merged
yanghan234 merged 1 commit intomainfrom
fix/issue-59-relaxer-verbose
Apr 22, 2026
Merged

feat: add verbose option to Relaxer.relax#152
yanghan234 merged 1 commit intomainfrom
fix/issue-59-relaxer-verbose

Conversation

@yanghan234
Copy link
Copy Markdown
Collaborator

Summary

Fixes #59 — adds a verbose: bool = True parameter to Relaxer.relax() to control optimizer output.

Changes

  • relax.py: Added verbose param. When False, optimizer output is suppressed via contextlib.redirect_stdout. Default is True (backward compatible).
  • test_relax.py: Rewritten from unittest to pytest style. Uses shared fixtures (si_diamond_cubic, si_diamond, perturb). Added 4 verbose tests alongside the original 4 relaxation tests.

Usage

relaxer = Relaxer()
relaxer.relax(atoms, verbose=False)  # silent
relaxer.relax(atoms, verbose=True)   # default, prints progress

@yanghan234 yanghan234 force-pushed the fix/issue-59-relaxer-verbose branch 3 times, most recently from 0ab293f to 22863aa Compare April 22, 2026 14:08
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yanghan234 yanghan234 force-pushed the fix/issue-59-relaxer-verbose branch from 22863aa to 14b4dcc Compare April 22, 2026 14:11
@yanghan234 yanghan234 marked this pull request as ready for review April 22, 2026 14:19
@yanghan234 yanghan234 merged commit c765bfd into main Apr 22, 2026
7 checks passed
@yanghan234 yanghan234 deleted the fix/issue-59-relaxer-verbose branch April 22, 2026 14:19
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.

[Feat]: Verbose Option to relaxer

1 participant