Skip to content

Extract shared template utilities and replace print with logging#10

Merged
tdpham2 merged 3 commits into
mainfrom
feature/add-single-mixture-mode
May 28, 2026
Merged

Extract shared template utilities and replace print with logging#10
tdpham2 merged 3 commits into
mainfrom
feature/add-single-mixture-mode

Conversation

@tdpham2

@tdpham2 tdpham2 commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract copy_template() and render_template() into matkit/utils/template.py, eliminating duplicated template-copy-and-substitute code across graspa, raspa2, and graspa_sycl modules
  • Replace all print() calls in library code with logging.getLogger(__name__) and add -v/--verbose CLI flag (default WARNING, -v INFO, -vv DEBUG)
  • Fix mace_opt.py type safety bug: now raises ValueError instead of returning "Error" from a -> None function

Test plan

  • All 155 existing tests pass
  • ruff check and ruff format --check pass
  • Manually verify matkit graspa setup produces identical simulation.input output
  • Verify matkit -v graspa setup ... shows info-level log messages

tdpham2 added 3 commits May 27, 2026 14:47
Add a mode field (single or mixture) to the YAML config to distinguish
between running adsorbates as independent single-component isotherms
vs running them together as a mixture simulation with mole fractions.
…tion modules

Add copy_template() and render_template() in matkit/utils/template.py and
refactor graspa, raspa2, and graspa_sycl setup functions to use them instead
of duplicated copy-and-substitute logic.
Replace all print() calls in library modules with logging.getLogger(__name__)
calls at appropriate levels. Add -v/--verbose flag to the CLI (default WARNING,
-v for INFO, -vv for DEBUG). Fix mace_opt.py to raise ValueError instead of
returning "Error" string from a -> None function.
@tdpham2 tdpham2 changed the title Add single/mixture mode to gRASPA isotherm config Extract shared template utilities and replace print with logging May 28, 2026
@tdpham2 tdpham2 merged commit 28ba170 into main May 28, 2026
5 checks passed
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.

1 participant