Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,35 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.13"

- name: Create Conda environment file
run: |
python -m pip install pyyaml
python .github/make_ci_environ.py
env:
PYTHON_VERSION: "3.13"
FREE_THREADED: false
NO_DOC_BUILD: false
NO_NUMBA: true
ENV_NAME: geoana-test
NO_NUMBA: "true"

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
environment-file: .github/environment_ci.yml
activate-environment: geoana-test
environment-file: environment_ci.yml
activate-environment: geoana-test

- name: Install Our Package
run: |
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true"

- name: Build documentation
run: |
cd docs
make html
cd ..

- name: GitHub Pages
uses: crazy-max/ghaction-github-pages@v2.5.0
with:
Expand Down Expand Up @@ -136,14 +141,17 @@ jobs:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Release to github
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true
prerelease: false

- name: Remove anywheel before pypi upload
run: rm -f dist/geoana*none-any.whl

- name: Upload wheels to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_with_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.13"

- name: Create Conda environment file
run: |
python -m pip install pyyaml
Expand Down
1 change: 1 addition & 0 deletions docs/api/geoana.kernels.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. automodule:: geoana.kernels
1 change: 1 addition & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ functions for performing useful operations.
geoana.utils
geoana.spatial
geoana.plotting_utils
geoana.kernels
6 changes: 6 additions & 0 deletions geoana/earthquake/oksar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
from datetime import datetime
from geoana.utils import requires

__all__ = [
"EarthquakeInterferogram",
"Oksar",
"example",
]

def _date_time_from_json(value):
if len(value) == 10:
return datetime.strptime(value.replace('-', '/'),'%Y/%m/%d')
Expand Down
8 changes: 7 additions & 1 deletion geoana/em/base.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import numpy as np
from scipy.constants import mu_0, epsilon_0

__all__ = [
"BaseEM",
"BaseDipole",
"BaseElectricDipole",
"BaseMagneticDipole",
"BaseLineCurrent",
]
###############################################################################
# #
# Base Classes #
# #
###############################################################################


class BaseEM:
"""Base electromagnetics class.

Expand Down
7 changes: 7 additions & 0 deletions geoana/em/fdem/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import numpy as np
from scipy.constants import mu_0, epsilon_0

__all__ = [
"omega",
"wavenumber",
"skin_depth",
"sigma_hat",
"BaseFDEM",
]
###############################################################################
# #
# Utility Functions #
Expand Down
3 changes: 3 additions & 0 deletions geoana/em/fdem/halfspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from geoana.em.base import BaseMagneticDipole
from geoana.em.fdem.base import BaseFDEM

__all__ = [
"MagneticDipoleHalfSpace",
]

class MagneticDipoleHalfSpace(BaseFDEM, BaseMagneticDipole):
r"""Class for a harmonic magnetic dipole in a wholespace.
Expand Down
3 changes: 3 additions & 0 deletions geoana/em/fdem/layered.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from geoana.kernels.tranverse_electric_reflections import rTE_forward
import libdlf

__all__ = [
"MagneticDipoleLayeredHalfSpace",
]

class MagneticDipoleLayeredHalfSpace(BaseFDEM, BaseMagneticDipole):
"""Simulation class for a harmonic magnetic dipole over a layered halfspace.
Expand Down
4 changes: 4 additions & 0 deletions geoana/em/fdem/simple_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import numpy as np
from scipy.constants import mu_0

__all__ = [
"vertical_magnetic_field_horizontal_loop",
"vertical_magnetic_flux_horizontal_loop",
]

def vertical_magnetic_field_horizontal_loop(
frequencies, sigma=1.0, mu=mu_0, radius=1.0, current=1.0, turns=1, secondary=True
Expand Down
5 changes: 5 additions & 0 deletions geoana/em/fdem/wholespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from geoana.utils import check_xyz_dim, append_ndim
from geoana.em.base import BaseElectricDipole, BaseMagneticDipole

__all__ = [
"ElectricDipoleWholeSpace",
"MagneticDipoleWholeSpace",
"HarmonicPlaneWave",
]

class ElectricDipoleWholeSpace(BaseFDEM, BaseElectricDipole):
r"""Class for simulating the fields and fluxes for a harmonic electric dipole in a wholespace.
Expand Down
8 changes: 5 additions & 3 deletions geoana/em/static/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
PointCurrentWholeSpace
PointCurrentHalfSpace
DipoleHalfSpace
MagneticPrism
"""

from geoana.em.static.sphere import ElectrostaticSphere

from geoana.em.static.sphere import MagnetostaticSphere
from geoana.em.static.sphere import (
ElectrostaticSphere,
MagnetostaticSphere,
)

from geoana.em.static.wholespace import (
MagneticDipoleWholeSpace,
Expand Down
3 changes: 3 additions & 0 deletions geoana/em/static/freespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
prism_fxyz,
)

__all__ = [
"MagneticPrism",
]

class MagneticPrism(BasePrism):
"""Class for magnetic field solutions for a prism.
Expand Down
4 changes: 4 additions & 0 deletions geoana/em/static/sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
from scipy.constants import epsilon_0
from geoana.utils import check_xyz_dim

__all__ = [
"ElectrostaticSphere",
"MagnetostaticSphere",
]

