Skip to content

[FIX] Use deepcopy for options and add example.mle test file #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2025

Conversation

Leguark
Copy link
Member

@Leguark Leguark commented Jun 12, 2025

[BUG] Fix dual contouring deepcopy and remove redundant code

  • Replace copy.copy with copy.deepcopy in multi_scalar_dual_contouring.py to ensure proper isolation of options when modifying evaluation parameters
  • Remove redundant case statements in raw_arrays_solution.py that were handling unneeded block solution types
  • Add example MLE file for testing server functionality

[BUG] Dual contouring was switching compute grads on for the original geomodel object

@Leguark Leguark changed the title [BUG] Make sure custom grids only set the solutions properly [FIX] Use deepcopy for options and add example.mle test file Jun 12, 2025
Copy link
Member Author

Leguark commented Jun 12, 2025

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

@Leguark Leguark merged commit 99c9d7e into main Jun 12, 2025
2 checks passed
Leguark added a commit to gempy-project/gempy that referenced this pull request Jun 13, 2025
# Description
New PR for the evaluating the computation time for custom grids. Test now includes model computation for pure model, after adding a topography and using the `compute_model_at` function with 1000 random points.
I removed the test that deep created to clean up.

Just fyi - here are the resulting times on my computer:

![image](https://github.com/user-attachments/assets/c4efea44-bdb2-4738-b936-bcdd65ff5d01)

Added a warning message to `compute_model_at` function to alert users about potential side effects when setting a custom grid and computing the model. Modified the `set_custom_grid` function to include a `reset` parameter, which is now set to `True` in `compute_model_at` to ensure proper grid reset.

Removed code in the `solutions` setter that was setting solutions per group, as this was causing issues with the custom grid functionality.

Added comprehensive tests to measure and compare computation times across different grid configurations:
- Dense grid computation (with consistency checks)
- Topography grid vs dense grid computation
- Custom grid computation with random coordinates


# Checklist
- [x] My code uses type hinting for function and method arguments and return values.
- [x] I have created tests which cover my code.
- [x] 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).
- [x] New tests pass locally with my changes.
 
Relates to: gempy-project/gempy_engine#16 (comment)
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.

1 participant