Skip to content

Conversation

@jcapriot
Copy link

Here are my edits for the regularization PR.
Mostly it adjusts the instantiation behavior to set default values on __init__.

However, it also adds a few properties that should make setting active_cells safer, such as clearing any cached properties on the regmesh if it is changed from None to something else. (This might also make it possible to allow for more changes to the active_cells instead of just the first, but this wasn't something I thoroughly tested.)

A bit of renaming to be more precise, cellDiffx is now renamed cell_gradient_x as it was actually a cell gradient and not just a difference now.

I've also include a safer handling of the weights, which should be double checked. Essentially it hides the weights dictionary from the user, and only allows interraction with it through three functions on the regularization set_weights, get_weights and remove_weights. Just as a personal preference set_weights now only accepts keywords arguments, but stores them on the internal _weights dictionary as _weights[keyword] = argument i.e. set_weights(irls=my_weights) will store it as _weights['irls"] = my_weights

Also include a bit of namespace cleanup by hiding a few of the internal properties and functions that are not necessarily used by an end-user.

jcapriot added 4 commits July 12, 2022 14:23
Mostly changes how defaults are instatiated
- includes a little more safety when setting `active_cells` on the `regularization_mesh`
- Includes changes to weight interaction to guard against poor behavoir a little more.
@domfournier domfournier merged commit e0b75e3 into MiraGeoscience:refactor/regularization Jul 16, 2022
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.

3 participants