class ElectrostaticSphere:
"""Class for electrostatic solutions for a sphere in a wholespace.
Expand Down
3 changes: 2 additions & 1 deletion geoana/em/static/wholespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

__all__ = [
"MagneticDipoleWholeSpace", "CircularLoopWholeSpace",
"MagneticPoleWholeSpace", "PointCurrentWholeSpace"
"MagneticPoleWholeSpace", "PointCurrentWholeSpace",
"LineCurrentWholeSpace"
]

from ...kernels import prism_fzy
Expand Down
14 changes: 13 additions & 1 deletion geoana/em/tdem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@
magnetic_field_time_deriv_magnetic_dipole
magnetic_flux_vertical_magnetic_dipole
magnetic_flux_time_deriv_magnetic_dipole


Reference Functions
===================
Useful reference functions from Ward and Hohmann.

.. autosummary::
:toctree: generated/

reference.hz_from_vert_4_69a
reference.dhz_from_vert_4_70
reference.hp_from_vert_4_72
reference.dhp_from_vert_4_74

"""
from geoana.em.tdem.base import peak_time, diffusion_distance, theta, BaseTDEM

Expand Down
6 changes: 6 additions & 0 deletions geoana/em/tdem/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
import numpy as np
from scipy.constants import mu_0

__all__ = [
"peak_time",
"diffusion_distance",
"theta",
"BaseTDEM",
]

###############################################################################
# #
Expand Down
3 changes: 3 additions & 0 deletions geoana/em/tdem/halfspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from geoana.em.tdem.simple_functions import magnetic_field_vertical_magnetic_dipole, magnetic_field_time_deriv_magnetic_dipole
from geoana.utils import check_xyz_dim

__all__ = [
"VerticalMagneticDipoleHalfSpace",
]

class VerticalMagneticDipoleHalfSpace(BaseTDEM, BaseMagneticDipole):
"""Transient of a vertical magnetic dipole in a half space.
Expand Down
7 changes: 7 additions & 0 deletions geoana/em/tdem/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
from scipy.special import erf, ive, iv
import numpy as np

__all__ = [
"hz_from_vert_4_69a",
"dhz_from_vert_4_70",
"hp_from_vert_4_72",
"dhp_from_vert_4_74",
]

def hz_from_vert_4_69a(m, theta, rho):
front = m / (4 * np.pi * rho**3)
tp = theta * rho
Expand Down
10 changes: 10 additions & 0 deletions geoana/em/tdem/simple_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
from geoana.em.tdem.base import theta
from geoana.utils import append_ndim, check_xyz_dim

__all__ = [
"vertical_magnetic_field_horizontal_loop",
"vertical_magnetic_flux_horizontal_loop",
"vertical_magnetic_field_time_deriv_horizontal_loop",
"vertical_magnetic_flux_time_deriv_horizontal_loop",
"magnetic_field_vertical_magnetic_dipole",
"magnetic_field_time_deriv_magnetic_dipole",
"magnetic_flux_vertical_magnetic_dipole",
"magnetic_flux_time_deriv_magnetic_dipole",
]

def vertical_magnetic_field_horizontal_loop(
t, sigma=1.0, mu=mu_0, radius=1.0, current=1.0, turns=1
Expand Down
5 changes: 5 additions & 0 deletions geoana/em/tdem/wholespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
from geoana.utils import check_xyz_dim, append_ndim
from geoana.em.base import BaseElectricDipole

__all__ = [
"ElectricDipoleWholeSpace",
"TransientPlaneWave",
]

###############################################################################
# #
# Classes #
Expand Down
5 changes: 5 additions & 0 deletions geoana/gravity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
from geoana.shapes import BasePrism
from geoana.kernels import prism_f, prism_fz, prism_fzx, prism_fzy, prism_fzz

__all__ = [
"PointMass",
"Sphere",
"Prism",
]

class PointMass:
"""Class for gravitational solutions for a point mass.
Expand Down
40 changes: 39 additions & 1 deletion geoana/kernels/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
"""This module contains kernals for (semi-)analytic geophysical responses
"""
===========================================
Kernel Functions (:mod:`geoana.kernels`)
===========================================
.. currentmodule:: geoana.kernels

This module contains kernals for (semi-)analytic geophysical responses
These are optionally available as compiled extensions with fallback
`numpy` implementations.

Inverse Distance Integral Kernels
==================================
Kernels used to evaluate analytic integrals of the
1/r volume integrand (and it's derivatives)

Note that if `numba` is installed and `geoana` has compiled
extensions, these are callable in no-python mode.

.. autosummary::
:toctree: generated/

prism_f
prism_fz
prism_fzz
prism_fzx
prism_fzy
prism_fzzz
prism_fxxy
prism_fxxz
prism_fxyz

Layered Electromagnetic Reflection Kernels
==========================================
.. autosummary::
:toctree: generated/

rTE_forward
rTE_gradient

"""
from geoana.kernels.tranverse_electric_reflections import rTE_forward, rTE_gradient
from geoana.kernels.potential_field_prism import (
Expand Down
12 changes: 12 additions & 0 deletions geoana/kernels/potential_field_prism.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import numpy as np
from scipy.special import xlogy

__all__ = [
"prism_f",
"prism_fz",
"prism_fzz",
"prism_fzx",
"prism_fzy",
"prism_fzzz",
"prism_fxxy",
"prism_fxxz",
"prism_fxyz",
]


def _prism_f(x, y, z):
"""
Expand Down
Loading
Loading