Skip to content

fix(Builder): remove uuid overloads of geological component setters - #204

Merged
BenPinet merged 1 commit into
nextfrom
fix/component-access-robustness
Oct 21, 2026
Merged

BenPinet merged 1 commit into
nextfrom
fix/component-access-robustness

Conversation

@francoisbonneau

Copy link
Copy Markdown
Member

Reverts the "setters accepting uuid" part of #201 (commit 33de309).

Accepting a uuid in the name/type setters of the Horizons, Faults, StratigraphicUnits and FaultBlocks builders saved one model.fault(id) call, but:

  • lost type safety: passing the uuid of another component type (e.g. a Horizon to set_fault_name) was only detected at lookup time, with IndexError: absl::linked_hash_map::at. With the component, the signature rejects it (TypeError in Python, compile error in C++);
  • was inconsistent with the OpenGeode builders (set_surface_name, add_surface_in_horizon…), which only accept components;
  • doubled the API surface of 9 setters for a small gain.

Kept from #201: typed creation add_fault(type) / add_horizon(contact_type) and stratigraphic_unit_id_from_name_{2d,3d}. The Python bindings keep named arguments (fault=, name=, contact_type=…).

Tests

test_setters_with_uuid is replaced by test_setters_with_keywords. Full suite: 13/13, built against Geode-solutions/OpenGeode#1376 (same branch name), which makes an unknown component id throw No Fault with id <uuid>.

🤖 Generated with Claude Code

Reverts 33de309. Accepting a uuid in the name and type setters of
Horizons, Faults, StratigraphicUnits and FaultBlocks builders saved one
model.fault(id) call but lost type safety: an uuid of another component
type was only detected at lookup, while passing the wrong component is
rejected by the signature (TypeError in Python, compile error in C++).
It was also inconsistent with the OpenGeode builders, which only accept
components.

