Skip to content

feat(Sampler): add genericity#42

Merged
francoisbonneau merged 13 commits into
mcmc_configfrom
improve_usability
Jun 4, 2026
Merged

feat(Sampler): add genericity#42
francoisbonneau merged 13 commits into
mcmc_configfrom
improve_usability

Conversation

@francoisbonneau
Copy link
Copy Markdown
Member

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 12 concern(s)
  • include/geode/stochastic/inference/statistics_tracker.hpp:38:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       38 |         StatisticsTracker( const Model< ObjectType >& model ) : model_{ model }
          |         ^
          |         explicit 
  • include/geode/stochastic/inference/statistics_tracker.hpp:54:17: warning: [readability-qualified-auto]

    'auto &value' can be declared as 'const auto &value'

       54 |                 auto& value = values[value_id];
          |                 ^
          |                 const 
  • include/geode/stochastic/sampling/mcmc/metropolis_hasting_sampler.hpp:168:34: warning: [readability-function-size]

    function 'accept_or_reject' exceeds recommended size/complexity thresholds

      168 |         StepResult< ObjectType > accept_or_reject(
          |                                  ^
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/include/geode/stochastic/sampling/mcmc/metropolis_hasting_sampler.hpp:168:34: note: 5 parameters (threshold 4)
  • include/geode/stochastic/sampling/mcmc/proposal/classical_proposals.hpp:34:10: warning: [readability-function-size]

    function 'add_birth_death_change_moves' exceeds recommended size/complexity thresholds

       34 |     void add_birth_death_change_moves(
          |          ^
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/include/geode/stochastic/sampling/mcmc/proposal/classical_proposals.hpp:34:10: note: 6 parameters (threshold 4)
  • include/geode/stochastic/sampling/mcmc/proposal/classical_proposals.hpp:39:9: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'add_birth_death_change_moves' of similar type ('double') are easily swapped by mistake

       39 |         double death_ratio,
          |         ^~~~~~~~~~~~~~~~~~~
       40 |         double change_ratio )
          |         ~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/include/geode/stochastic/sampling/mcmc/proposal/classical_proposals.hpp:39:16: note: the first parameter in the range is 'death_ratio'
       39 |         double death_ratio,
          |                ^~~~~~~~~~~
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/include/geode/stochastic/sampling/mcmc/proposal/classical_proposals.hpp:40:16: note: the last parameter in the range is 'change_ratio'
       40 |         double change_ratio )
          |                ^~~~~~~~~~~~
  • src/geode/stochastic/spatial/object_sets.cpp:36:14: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

       36 |         auto it = uuid_to_index_.find( set_id );
          |              ^
  • src/geode/stochastic/spatial/object_sets.cpp:205:43: warning: [cppcoreguidelines-avoid-magic-numbers]

    1. is a magic number; consider replacing it with a named constant
      205 |         box.extends( searching_distance * 2. );
          |                                           ^
  • tests/stochastic/sampling/mcmc/proposal/test-proposal-kernel.cpp:115:25: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      115 |                         proposed_move.old_object_id.value()
          |                         ^
  • tests/stochastic/sampling/mcmc/proposal/test-proposal-kernel.cpp:135:25: warning: [bugprone-unchecked-optional-access]

    unchecked access to optional value

      135 |                         proposed_move.old_object_id.value()
          |                         ^
  • tests/stochastic/sampling/mcmc/test-metropolis-hasting-sampler.cpp:25:10: error: [clang-diagnostic-error]

    'geode/stochastic/models/energy_terms/density_term.hpp' file not found

       25 | #include <geode/stochastic/models/energy_terms/density_term.hpp>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • tests/stochastic/sampling/test-random-engine.cpp:183:10: warning: [readability-function-size]

    function 'test_truncated_gaussian' exceeds recommended size/complexity thresholds

      183 |     void test_truncated_gaussian( double mean_value,
          |          ^
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/tests/stochastic/sampling/test-random-engine.cpp:183:10: note: 5 parameters (threshold 4)
  • tests/stochastic/sampling/test-random-engine.cpp:183:35: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'test_truncated_gaussian' of similar type ('double') are easily swapped by mistake

      183 |     void test_truncated_gaussian( double mean_value,
          |                                   ^~~~~~~~~~~~~~~~~~
      184 |         double std_value,
          |         ~~~~~~~~~~~~~~~~
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/tests/stochastic/sampling/test-random-engine.cpp:183:42: note: the first parameter in the range is 'mean_value'
      183 |     void test_truncated_gaussian( double mean_value,
          |                                          ^~~~~~~~~~
    /__w/OpenGeode-Stochastic/OpenGeode-Stochastic/tests/stochastic/sampling/test-random-engine.cpp:184:16: note: the last parameter in the range is 'std_value'
      184 |         double std_value,
          |                ^~~~~~~~~

Have any feedback or feature suggestions? Share it here.

Comment thread include/geode/stochastic/applications/fractures.hpp Outdated
Comment thread include/geode/stochastic/sampling/direct/object_set_sampler/point_set_sampler.hpp Outdated
@francoisbonneau francoisbonneau merged commit b832e33 into mcmc_config Jun 4, 2026
19 checks passed
@francoisbonneau francoisbonneau deleted the improve_usability branch June 4, 2026 13:57
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.

2 participants