Repository navigation
fix(Builder): remove uuid overloads of geological component setters - #204
Conversation
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>
Cpp-Linter Report
|
panquez
left a comment
There was a problem hiding this comment.
Check changes to do in dependent repo (at least one change to do)
|
🎉 This PR is included in version 9.9.0-rc.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 9.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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:set_fault_name) was only detected at lookup time, withIndexError: absl::linked_hash_map::at. With the component, the signature rejects it (TypeErrorin Python, compile error in C++);set_surface_name,add_surface_in_horizon…), which only accept components;Kept from #201: typed creation
add_fault(type)/add_horizon(contact_type)andstratigraphic_unit_id_from_name_{2d,3d}. The Python bindings keep named arguments (fault=,name=,contact_type=…).Tests
test_setters_with_uuidis replaced bytest_setters_with_keywords. Full suite: 13/13, built against Geode-solutions/OpenGeode#1376 (same branch name), which makes an unknown component id throwNo Fault with id <uuid>.🤖 Generated with Claude Code