Skip to content

[ENH] Add automatic grid value updates and improve octree deserialization#1089

Merged
Leguark merged 5 commits intomainfrom
adapt_to_engine
Mar 23, 2026
Merged

[ENH] Add automatic grid value updates and improve octree deserialization#1089
Leguark merged 5 commits intomainfrom
adapt_to_engine

Conversation

@Leguark
Copy link
Copy Markdown
Member

@Leguark Leguark commented Mar 23, 2026

Description

This pull request improves grid value synchronization by adding automatic updates when grid properties change. The changes include:

  • Added _update_values() call in set_active_grid() function to ensure grid values are refreshed when active grids are modified
  • Implemented __setattr__ method in the Grid class to automatically trigger value updates when active_grids property is changed
  • Enhanced octree grid initialization during model deserialization by calling set_regular_grid() with proper extent, resolution, and transform parameters
  • Fixed field annotation in the Topography class by using Annotated type hint for the values_2d field
  • Updated test snapshots to reflect new configuration defaults, including the addition of compute_scalar: true and removal of debug_water_tight field

Checklist

  • My code uses type hinting for function and method arguments and return values.
  • I have created tests which cover my code.
  • The test code either 1. demonstrates at least one valuable use case (e.g. integration tests)
    or 2. verifies that outputs are as expected for given inputs (e.g. unit tests).
  • New tests pass locally with my changes.

@Leguark Leguark marked this pull request as ready for review March 23, 2026 08:01
Copy link
Copy Markdown
Member Author

Leguark commented Mar 23, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@graphite-app graphite-app Bot added the gempy 3 Will come with the next major update label Mar 23, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Mar 23, 2026

Graphite Automations

"Add gempy label" took an action on this PR • (03/23/26)

1 label was added to this PR based on Miguel de la Varga's automation.

Leguark added 4 commits March 23, 2026 09:32
Refactored grid deserialization logic to handle different grid types more robustly. Enhanced octree grid handling by ensuring values are updated correctly during deserialization. Also, improved consistency in formatting and added handling for `active_grids` during grid initialization.
@Leguark Leguark changed the title [TEST] Update test verification files to include compute_scalar and remove debug_water_tight [ENH] Add automatic grid value updates and improve octree deserialization Mar 23, 2026
@Leguark Leguark merged commit e46fee7 into main Mar 23, 2026
2 checks passed
@Leguark Leguark deleted the adapt_to_engine branch March 23, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gempy 3 Will come with the next major update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant