Releases: emsig/emg3d
Simulation Selection II
Simulation Selection
-
Simulation
- New attribute
select, which returns a reduced simulation containing the selected sources, receivers, and frequencies. - New cleaning option
'gradient'(Simulation.clean('gradient')), cleaning only gradient-related values.
- New attribute
-
Maintenance
- Testing: added Python 3.13, 3.14; removed Python 3.10.
Release SciPy restriction
-
Maintenance:
- Replace
scipy.interpolate.interpndwithscipy.interpolate._interpnd(should be a temporary solution, would be better to not use private modules). - Fix test failures; they were related to the change of SciPy v1.15 of
constants.mu_0value changed to the more precise double precision value (scipy/scipy#11345).
- Replace
Tmp restrict SciPy
-
Maintenance:
- Restricting to
SciPy<1.15. The functionscipy.interpolate.interpndis deprecated, andscipy.interpolate.interpnd._ndim_coords_from_arraywas removed. Needs fixing inemg3d.maps._points_from_grids. - Re-adding a test for normalizing source warning; avoid rounding over and over again in recursion of creating a dipole/wire source.
- Restricting to
Bugfix and pyproject
-
Bugfix and maintenance:
- Fix bug in Dipole/Wire sources when coordinates are mixed increasing and decreasing over several cells #348.
- Changed build backend from
setup.pytopyproject.toml.
NumPy v2
The code is now compatible with NumPy v2.
-
Created foundation for new module
inversion. -
Bumped the minimum requirements to:
- Python 3.10
- SciPy 1.10
- empymod 2.3.2
- Numba (without minimum version)
-
Maintenance
- Testing: dropped Python 3.9 (Python 3.13 not added yet).
- Update for NumPy v2: mainly
np.infty -> np.inf. - Add notes for
ipympl(interactive plots in modern Jupyter). - Reduce code by making use of new SciPy new features (complex-valued map_coordinate; lazy loading).
tol_gradient isfinite
-
New hard dependency:
empymodchanged from being a soft dependency to being a hard dependency. -
Simulation
- A new parameter
tol_gradientcan be provided in the dictsolver_opts; by default it is set to the value oftol.tolis the value used forcompute(the forward),tol_gradientis used forgradient/jtvecandjvec(the gradient). In inversions, one can set the tolerance for the gradient often to a lower value, which saves computation time.
- A new parameter
-
Survey
- New attributes
isfiniteandfinite_data. Former returns the indices of the finite data, latter returns directly the finite data.
- New attributes
-
Electrodes
- Fixed
TxMagneticDipole-representation and improved documentation of the magnetic sources.
- Fixed
-
Maintenance:
-
Bumped the minimum requirements to:
- Python 3.9
- SciPy 1.9
- Numba 0.53
- empymod 2.3.0 (NEW requirement)
-
Testing: added Python 3.12, dropped Python 3.8.
-
Fix remaining outdated
python setup.pycommands. -
Many small things to keep the package updated.
-
convert & pip-full
-
io: New functionconvertto convert a file that was saved with emg3d from one file format to another file format. -
Installation through pip has new the option
pip install emg3d[full]which installs all soft dependencies as well. -
Bumped the minimum requirements to:
- Python 3.8
- NumPy 1.19
- SciPy 1.5
- Numba 0.50
-
Bug fixes, small improvements and maintenance
- Testing: added Python 3.11, dropped Python 3.7.
- Adjust copyright notice to only include original year, so it has not to be adjusted each year.
Bugfix ellipse
-
Small improvements to the ellipse-function (and the CLI):
- The major and minor axis of the ellipse are new forced to be at least 1e-9.
- A radius of 0.0 provided through the CLI is now respected (was before
overwritten).
-
empymodis more verbose when usinglayeredcomputations. -
Maintenance:
- Replace deprecated
sphinx-panelswithsphinx-design.
- Replace deprecated
Layered modelling
The simulation class takes new the parameters layered and layered_opts,
where the default values are False and None, respectively. If layered=True,
there will be no 3D computations. Instead, it will create a local layered (1D)
model for each source-receiver pair, and compute the response using the
semi-analytical code empymod (which needs to be installed manually, as it
is a soft dependency). In this case an eventual gradient is computed using the
finite-difference method, not the adjoint-state method, perturbing each layer
slightly. The main purpose of these layered computations is for quick checks,
QC, verifications, etc. Layered computation is also possible through the CLI,
through the new flag -l or --layered, and a new section [layered]
in the config file.
Other changes (many of them related to the above):
-
Model instances have a new attribute
exctract_1d, which returns a layered
(1D) model, extracted from the 3D model according the provided parameters;
see :attr:emg3d.models.Model.extract_1d. -
CLI takes new the boolean
add_noisein the section[noise_opts]
(default is True). -
Maps: New function
ellipse_indicesreturning a boolean indicating which
points fall within a general ellipse for the provided input parameters. -
Bug fixes, small improvements and maintenance
- Simulation.misfit returns an ndarray again instead of an DataArray (was
erroneously changed in v1.2.1). - Write json can now handle NumPy int/bool/float.
- A clean on a Simulation now removes correctly the weights.
- Capture error in jtvec if weight is complex NaN (should be real).
- Model:
mappingcan now be an already instantiated map (sort of
undocumented). - Cleaned-up the namespace by setting
dir()explicitly. - Replace
pytest-flake8by plainflake8. - Moved all multiprocessing-related functions to
_multiprocessing.py.
- Simulation.misfit returns an ndarray again instead of an DataArray (was