The Python bindings keep named arguments on the remaining overloads,
now tested in test_setters_with_keywords.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v21.1.8) reports: 20 concern(s)
  • bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:39:39: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       39 |     void define_fault_blocks_builder( pybind11::module& module )
          |                                       ^
  • bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:41:9: error: [clang-diagnostic-error]

    unexpected type name 'FaultBlocksBuilder2D': expected expression

       41 |         PYTHON_FAULT_BLOCKS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:31:23: note: expanded from macro 'PYTHON_FAULT_BLOCKS_BUILDER'
       31 |     pybind11::class_< FaultBlocksBuilder##dimension##D >(                      \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:41:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       41 |         PYTHON_FAULT_BLOCKS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:31:5: note: expanded from macro 'PYTHON_FAULT_BLOCKS_BUILDER'
       31 |     pybind11::class_< FaultBlocksBuilder##dimension##D >(                      \
          |     ^
  • bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:42:9: error: [clang-diagnostic-error]

    unexpected type name 'FaultBlocksBuilder3D': expected expression

       42 |         PYTHON_FAULT_BLOCKS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:31:23: note: expanded from macro 'PYTHON_FAULT_BLOCKS_BUILDER'
       31 |     pybind11::class_< FaultBlocksBuilder##dimension##D >(                      \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:42:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       42 |         PYTHON_FAULT_BLOCKS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/fault_blocks_builder.hpp:31:5: note: expanded from macro 'PYTHON_FAULT_BLOCKS_BUILDER'
       31 |     pybind11::class_< FaultBlocksBuilder##dimension##D >(                      \
          |     ^
  • bindings/python/src/explicit/mixin/builder/faults_builder.hpp:40:33: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       40 |     void define_faults_builder( pybind11::module& module )
          |                                 ^
  • bindings/python/src/explicit/mixin/builder/faults_builder.hpp:42:9: error: [clang-diagnostic-error]

    unexpected type name 'FaultsBuilder2D': expected expression

       42 |         PYTHON_FAULTS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/faults_builder.hpp:31:23: note: expanded from macro 'PYTHON_FAULTS_BUILDER'
       31 |     pybind11::class_< FaultsBuilder##dimension##D >(                           \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/faults_builder.hpp:42:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       42 |         PYTHON_FAULTS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/faults_builder.hpp:31:5: note: expanded from macro 'PYTHON_FAULTS_BUILDER'
       31 |     pybind11::class_< FaultsBuilder##dimension##D >(                           \
          |     ^
  • bindings/python/src/explicit/mixin/builder/faults_builder.hpp:43:9: error: [clang-diagnostic-error]

    unexpected type name 'FaultsBuilder3D': expected expression

       43 |         PYTHON_FAULTS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/faults_builder.hpp:31:23: note: expanded from macro 'PYTHON_FAULTS_BUILDER'
       31 |     pybind11::class_< FaultsBuilder##dimension##D >(                           \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/faults_builder.hpp:43:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       43 |         PYTHON_FAULTS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/faults_builder.hpp:31:5: note: expanded from macro 'PYTHON_FAULTS_BUILDER'
       31 |     pybind11::class_< FaultsBuilder##dimension##D >(                           \
          |     ^
  • bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:42:35: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       42 |     void define_horizons_builder( pybind11::module& module )
          |                                   ^
  • bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:44:9: error: [clang-diagnostic-error]

    unexpected type name 'HorizonsBuilder2D': expected expression

       44 |         PYTHON_HORIZONS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:31:23: note: expanded from macro 'PYTHON_HORIZONS_BUILDER'
       31 |     pybind11::class_< HorizonsBuilder##dimension##D >(                         \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:44:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       44 |         PYTHON_HORIZONS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:31:5: note: expanded from macro 'PYTHON_HORIZONS_BUILDER'
       31 |     pybind11::class_< HorizonsBuilder##dimension##D >(                         \
          |     ^
  • bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:45:9: error: [clang-diagnostic-error]

    unexpected type name 'HorizonsBuilder3D': expected expression

       45 |         PYTHON_HORIZONS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:31:23: note: expanded from macro 'PYTHON_HORIZONS_BUILDER'
       31 |     pybind11::class_< HorizonsBuilder##dimension##D >(                         \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:45:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       45 |         PYTHON_HORIZONS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/horizons_builder.hpp:31:5: note: expanded from macro 'PYTHON_HORIZONS_BUILDER'
       31 |     pybind11::class_< HorizonsBuilder##dimension##D >(                         \
          |     ^
  • bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:40:46: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       40 |     void define_stratigraphic_units_builder( pybind11::module& module )
          |                                              ^
  • bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:42:9: error: [clang-diagnostic-error]

    unexpected type name 'StratigraphicUnitsBuilder2D': expected expression

       42 |         PYTHON_STRATIGRAPHIC_UNITS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:31:23: note: expanded from macro 'PYTHON_STRATIGRAPHIC_UNITS_BUILDER'
       31 |     pybind11::class_< StratigraphicUnitsBuilder##dimension##D >(               \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:42:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       42 |         PYTHON_STRATIGRAPHIC_UNITS_BUILDER( 2 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:31:5: note: expanded from macro 'PYTHON_STRATIGRAPHIC_UNITS_BUILDER'
       31 |     pybind11::class_< StratigraphicUnitsBuilder##dimension##D >(               \
          |     ^
  • bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:43:9: error: [clang-diagnostic-error]

    unexpected type name 'StratigraphicUnitsBuilder3D': expected expression

       43 |         PYTHON_STRATIGRAPHIC_UNITS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:31:23: note: expanded from macro 'PYTHON_STRATIGRAPHIC_UNITS_BUILDER'
       31 |     pybind11::class_< StratigraphicUnitsBuilder##dimension##D >(               \
          |                       ^
    note: expanded from here
  • bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:43:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'pybind11'

       43 |         PYTHON_STRATIGRAPHIC_UNITS_BUILDER( 3 );
          |         ^
    /__w/OpenGeode-Geosciences/OpenGeode-Geosciences/bindings/python/src/explicit/mixin/builder/stratigraphic_units_builder.hpp:31:5: note: expanded from macro 'PYTHON_STRATIGRAPHIC_UNITS_BUILDER'
       31 |     pybind11::class_< StratigraphicUnitsBuilder##dimension##D >(               \
          |     ^

Have any feedback or feature suggestions? Share it here.

@panquez panquez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check changes to do in dependent repo (at least one change to do)

@BenPinet
BenPinet merged commit b4e1455 into next Oct 21, 2026
49 checks passed
@BenPinet
BenPinet deleted the fix/component-access-robustness branch October 21, 2026 16:01
@panquez

panquez commented Oct 21, 2026

Copy link
Copy Markdown
Member

🎉 This PR is included in version 9.9.0-rc.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@geode-ci

geode-ci Bot commented Oct 22, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 9.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@geode-ci geode-ci Bot added the released label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants