Skip to content

Commit 97d66a2

Browse files
authored
Rename constructors to recipes (#64)
Rename the `create_inversion` function to `create_l2_inversion`. Update notebooks.
1 parent 3d605b8 commit 97d66a2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

notebooks/09_inversion-with-constructor.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
"chi_target = 1.0\n",
245245
"initial_model = np.zeros(n_params)\n",
246246
"\n",
247-
"inversion = ii.create_inversion(\n",
247+
"inversion = ii.create_l2_inversion(\n",
248248
" data_misfit,\n",
249249
" smallness,\n",
250250
" starting_beta=starting_beta,\n",

notebooks/12_gravity-inversion-with-constructor.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
"source": [
465465
"initial_model = np.zeros(simulation.n_params)\n",
466466
"\n",
467-
"inversion = ii.create_inversion(\n",
467+
"inversion = ii.create_l2_inversion(\n",
468468
" data_misfit,\n",
469469
" smallness,\n",
470470
" starting_beta=1e6,\n",

src/inversion_ideas/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from . import base, typing, utils
66
from ._version import __version__
77
from .conditions import ChiTarget, CustomCondition, ModelChanged, ObjectiveChanged
8-
from .constructors import create_inversion, create_sparse_inversion
98
from .data_misfit import DataMisfit
109
from .directives import (
1110
Irls,
@@ -17,6 +16,7 @@
1716
from .inversion_log import InversionLog, InversionLogRich
1817
from .minimize import GaussNewtonConjugateGradient, conjugate_gradient
1918
from .preconditioners import JacobiPreconditioner, get_jacobi_preconditioner
19+
from .recipes import create_l2_inversion, create_sparse_inversion
2020
from .regularization import Flatness, Smallness, SparseSmallness, TikhonovZero
2121
from .simulations import wrap_simulation
2222

@@ -42,7 +42,7 @@
4242
"__version__",
4343
"base",
4444
"conjugate_gradient",
45-
"create_inversion",
45+
"create_l2_inversion",
4646
"create_sparse_inversion",
4747
"get_jacobi_preconditioner",
4848
"typing",

src/inversion_ideas/constructors.py renamed to src/inversion_ideas/recipes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Functions to easily build commonly used objects in inversions.
2+
Recipe functions to easily build commonly used inversions.
33
"""
44

55
from collections.abc import Callable
@@ -14,7 +14,7 @@
1414
from .typing import Model, Preconditioner
1515

1616

17-
def create_inversion(
17+
def create_l2_inversion(
1818
data_misfit: Objective,
1919
model_norm: Objective,
2020
*,

0 commit comments

Comments
 (0)