Skip to content

Commit

Permalink
replace SimPEG import with simpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
lheagy committed Jan 12, 2025
1 parent 47e39a0 commit 916a009
Show file tree
Hide file tree
Showing 30 changed files with 77 additions and 77 deletions.
8 changes: 4 additions & 4 deletions geoscilabs/dcip/DCIP_overburden_PseudoSection.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

from discretize import TensorMesh

from SimPEG import maps, SolverLU, utils
from SimPEG.utils import extract_core_mesh
from SimPEG.electromagnetics.static import resistivity as DC
from SimPEG.electromagnetics.static import induced_polarization as IP
from simpeg import maps, SolverLU, utils
from simpeg.utils import extract_core_mesh
from simpeg.electromagnetics.static import resistivity as DC
from simpeg.electromagnetics.static import induced_polarization as IP
from pymatsolver import Pardiso

from ..base import widgetify
Expand Down
4 changes: 2 additions & 2 deletions geoscilabs/dcip/DCLayers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from discretize import TensorMesh

from SimPEG import maps, utils
from simpeg import maps, utils
from pymatsolver import Pardiso

from ..base import widgetify
Expand Down Expand Up @@ -153,7 +153,7 @@ def rho_a(VM, VN, A, B, M, N):

def solve_2D_potentials(rho1, rho2, h, A, B):
"""
Here we solve the 2D DC problem for potentials (using SimPEG Mesg Class)
Here we solve the 2D DC problem for potentials (using simpeg Mesg Class)
"""
sigma = 1.0 / rho2 * np.ones(mesh.nC)
sigma[mesh.gridCC[:, 1] >= -h] = 1.0 / rho1 # since the model is 2D
Expand Down
8 changes: 4 additions & 4 deletions geoscilabs/dcip/DCWidgetPlate2_5D.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from pymatsolver import Pardiso

from discretize import TensorMesh
from SimPEG import maps, SolverLU, utils
from SimPEG.utils import extract_core_mesh
from SimPEG.electromagnetics.static import resistivity as DC
from simpeg import maps, SolverLU, utils
from simpeg.utils import extract_core_mesh
from simpeg.electromagnetics.static import resistivity as DC
from ..base import widgetify

# Mesh, mapping can be globals global
Expand Down Expand Up @@ -272,7 +272,7 @@ def sumPlateCharges(xc, zc, dx, dz, rotAng, qSecondary):
return qPosSum, qNegSum, qPosAvgLoc, qNegAvgLoc


# The only thing we need to make it work is a 2.5D field object in SimPEG
# The only thing we need to make it work is a 2.5D field object in simpeg


def getSensitivity(survey, A, B, M, N, model):
Expand Down
6 changes: 3 additions & 3 deletions geoscilabs/dcip/DCWidgetPlate_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from pymatsolver import Pardiso

from discretize import TensorMesh
from SimPEG import maps, SolverLU, utils
from SimPEG.utils import extract_core_mesh
from SimPEG.electromagnetics.static import resistivity as DC
from simpeg import maps, SolverLU, utils
from simpeg.utils import extract_core_mesh
from simpeg.electromagnetics.static import resistivity as DC

from ..base import widgetify

Expand Down
6 changes: 3 additions & 3 deletions geoscilabs/dcip/DCWidgetResLayer2D.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from discretize import TensorMesh
from SimPEG import maps, SolverLU, utils
from SimPEG.utils import extract_core_mesh
from simpeg import maps, SolverLU, utils
from simpeg.utils import extract_core_mesh
import numpy as np
from SimPEG.electromagnetics.static import resistivity as DC
from simpeg.electromagnetics.static import resistivity as DC
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
Expand Down
8 changes: 4 additions & 4 deletions geoscilabs/dcip/DCWidgetResLayer2_5D.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from matplotlib.path import Path
import matplotlib.patches as patches

from SimPEG import maps, SolverLU, utils
from SimPEG.utils import extract_core_mesh
from SimPEG.electromagnetics.static import resistivity as DC
from simpeg import maps, SolverLU, utils
from simpeg.utils import extract_core_mesh
from simpeg.electromagnetics.static import resistivity as DC
from pymatsolver import Pardiso

from discretize import TensorMesh
Expand Down Expand Up @@ -331,7 +331,7 @@ def sumCylinderCharges(xc, zc, r, qSecondary):
return qPosSum, qNegSum, qPosAvgLoc, qNegAvgLoc


# The only thing we need to make it work is a 2.5D field object in SimPEG
# The only thing we need to make it work is a 2.5D field object in simpeg


def getSensitivity(survey, A, B, M, N, model):
Expand Down
6 changes: 3 additions & 3 deletions geoscilabs/dcip/DCWidget_Overburden_2_5D.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
)

