Skip to content

Give Thermo total_* accessors default units - #95

Merged
galjos merged 1 commit into
mainfrom
default-accessor-units
Jul 7, 2026
Merged

Give Thermo total_* accessors default units#95
galjos merged 1 commit into
mainfrom
default-accessor-units

Conversation

@galjos

@galjos galjos commented Jul 7, 2026

Copy link
Copy Markdown
Member

The total_* accessors required an explicit unit, so the README's thermo.total_gibbs_free_energy() (no argument) raised TypeError.

Add sensible defaults: total_energy/total_enthalpy/total_gibbs_free_energy default to "H" (Hartree); total_entropy/total_heat_capacity to "cal/(mol*K)". Existing explicit-unit calls are unaffected; the README example now works as written.

Tested (no-arg equals explicit default). Full patch coverage.

Closes #94

energy/enthalpy/Gibbs default to 'H' (Hartree); entropy and heat capacity
to 'cal/(mol*K)'. This makes the no-argument form work, fixing the README
example that called thermo.total_gibbs_free_energy() with no unit.

Closes #94
@galjos
galjos merged commit 34d1f03 into main Jul 7, 2026
3 checks passed
@galjos
galjos deleted the default-accessor-units branch July 7, 2026 09:33
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.96%. Comparing base (a645977) to head (fb37d50).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #95   +/-   ##
=======================================
  Coverage   96.96%   96.96%           
=======================================
  Files          28       28           
  Lines        1714     1714           
=======================================
  Hits         1662     1662           
  Misses         52       52           
Flag Coverage Δ
unittests 96.96% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Give Thermo accessors default units (README example is broken)

1 participant