Skip to content

Commit

Permalink
update the model builder calls, test against python 3.11, drop testin…
Browse files Browse the repository at this point in the history
…g against python 3.8
  • Loading branch information
lheagy committed Jan 12, 2025
1 parent 6bd8406 commit 5cf0abb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.10"]
python-version: ["3.10", "3.11"]
test-file: ["tests/test_dcip.py", "tests/test_em.py", "tests/test_gpr.py tests/test_seismic.py", "tests/test_inversion.py", "tests/test_gravity.py tests/test_mag.py"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/dcip/DC_Pseudosections.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _transform(self, m):
sig1, sig2, sig3 = np.exp(sig1), np.exp(sig2), np.exp(sig3)
sigma = np.ones(mesh.nC) * sig1
sigma[mesh.gridCC[:, 1] < zh] = sig2
blkind = utils.model_builder.getIndicesSphere(np.r_[x, zc], r, mesh.gridCC)
blkind = utils.model_builder.get_indices_sphere(np.r_[x, zc], r, mesh.gridCC)
sigma[blkind] = sig3
return sigma

Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/em/TDEMGroundedSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def run_simulation(fname="tdem_gs_half.h5", sigma_block=0.01, sigma_halfspace=0.
hz = [(cs, npad, -1.5), (cs, ncz), (cs, npad, 1.5)]
mesh = TensorMesh([hx, hy, hz], "CCC")
sigma = np.ones(mesh.nC) * sigma_halfspace
blk_ind = utils.ModelBuilder.getIndicesBlock(
blk_ind = utils.ModelBuilder.get_indices_block(
np.r_[-40, -40, -160], np.r_[40, 40, -80], mesh.gridCC
)
sigma[mesh.gridCC[:, 2] > 0.0] = 1e-8
Expand Down
2 changes: 1 addition & 1 deletion geoscilabs/inversion/TomographyInversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def add_noise(self):
def get_block_index(self, xc=50, yc=50, dx=20, dy=20):
p0 = np.array([xc - dx / 2.0, yc + dy / 2])
p1 = np.array([xc + dx / 2.0, yc - dy / 2])
index = utils.model_builder.getIndicesBlock(p0, p1, self.mesh_prop.gridCC)
index = utils.model_builder.get_indices_block(p0, p1, self.mesh_prop.gridCC)
return index

def get_block_points(self, xc=50, yc=50, dx=20, dy=20):
Expand Down

0 comments on commit 5cf0abb

Please sign in to comment.