from discretize import TensorMesh
from SimPEG import maps, utils
from SimPEG.utils import extract_core_mesh
from SimPEG.electromagnetics.static import resistivity as DC
from simpeg import maps, utils
from simpeg.utils import extract_core_mesh
from simpeg.electromagnetics.static import resistivity as DC

from pymatsolver import Pardiso

Expand Down
16 changes: 8 additions & 8 deletions geoscilabs/dcip/DC_Pseudosections.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
from discretize import TensorMesh
from pymatsolver import Pardiso

from SimPEG import maps, SolverLU, utils
from SimPEG.electromagnetics.static import resistivity as DC
from SimPEG.maps import IdentityMap
from SimPEG.electromagnetics.static.utils import static_utils
from simpeg import maps, SolverLU, utils
from simpeg.electromagnetics.static import resistivity as DC
from simpeg.maps import IdentityMap
from simpeg.electromagnetics.static.utils import static_utils

from ..base import widgetify

Expand Down Expand Up @@ -248,7 +248,7 @@ def PseudoSectionPlotfnc(i, j, survey, flag="PoleDipole"):
:param int i: source index
:param int j: receiver index
:param SimPEG.survey survey: SimPEG survey object
:param simpeg.survey survey: simpeg survey object
:param str flag: Survey Type 'PoleDipole', 'DipoleDipole', 'DipolePole'
"""
matplotlib.rcParams["font.size"] = 14
Expand Down Expand Up @@ -436,7 +436,7 @@ def PseudoSectionWidget(survey, flag):
associated with a particular survey
for each pair source-receiver
:param SimPEG.survey survey: Survey object
:param simpeg.survey survey: Survey object
:param str flag: Survey Type 'PoleDipole', 'DipoleDipole', 'DipolePole'
"""
dx = 5
Expand Down Expand Up @@ -496,8 +496,8 @@ def DC2Dfwdfun(
over a known geological model
:param TensorMesh mesh: discretization of the model
:param SimPEG.Simulation sim: simulation object
:param SimPEG.SigmaMap mapping: sigmamap of the model
:param simpeg.Simulation sim: simulation object
:param simpeg.SigmaMap mapping: sigmamap of the model
:param numpy.array xr: electrodes positions
:param numpy.array xzlocs: pseudolocations
:param float rhohalf: Resistivity of the half-space
Expand Down
6 changes: 3 additions & 3 deletions geoscilabs/dcip/DC_cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from pymatsolver import Pardiso
from discretize import TensorMesh

from SimPEG import maps, utils
from SimPEG.utils import extract_core_mesh, mkvc
from SimPEG.electromagnetics.static import resistivity as DC
from simpeg import maps, utils
from simpeg.utils import extract_core_mesh, mkvc
from simpeg.electromagnetics.static import resistivity as DC

from ipywidgets import interact, IntSlider, FloatSlider, FloatText, ToggleButtons, BoundedFloatText

Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/dcip/sphereElectrostatic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import matplotlib.pyplot as plt
import matplotlib.colors as colors

from SimPEG.utils import ndgrid, mkvc
from simpeg.utils import ndgrid, mkvc

"""
Authors: Thibaut Astic, Lindsey Heagy, Sanna Tyrvainen, Ronghua Peng
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/BiotSavart.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import scipy.sparse as sp
from SimPEG import utils
from simpeg import utils
from scipy.constants import mu_0


Expand Down
4 changes: 2 additions & 2 deletions geoscilabs/em/DipoleWidget1D.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from SimPEG import electromagnetics as EM
from simpeg import electromagnetics as EM
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
Expand All @@ -8,7 +8,7 @@
from ipywidgets import ToggleButtons, FloatSlider

from geoscilabs.base import widgetify
from SimPEG.view import DataView
from simpeg.view import DataView

matplotlib.rcParams["font.size"] = 12

Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/DipoleWidgetFD.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

# from SimPEG.electromagnetics import frequency_domain as EM
# from simpeg.electromagnetics import frequency_domain as EM
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/FDEMDipolarfields.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from scipy.special import erf
from SimPEG import utils
from simpeg import utils


def omega(f):
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/FDEMPlanewave.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from SimPEG import utils
from simpeg import utils


def omega(f):
Expand Down
4 changes: 2 additions & 2 deletions geoscilabs/em/HarmonicVMDCylWidget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ipywidgets import widgets
from discretize import CylindricalMesh, TensorMesh
from SimPEG import maps, utils
from SimPEG.electromagnetics import frequency_domain as fdem
from simpeg import maps, utils
from simpeg.electromagnetics import frequency_domain as fdem
from pymatsolver import Pardiso

# from pymatsolver import PardisoSolver
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/PlanewaveWidgetFD.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from SimPEG.electromagnetics.utils import waveform_utils
from simpeg.electromagnetics.utils import waveform_utils
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/TDEMDipolarfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from scipy.constants import mu_0, pi, epsilon_0
from scipy.special import erfc, erf
from discretize.utils import as_array_n_by_dim
from SimPEG import utils
from simpeg import utils

# TODO:
# r = lambda dx, dy, dz: np.sqrt( dx**2. + dy**2. + dz**2.)
Expand Down
8 changes: 4 additions & 4 deletions geoscilabs/em/TDEMGroundedSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import matplotlib.pyplot as plt
import deepdish as dd
from discretize import TensorMesh
from SimPEG import utils
from simpeg import utils
import tarfile
import os

Expand Down Expand Up @@ -83,11 +83,11 @@ def choose_model(model):


def run_simulation(fname="tdem_gs_half.h5", sigma_block=0.01, sigma_halfspace=0.01):
from SimPEG.electromagnetics import time_domain as tdem
from SimPEG.electromagnetics.utils import waveform_utils
from simpeg.electromagnetics import time_domain as tdem
from simpeg.electromagnetics.utils import waveform_utils
from scipy.constants import mu_0
import numpy as np
from SimPEG import maps, utils
from simpeg import maps, utils
from pymatsolver import Pardiso

cs = 20
Expand Down
4 changes: 2 additions & 2 deletions geoscilabs/em/TDEMHorizontalLoopCylWidget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ipywidgets import widgets, FloatText
from discretize import TensorMesh, CylindricalMesh
from SimPEG import maps, utils
from SimPEG.electromagnetics import time_domain as tdem
from simpeg import maps, utils
from simpeg.electromagnetics import time_domain as tdem

# from pymatsolver import PardisoSolver
import matplotlib.pyplot as plt
Expand Down
6 changes: 3 additions & 3 deletions geoscilabs/em/TDEMInductiveSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import matplotlib.pyplot as plt
import deepdish as dd
from discretize import TensorMesh
from SimPEG import utils
from simpeg import utils
import tarfile
import os

Expand Down Expand Up @@ -67,10 +67,10 @@ def choose_source(src_type):


def run_simulation(fname="tdem_vmd.h5", sigma_halfspace=0.01, src_type="VMD"):
from SimPEG.electromagnetics import time_domain
from simpeg.electromagnetics import time_domain
from scipy.constants import mu_0
import numpy as np
from SimPEG import maps
from simpeg import maps
from pymatsolver import Pardiso

cs = 20.0
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/TDEMPlanewave.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from SimPEG import utils
from simpeg import utils


def e_field_from_sheet_current(
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/UXO_TEM_Widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from scipy.sparse import linalg
from SimPEG import mkvc
from simpeg import mkvc
import scipy.optimize as op
from ..base import widgetify
from ipywidgets import (
Expand Down
18 changes: 9 additions & 9 deletions geoscilabs/inversion/LinearInversionCG.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import numpy as np
import discretize
from SimPEG.simulation import LinearSimulation
from SimPEG.survey import LinearSurvey
from SimPEG.data import Data
from SimPEG import data_misfit
from SimPEG import directives
from SimPEG import optimization
from SimPEG import regularization
from SimPEG import inverse_problem
from SimPEG import inversion
from simpeg.simulation import LinearSimulation
from simpeg.survey import LinearSurvey
from simpeg.data import Data
from simpeg import data_misfit
from simpeg import directives
from simpeg import optimization
from simpeg import regularization
from simpeg import inverse_problem
from simpeg import inversion
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec

Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/inversion/LinearInversionDirect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from discretize import TensorMesh
from SimPEG import (
from simpeg import (
maps,
simulation,
survey,
Expand Down
4 changes: 2 additions & 2 deletions geoscilabs/inversion/TomographyInversion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from discretize import TensorMesh
from SimPEG import (
from simpeg import (
maps,
utils,
simulation,
Expand Down Expand Up @@ -28,7 +28,7 @@
SelectMultiple,
)
import ipywidgets as widgets
import SimPEG.seismic.straight_ray_tomography as seismic
import simpeg.seismic.straight_ray_tomography as seismic
from pylab import hist


Expand Down
6 changes: 3 additions & 3 deletions geoscilabs/mag/Mag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from scipy.constants import mu_0
import re
import numpy as np
from SimPEG import utils, data
from SimPEG.potential_fields import magnetics as mag
from simpeg import utils, data
from simpeg.potential_fields import magnetics as mag


class Simulation(object):
Expand Down Expand Up @@ -316,7 +316,7 @@ def Intrgl_Fwr_Op(xn, yn, zn, rxLoc):

def createMagSurvey(xyzd, B):
"""
Create SimPEG magnetic survey pbject
Create simpeg magnetic survey pbject
INPUT
:param array: xyzd, n-by-4 array of observation points and data
Expand Down
Loading

0 comments on commit 916a009

Please sign in to comment.