hermes-3 icon indicating copy to clipboard operation
hermes-3 copied to clipboard

WIP: Control access to state variables in transform method

Open cmacmackin opened this issue 1 month ago • 3 comments

This is a major refactor of how components work. They are now required to create a Permissions object in their constructor, which contains information on which state variables the transform method is allowed to read and write. Trying to read/write a variable without permission will result in a runtime error. This should help ensure people are more thoughtful in their design of components and prevent inadvertent side-effects. It also provides necessary information for implementing the automatic ordering of the execution of components (#384).

Closes #383

cmacmackin avatar Nov 04 '25 11:11 cmacmackin

Does this now include #399? Is that on purpose?

ZedThree avatar Nov 17 '25 16:11 ZedThree

Does this now include #399? Is that on purpose?

Yes. I didn't want to add all the permission for the old closure implementation and then have to re-do it for the new one. The plan is to merge #399 first though. Then we can rebase and do final review on this one.

cmacmackin avatar Nov 17 '25 16:11 cmacmackin

Codecov Report

:x: Patch coverage is 58.05297% with 586 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 29.22%. Comparing base (0e601f7) to head (7d17184).

Files with missing lines Patch % Lines
src/braginskii_conduction.cxx 54.33% 64 Missing and 15 partials :warning:
src/braginskii_ion_viscosity.cxx 53.57% 35 Missing and 4 partials :warning:
src/braginskii_friction.cxx 58.53% 32 Missing and 2 partials :warning:
src/vorticity.cxx 0.00% 31 Missing :warning:
src/braginskii_heat_exchange.cxx 57.37% 26 Missing :warning:
src/polarisation_drift.cxx 0.00% 21 Missing :warning:
src/classical_diffusion.cxx 0.00% 19 Missing :warning:
src/braginskii_collisions.cxx 78.48% 10 Missing and 7 partials :warning:
src/sheath_boundary_simple.cxx 0.00% 16 Missing :warning:
include/detachment_controller.hxx 0.00% 15 Missing :warning:
... and 53 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #421      +/-   ##
==========================================
+ Coverage   22.50%   29.22%   +6.72%     
==========================================
  Files          87       94       +7     
  Lines        8071     8750     +679     
  Branches     1146     1224      +78     
==========================================
+ Hits         1816     2557     +741     
+ Misses       6085     5932     -153     
- Partials      170      261      +91     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Nov 24 '25 20:11 codecov[bot]