Recent Releases of emg3d
emg3d - 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 (https://github.com/scipy/scipy/pull/11345).
- Replace
Scientific Software - Peer-reviewed
- Python
Published by prisae over 1 year ago
emg3d - 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
Scientific Software - Peer-reviewed
- Python
Published by prisae over 1 year ago
emg3d - 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.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 1 year ago
emg3d - 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).
Scientific Software - Peer-reviewed
- Python
Published by prisae over 1 year ago
emg3d - 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.
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 2 years ago
emg3d - 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.
Scientific Software - Peer-reviewed
- Python
Published by prisae about 3 years ago
emg3d - 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
Scientific Software - Peer-reviewed
- Python
Published by prisae over 3 years ago
emg3d - 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.
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 4 years ago
emg3d - Bugfix trimmed z-vector
- Meshing: Small fix to the automatic gridding from v1.5.0 (non-backwards compatible). A provided z-vector is new trimmed to the domain before the domain might be expanded due to the provided seasurface (which is as it was always intended, but not as it was implemented).
- Few small maintenance things in the meta files.
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 4 years ago
emg3d - CLI-clean
CLI:
- New command-line argument
--clean: If an existing simulation is loaded, setting clean will remove any existing computed data (fields, misfit, gradient, residuals, synthetic data) and replace the model with the currently provided one. - New command-line argument
--cache(or as parametercachein the configuration file under[files]): Acts as a shortcut for--load --saveusing the same file name. - Parameters for noise generation should new be provided under their own
section
[noise_opts]; providing them under[simulation]is deprecated and will be removed in v1.9.0.
- New command-line argument
Simulation:
'all'is now the same as'computed'into_fileandto_dict, meaning the grids are stored as well.- Deprecation: The
'expand'-functionality in the gridding options is deprecated and will be removed in v1.9.0. A property-complete model has to be provided.
Meshes: Bumped the change of the default value for
center_on_edgefromTruetoFalseto v1.9.0, coinciding with the above deprecations.
Scientific Software - Peer-reviewed
- Python
Published by prisae about 4 years ago
emg3d - Max offset
- Survey:
add_noisetakes new amax_offsetargument; receivers responses at offsets greater than maximum offset are set to NaN (also available through the CLI).
Scientific Software - Peer-reviewed
- Python
Published by prisae about 4 years ago
emg3d - Anisotropic gradient
- Simulation:
gradient,jvec, andjtvecnew support triaxial anisotropy (also through the CLI). As a consequence,gradientandjtvecreturn an ndarray of shape(nx, ny, nz)(isotropic) or({2;3}, nx, ny, nz)(VTI/HTI; triaxial), andjvecexpects an ndarray of shape(nx, ny, nz)(isotropic) or({1;2;3}, nx, ny, nz)(isotropic; VTI/HTI; triaxial).
Scientific Software - Peer-reviewed
- Python
Published by prisae about 4 years ago
emg3d - Meshing: center on edge
Meshes:
construct_meshandorigin_and_widthstake a new variablecenter_on_edge: IfTrue, the center is put on an edge, ifFalse, it is put at the cell center. Status quo isTrue, but the default will change toFalsein v1.7.0. If not set, it will currently raise a FutureWarning making the user aware of the change. Settingcenter_on_edgeexplicitly will suppress the warning.- Constructed grids through
construct_meshandorigin_and_widthswith a definedseasurfacemight slightly change due to some improvements and refactoring in the course of the above changes to the center. The changes should not be severe.
Simulation:
gradient: Changed slightly to use the proper adjoint (changed only if the computational grids differ from the inversion grid; requiresdiscretize).jvec: Adjusted to work for any mapping, not only conductivity, and also with adaptive gridding. It expects new a Fortran-ordered vector with the shape of the model (or a vector of that size). Gently reminder that the functionsgradient,jvec, andjtvecare still considered experimental, and might change.- New optional keyword
tqdm_opts. WithFalseyou can switch off the progress bars. Alternatively one can provide a dict, which is forwarded totqdm.
CLI:
- Expose
mean_noiseandntype, in addition tomin_offset, to the CLI (for adding noise); alsoplain(for solver), andcenter_on_edge(for gridding options).
- Expose
Scientific Software - Peer-reviewed
- Python
Published by prisae about 4 years ago
emg3d - Meshing: improve vector
Meshes: Non-backwards compatible changes in
construct_mesh(origin_and_widths;estimate_gridding_options) when providingvector's (implemented non-backwards compatible as the old rules were not intuitive nor logic; previous meshes can still be obtained, mostly, by setting the parameters carefully).- Priority-order changed to
domain > distance > vector(before it wasdomain > vector > distance). - A provided
vectoris new trimmed to the corresponding domain if it is larger than a also provided domain (fromdomainordistance); trimmed at the first point wherevector <= domain[0],vector >= domain[1]. - A
vectorcan new also be smaller than the defined domain, and the domain is then filled according to the normal rules; the last cell ofvectorin each direction is taken as starting width for the expansion.
- Priority-order changed to
Bugfixes and maintenance:
- Removed functions and modules that were deprecated in v1.2.1.
- Fixed kwargs-error when adding
add_noiseexplicitly toSimulation.compute(). - Python 3.10 added to tests; Python 3.7 tests reduced to minimum.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 4 years ago
emg3d - Bugfix CLI-select
CLI: Add remove_empty to parameter file; set to False by default (pre-v1.3.1 behaviour, and therefore backwards compatible).
Scientific Software - Peer-reviewed
- Python
Published by prisae over 4 years ago
emg3d - Select: remove empty pairs
Survey.selectremoves now empty source-receiver-frequency pairs. If you want the old behaviour setremove_empty=False.Maintenance: Added a cron to GHA; 20th of every month at 14:14.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 4 years ago
emg3d - File-based computations
electrodes:- New source
TxMagneticPoint(requiresdiscretize; mainly used as adjoint source for magnetic receivers; does not work in the presence of magnetic permeabilities in the vicinity of the source). - Both receivers (
Rx{Electric;Magnetic}Point) can now produce their proper adjoint (thanks to @sgkang!).
- New source
Changes in Simulation and parallel execution.
- Parallel computation is not sharing the simulation any longer.
- Parallel computation can new be done both file-based or all in memory.
The new possibility for file-based computation should make it possible
to compute responses for any amount of source-frequency pairs. See
parameter
file_dirin the Simulation class (or corresponding parameter in the CLI parameter file). get_modelandget_hfieldare now done on the fly, they are not stored in a dict;simulation._dict_modelandsimulation._dict_hfielddo not exist any longer.- New methods
jvec(sensitivity times a vector) andjtvec(sensitivity transpose times a vector). These methods are currently experimental; documentation and examples are lacking behind.
Various small things:
- Models and Fields return itself (not a copy) when the grid provided to
interpolate_to_gridis the same as the current one.
- Models and Fields return itself (not a copy) when the grid provided to
Scientific Software - Peer-reviewed
- Python
Published by prisae over 4 years ago
emg3d - Remove optimize & bug fix
io: Adjustment so that hdf5 tracks the order of dicts.simulations:- Adjust printing: correct simulation results for adjusted solver printing
levels; default solver verbosity is new 1;
logcan now be overwritten insolver_opts(mainly for debugging). - Functions moved out of
simulations:expand_grid_modelmoved tomodelsandestimate_gridding_optionstomeshes. The availability of these functions throughsimulationswill be removed in v1.4.0.
- Adjust printing: correct simulation results for adjusted solver printing
levels; default solver verbosity is new 1;
optimize: the module is deprecated and will be removed in v1.4.0. The two functionsoptimize.{misfit;gradient}are embedded directly inSimulation.{misfit;gradient}.
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 5 years ago
emg3d - White noise
CLI:
- New parameters
saveandloadto save and load an entire simulation. In the parameter file, they are under[files]; on the command line, they are available as--saveand--load; they are followed by the filename including its path and suffix. (In turn, the parameterstore_simulationwas removed.)
- New parameters
simulations.Simulation:- Warns if the gradient is called, but
receiver_interpolationis not'linear'. - Slightly changed the added noise in
compute(observed=True): It uses new thesurvey.add_noiseattribute. There is new a flag to set if noise should be added or not (add_noise), and if the amplitudes should be chopped or not (min_amplitude). Also note that the added noise is new white noise with constant amplitude and random phase.
- Warns if the gradient is called, but
surveys:- New function
random_noise, which can be used to create random noise in different ways. The default noise is white noise, hence constant amplitude with random phase. (This is different to before, where random Gaussian noise was added separately to the real and imaginary part.) For the random noise it requires new at least NumPy 1.17.0. - New attribute
Survey.add_noise, which uses under the hood above function. - A
Surveycan new be instantiated without receivers by settingreceiverstoNone. This is useful if one is only interested in forward modelling the entire fields. In this case, the related data object and the noise floor and relative error have no meaning. Also, in conjunction with a Simulation, the misfit and the gradient will be zero.
- New function
Various:
- All emg3d-warnings (not solver warnings) are now set to
'always', and corresponding print statements were removed. - Simplified (unified)
_edge_curl_factor(private fct).
- All emg3d-warnings (not solver warnings) are now set to
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 5 years ago
emg3d - Adjoint-fix for electric receivers
This release contains, besides the usual small bugfixes, typos, and small
improvements, an important fix for optimize.gradient. Keep in mind that
while the forward modelling is regarded as stable, the optimize module is
still work in progress.
The fixes with regard to optimize.gradient ensure that the gradient is
indeed using the proper adjoint to back-propagate the field. This is currently
only given for electric receivers, not yet for magnetic receivers. These
improvement happened mainly thanks to the help of Seogi (@sgkang).
The changes in more detail:
fields:get_receiverhas a new keywordmethod, which can be'cubic'or'linear'; default is the former, which is the same behaviour as before. However, if you want to compute the gradient, you should set it to'linear'in your Simulation parameters. Otherwise the adjoint-state gradient will not exactly be the adjoint state.get_source_fieldreturns new the real-valued, frequency-independent source vector iffrequency=None.get_source_fielduses the adjoint of trilinear interpolation for point sources (new). For dipoles and wires it the source is distributed onto the cells as fraction of the source length (as before).
electrodes: Re-introduced the point source asTxElectricPoint.simulations.Simulation:- New keyword
receiver_interpolation, which corresponds to themethodinget_receiver(see above). Cubic is more precise. However, if you are interested in the gradient, you need to choose linear interpolation at the moment, as the point source is the adjoint of linear interpolation. To be the proper adjoint for the gradient the receiver has to be interpolated linearly too. - If
griddingis'same'or'input', it checks now if the provided grid is a sensible grid for emg3d; if not, it throws a warning.
- New keyword
meshes: New functioncheck_gridto verify if a given grid is good for emg3d.optimize.gradient: Changed order when going from computational grid to inversion grid. Changing the grids at the field stage (cubic interpolation) seems to be better than changing at the cell-averaged stage::New: fieldcomp -> fieldinv -> cellsinv Old: fieldcomp -> cellscomp -> cellsinv
cli: Uses now by default linear receiver interpolation if thegradientis wanted (new), otherwise it uses cubic interpolation (as before). The new keywordreceiver_interpolationof the simulation can be set in the parameter file, which overwrites the described default behaviour.
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 5 years ago
emg3d - Stable API
Here it is, three months of hard labour lead to v1.0.0!
There are many changes, and they are listed below for each module.
Your existing code will break, and I apologize for it. Please do not hesitate to get in touch if you have troubles updating your code.
API: With version 1.0 the API becomes stable and you can expect that your
code will work fine for the duration of emg3d v1.x.
- Removed all deprecated features.
- Reduced top namespace to principal functions;
get_receiveris not in the top namespace any longer. It is advised to use directly the field method:field.get_receiver. - Moved emsig.github.io to emsig.xyz and emsig.readthedocs.io to emg3d.emsig.xyz.
- Changed principal repo branch from
mastertomain.
Detailed changes by module
CLI
- Because frequencies are now dicts as well in a Survey they have to be named by their key instead of their value when selecting data in the parameter file.
- Entire configuration is now added to the log file.
Core
restrict_weights: New signature.
Electrodes
- New module containing all sources and receivers. Currently implemented are
TxElectricDipole,TxMagneticDipole,TxElectricWire,RxElectricPoint, andRxMagneticPoint. - New class
TxElectricWirefor an arbitrary electric wire. - Receivers can be defined in absolute coordinates, or in coordinates relative to source position if they move with the source. Latter makes only sense within a Survey/Simulation.
dipis new calledelevationto make it clear that it is the angle positive upwards (anticlockwise from the horizontal plane).- Bugfix of the loop area for a magnetic dipole (the area was previously wrong except for dipoles of length of 1).
- Zero source strength does no longer mean "normalized", it means zero strength (hence no source).
- Besides the sources and receivers it contains utilities how to move
electrodes in the coordinate system (e.g.,
rotation).
Fields
fields.Field:- Is not a subclassed ndarray any longer; with all its advantages and
disadvantages. E.g., operations on
Fieldare not possible any longer and have to be carried out onField.field. However, it should be easier to maintain and expand in the future. - New signature.
- Knows new its
grid. As a consequence, all functions that required previously thegridand thefieldrequire new only thefield; e.g.,emg3d.fields.get_receiver. - Has no property
ensure_pecany longer, it is ensured directly insolver.prolongation. - Has new the methods
interpolate_to_gridandget_receiver.
- Is not a subclassed ndarray any longer; with all its advantages and
disadvantages. E.g., operations on
Renamed parameters in all functions:
srctosource;freqtofrequency;rectoreceiver.
Removed functions and classes:
SourceField; it is just a regularFieldnow;get_receiver(the name still exists, but it is now what was beforefields.get_receiver_response).
Renamed functions and classes (both do not take a
gridany longer):get_h_fieldtoget_magnetic_field;fields.get_receiver_responsetofields.get_receiver.
I/O
Model,Field,Survey, andSimulationinstances saved with an older version of emg3d will not be able to de-serialize with version 1.0. You have to update those files, see this gist: https://gist.github.com/prisae/8345c3798e35f1c73efef617ac495538
Maps
Changed function and class names:
_MaptoBaseMap;grid2gridtointerpolate(new signature);edges2cellaveragestointerp_edges_to_vol_averages(new signature);volume_averagetointerp_volume_average(new signature);interp3dtointerp_spline_3d(new signature).
maps.interpolate:- Can now be used to interpolate values living on a grid to another grid or to points defined either by a tuple or by an ndarray.
- The implemented interpolation methods are 'nearest' (new), 'linear', 'cubic', and 'volume'. Volume averaging ('volume') only works for grid-to-grid interpolations, not for grid-to-points interpolations.
- Does not accept entire fields any longer. Entire fields can be mapped with
their own
field.interpolate_to_gridmethod.
Maps cannot be (de-)serialized any longer (
{to;from_dict}); simply store its name, which can be provided tomodels.Model.Function
rotationshould be used for anything involving angles to use the defined coordinate system consistently.
Meshes
Changed function and class names:
_TensorMeshtoBaseMesh;min_cell_widthtocell_width.get_origin_widthstoorigin_and_widths(has new finer loops to fine grid sizes than before).
meshes.BaseMesh:- Reduced to the attributes
origin,h,shape_{cells;nodes},n_{cells;edges;faces},n_{edges;faces}_{x;y;z},{nodes;cell_centers}_{x;y;z},shape_{edges;faces}_{x;y;z}, andcell_volumes. These are the only required attributes foremg3d.
- Reduced to the attributes
meshes.construct_mesh:domain,vector,distance,stretching,min_width_limits, andmin_width_ppscan now also be provided as a dict containing the three keys'{x;y;z}'.meshes.skin_depthtakes newmu_rinstead ofmu.good_mg_cell_nr:max_primeis newmax_lowest, as it could also be, e.g., 9, which is not a prime.
Models
models.Model:- Knows new its
grid. As a consequence, all the functions that used to require thegridand themodelrequire new only themodel; e.g.,emg3d.solver.solveoremg3d.fields.get_magnetic_field. - If
property_yorproperty_zare not set they return nowNone, notproperty_x. - If a float is provided for a property it is new expanded to the shape of the model, and not kept as a float.
- Has to be initiated with all desired properties; it cannot be changed afterwards. E.g., if it was initiated without electric permittivity, it cannot be added afterwards. However, it can be initiated with dummy values and adjusted later.
- Renamed
interpolate2gridtointerpolate_to_grid.
- Knows new its
models.VolumeModel: Does not take agridany longer.
Simulations
Simulation:- Works new for electric and magnetic dipole sources as well as electric wire sources; electric and magnetic point receivers.
- Works now as well for surveys that contain receivers which are positioned relatively to the source.
- New signature: no
gridany longer,nameis new an optional keyword parameter, new optional keyword parameterinfo. - Method
get_sfieldis removed.
expand_grid_modelandestimate_gridding_optshave new signatures and do not take agridany longer.
Solver
solver.solve:- New signature: no
gridany longer;efieldandcycleare moved to keyword arguments. - The defaults for
sslsolver,semicoarsening, andlinerelaxationis newTrue(before it wasFalse). This is not necessarily the fastest setting, but generally the most robust setting. - New keyword parameter
plain, which is by defaultFalse. If it is set toTrueit uses plain multigrid, hencesslsolver=False,semicoarsening=False, andlinerelaxation=False, unless these parameters were set to anything different thanTrue. - Some verbosity levels changed (for consistency reasons throughout emg3d). The new levels are [old levels in brackets]:
- -1: Nothing [0]
- 0: Warnings [1]
- 1: One-liner at the end [2]
- 2: One-liner (dynamically updated) [-1]
- 3: Runtime and information about the method [same]
- 4: Additional information for each MG-cycle [same]
- 5: Everything (slower due to additional error computations) [same]
Level three updates now dynamically, just as level 2.
- New signature: no
solve_source(): New function, a shortcut forsolve(). It takes asourceand afrequencyinstead of asfield, gets thesfieldinternally, and forwards everything tosolver.solve.multigrid,krylov,smoothing,restriction,prolongation,residual,RegularGridProlongator: New signature, mainly not taking agridany longer.
Surveys
Survey:frequenciesis new a dict just likesourcesandreceivers.sourcesandreceiversmust be tuples or dicts; lists are no longer permitted. For this, the modulesurveyshas new convenience functionstxrx_coordinates_to_dictandtxrx_lists_to_dict.- Has no attribute
observedany longer; access it just like any other data throughSurvey.data.observed. rec_coordsandsrc_coordsattributes changed to the methodsreceiver_coordinatesandsource_coordinates.receiver_coordinatestakes an optional source key. For relatively located receivers, it returns by default all positions of this receiver for all source position. If a source-key is provided it only returns the receiver position for this source. This does not affect absolutely positioned receivers.- Has no attribute
rec_typesany longer. nameis new optional.- New optional keywords
dateandinfo. noise_floorandrelative_errorare new stored as data array if they are not floats.- The keyword
fixedhas been dropped. To simulate fixed surveys define the receivers with a relative offset to the source, instead of absolute coordinates. datacan be a dict containing many data set.- Automatic key names start now with 1 and have a hyphen between the prefix
and the number; they also contain the abbreviated electrode name. E.g.,
Tx0becomesTxED-1orTxMD-1orTxEW-1. Similar,Rx9becomesRxEP-10orRxMp-10, andf0becomesf-1. Survey.sizeis now the total number,Survey.countis the count of the data that actually has non-NaN values.- Now completely functional for receivers which are positioned relatively to the source.
New functions
txrx_coordinates_to_dictandtxrx_lists_to_dictto collocate many sources or receivers into dicts (alsofrequencies_to_dict).Dipole: Replaced by the new source and receiver classes in the new moduleelectrodes.
Time
Moved
Fourierfromemg3d.utilsto its own moduleemg3d.time.Renamed parameters:
freq_reqtofreq_required;freq_calctofreq_compute;freq_calc_itoifreq_compute;freq_inptoinput_freq;freq_extrapolate_itoifreq_extrapolate;freq_interpolate_itoifreq_interpolate;
Utils
- Renamed
TimetoTimer. - Moved
Fourierto its own moduleemg3d.time.Fourier. _process_mapnew avoidsconcurrent.futuresifmax_workers<2.
Scientific Software - Peer-reviewed
- Python
Published by prisae about 5 years ago
emg3d - Magnetics in Simulation
Simulation:- Sources and receivers can now be magnetic, also for the adjoint-state gradient (unit loops, not yet arbitrarily loops).
fields.get_source_field:- The
msrcargument introduced in v0.16.0 is renamed toelectric, and has the opposite meaning. If True, the source is electric, if False, the source is magnetic. This was made to streamline the meaning with the meaning given insurveys.Dipole. The old parametermsrcis deprecated and will be removed. Warning, ifmsrcwas provided as positional argument instead of as keyword argument it will now be taken aselectric, with the opposite meaning (backwards incompatible). - The magnetic source was corrected and has the opposite sign now (factor -1; backwards incompatible).
- The
Bug fixes:
- Simulation: Stop overwriting synthetic data if provided in the survey to a simulation.
- CLI: Removed configuration info from output data; caused problems when storing to h5. This has to be resolved with properly addressing the io stuff. Currently only stores the data selection to output data.
Scientific Software - Peer-reviewed
- Python
Published by prisae about 5 years ago
emg3d - Verbosity & Logging
Solvehas a new keywordlog, which enables to log the solver messages in the returned info dictionary instead of printing them to screen. This is utilized in the CLI and in theSimulationclass to log the solver info.Surveyhas a new attributeselect, which returns a reduced survey containing the selected sources, receivers, and frequencies.CLI:
- Configuration info is added to output data.
- Checks now first if all required files and directories exist, and exits gracefully otherwise informing the user. (The default thrown Python errors would be good enough; but user of the CLI interface might not be familiar with Python, so it is better to throw a very simple, clear message.)
- Log is more verbose with regards to solver (rel. error, time, nr of it.).
Dipolethrows new an error instead of a warning if it received an unknown keyword.Various small things with regard to how things are logged or shown on screen.
Changed all
DeprecationWarningstoFutureWarnings, meaning they will be removed in the next release.Bug fix with regards to data selection in the CLI; moved to
Survey(see above).
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Arbitrarily shaped sources
fields.get_source_field:- Arbitrarily shaped sources (and therefore also loops) can now be created by
providing a
srcthat consists of x-, y-, and z-coordinates of all endpoints of the individual segments. - Simple "magnetic dipole" sources can now be created by providing a point
dipole (
[x, y, z, azm, dip]) and setmsrc=True. This will create a square loop oflengthxlengthm perpendicular to the defined point dipole, hence simulating a magnetic source. Default length is 1 meter. - Point dipoles and finite length dipoles were before treated differently. Point dipoles are new converted into finite length dipoles of provided length (default is 1 meter), and treated as finite length dipoles. This is backwards incompatible and means that the source field for point dipoles might not be exactly the same as before. However, in any properly set-up simulation this should have no influence on the result.
- Bugfix: Fix floating point issue when the smaller coordinate of a finite
length dipole source was very close to a node, but not exactly. This is
done by rounding the grid locations and source position, and the precision
can be controlled via
decimals; default is micrometer.
- Arbitrarily shaped sources (and therefore also loops) can now be created by
providing a
fields: Values outside the grid inget_receiverandget_receiver_responseare new set to NaN's instead of zeroes. Additionally, the first and last values in each direction of the fields are ignored, to avoid effects form the boundary condition (receivers should not be placed that close to the boundary anyway).simulations:- Within the automatic gridding the
propertiesare estimated much more conservative now, if not provided: before the log10-average of the last slice in a given direction was used; now it uses the maximum resistivity. This is usually the air value for x/y and positive z. This is very conservative, but avoids that users use too small computational domains in the case of land and shallow marine surveys. The downside is that it heavily over-estimates the required domain in the deep marine case. However, slower but safe is better in this case. - New method
print_grids, which prints the info of all created grids. This is also used for logging in the CLI interface.
- Within the automatic gridding the
maps:interp3dtakes a new keywordcval, which is passed tomap_coordinates.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Move to EMSiG
Various small things, mostly related to the automatic meshing.
- New parameter
distanceforget_origin_widths, as an alternative fordomainandvector: distance defines the survey domain as distance from the center. This is then also available inconstruct_meshandSimulation, including the CLI. - Removed
precisionfromskin_depth,wavelength,min_cell_width; all inmeshes. It caused problems for high frequencies. - All data is stored in the
Survey, not partly inSurveyand partly inSimulation. - Deprecated
collect_classesinio. - Expanded the
what-parameter in theSimulation-class to include properties related to the gradient. - Moved from github.com/empymod to github.com/emsig.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Fix deploy; take 2
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Bugfix deploy
Small bugfix release, as v0.15.0 never got deployed.
- Fix CI deploy script.
- Makefile for the most common dev-tasks.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - discretize restructure
The package discretize went through a major restructuring with many name
changes and consequent deprecations (see below for a list of affected
mesh-properties for emg3d). This version updates emg3d to be compatible
with discretize>=0.6.0 in the long run. It also means that emg3d will, from
emg3d>=0.15.0 onwards, only work with discretize>=0.6.0.
Other notable changes:
- Bug fix re storing/loading synthetics
- Moved from Travis CI to GitHub Actions.
The relevant aliases and deprecations for emg3d are (consult the release
notes of discretize for all changes):
Aliases: Aliases (left) remain valid pointers to the new names (right).
x0=>originnC=>n_cellsvnC=>shape_cellsnN=>n_nodesvnN=>shape_nodesnE=>n_edgesnEx=>n_edges_xnEy=>n_edges_ynEz=>n_edges_zvnE=>n_edges_per_directionvnEx=>shape_edges_xvnEy=>shape_edges_yvnEz=>shape_edges_z
Deprecations: Deprecated properties (left) raise a deprecation warning and will be removed in the future. Currently, they still work and point to the new names (right).
hx=>h[0]hy=>h[1]hz=>h[2]nCx=>shape_cells[0]nCy=>shape_cells[1]nCz=>shape_cells[2]nNx=>shape_nodes[0]nNy=>shape_nodes[1]nNz=>shape_nodes[2]vectorNx=>nodes_xvectorNy=>nodes_yvectorNz=>nodes_zvectorCCx=>cell_centers_xvectorCCy=>cell_centers_yvectorCCz=>cell_centers_zvol=>cell_volumes
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Bug fix discretize
- Bug fix for
discretize>=0.6.0.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Automatic gridding
The simulation class comes new with an automatic gridding functionality, which should make it much easier to compute CSEM data. With that the entire optimization routine was improved too. See the API docs for more info of the relevant implementation.
simulation:Simulation: New gridding options'single','frequency','source', and'both'; new default is'single'.compute()takes a new argument,min_offset. Ifobserved=True, it will add Gaussian random noise according to the standard deviation of the data; it will set receivers responses below the minimum offset to NaN.- There is no longer a
referencemodel. misfitandgradientcan now handle observations with NaN's.
survey: ASurveyhas new attributesstandard_error,noise_floor, andrelative_error.optimize: Completely changed misfit and data-weighting to more sensible functions.cli:- As a consequence of the changes the
data_weight_optsgot removed. - New sections
[data]to select the wanted data and[gridding_opts]for options of the automatic gridding. - Section
[simulation]has a new parametermin_offset(for creating observed data). - Output has a new parameter
n_observationsifmisfitorgradientwere called, which is the number of observations that were used to compute the misfit.
- As a consequence of the changes the
meshes:- New functions
construct_mesh,get_origin_widths,good_mg_cell_nrand other, smaller helper routines. - Deprecated the old meshing routines
get_hx_h0,get_cell_numbers,get_stretched_h,get_domain,get_hx; they will be removed in the future. - Default of
good_mg_cell_nrchanged, and the documentation (and verbosity) with regards to «good» number of cells was improved.
- New functions
Bug fixes:
maps: Fixed the mapping of the gradients (Conductivityis the only mapping that was not affected by this bug).
Removed deprecated features:
models.Model: Removed parametersres_{x;y;z}.io.save: Removed deprecated parameterbackend.io.save: Removed default, file extension has to be provided.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - CLI
- New Module
clifor command-line interaction:
The command-line interface can currently be used to forward model an entire Simulation, and also to compute the misfit of it with respect to some data and the gradient of the misfit function. See the section "CLI interface" in the documentation for more info.
Note that, while cli (v0.13.0) and optimize (v0.12.0) are implemented, they are still in development and are likely going to change throughout the next two minor releases or so.
Other changes:
solver: Changes inverbosityforemg3d.solve:- New default verbosity is 1 (only warnings; before it was 2).
- Verbosities {-1;0;1} remain unchanged.
- Verbosities {2;3;4} => {3;4;5}.
- New verbosity 2: Only shows a one-liner at the end (plus warnings).
surveyandsimulation:to_fileandfrom_filehave new a parametername, to store and load with a particular name instead of the defaultsurvey/simulation(useful when storing, e.g., many surveys in one file).survey: stores new also the reference-data; different data (observed, reference) is contained in a data-dict when storing.simulation: takes new averbparameter.optimize:- Gradient now possible for arbitrarily rotated sources and receivers.
- Falls back to
syntheticinstead ofobservednow ifreferencenot found. io:np.bool_are converted back toboolwhen loading.- Re-arrange, improve, and update documentation.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 5 years ago
emg3d - Survey & Simulation
This is a big release with many new features, and unfortunately not completely
backwards compatible. The main new features are the new Survey and
Simulation classes, as well as some initial work for optimization
(misfit, gradient). Also, a Model can now be a resistivity model, a
conductivity model, or the logarithm (natural or base 10) therefore. Receivers
can now be arbitrarily rotated, just as the sources. In addition to the
existing soft-dependencies empymod, discretize, and h5py there are
the new soft-dependencies xarray and tqm; discretize is now much tighter
integrated. For the new survey and simulation classes xarray is a required
dependency. However, the only hard dependency remain scipy and numba, if
you use emg3d purely as a solver. Data reading and writing has new a
JSON-backend, in addition to the existing HDF5 and NumPy-backends.
In more detail:
Modules:
surveys(new; requiresxarray):- Class
surveys.Survey, which combines sources, receivers, and data. - Class
surveys.Dipole, which defines electric or magnetic point dipoles and finite length dipoles. simulations(new; requiresxarray; soft-dependencytqdm):- Class
simulations.Simulation, which combines a survey with a model. A simulation computes the e-field (and h-field) asynchronously usingconcurrent.futures. This class will include automatic, source- and frequency-dependent gridding in the future. Iftqdmis installed it displays a progress bar for the asynchronous computation. Note that the simulation class has still some limitations, consult the class documentation. models:- Model instances take new the parameters
property_{x;y;z}instead ofres_{x;y;z}. The properties can be either resistivity, conductivity, or log{e;10} thereof. What is actually provided has to be defined with the parametermapping. By default, it remains resistivity, as it was until now. The keywords `res{x;y;z}are **deprecated**, but still accepted at the moment. The attributesmodel.res_{x;y;z}` are still available too, but equally deprecated. However, it is no longer possible to assign values to these attributes, which is a backwards incompatible change. - A model knows now how to interpolate itself from its grid to another grid
(
interpolate2grid). maps:- New mappings for
models.Modelinstances: The mappings take care of how to transform the investigation variable to conductivity and back, and how it affects its derivative. - New interpolation routine
edges2cellaverages. fields:- Function
get_receiver_response(new), which returns the response for arbitrarily rotated receivers. - Improvements to
FieldandSourceField:_svaland_smu0not stored any longer, derived from_freq.SourceFieldis now using thecopy()andfrom_dict()from its parents classField.
io:- File-format
json(new), writes to a hierarchical, plain json file. - Deprecated the use of
backend, it uses the file extension offnameinstead. - This means
.npz(instead ofnumpy),.h5(instead ofh5py), and new.json. - New parameter
collect_classes, which can be used to switch-on collection of the main classes in root-level dictionaries. By default, they are no longer collected (changed). meshes:meshes.TensorMeshnew inherits fromdiscretizeif installed.- Added
__eq__tomodels.TensorMeshto compare meshes. optimize(new)- Functionalities related to inversion (data misfit, gradient, data
weighting, and depth weighting). This module is in an early stage, and
the API will likely change in the future. Current functions are
misfit,gradient(using the adjoint-state method), anddata_weighting. These functionalities are best accessed through theSimulationclass.
Dependencies:
empymodis now a soft dependency (no longer a hard dependency), only required forutils.Fourier(time-domain modelling).- Existing soft dependency
discretizeis now baked straight intomeshes. - New soft dependency
xarrayfor theSurveyclass (and therefore also for theSimulationclass and theoptimizemodule). - New soft dependency
tqdmfor nice progress bars in asynchronous computation.
Deprecations and removals:
- Removed deprecated functions
data_writeanddata_read. - Removed all deprecated functions from
utils.
- Removed deprecated functions
Miscellaneous:
- Re-organise API-docs.
- Much bookkeeping (improve error raising and checking; chaining errors, numpy types, etc).
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 6 years ago
emg3d - Refactor
Grand refactor with new internal layout. Mainly splitting-up utils into
smaller bits. Most functionalities (old names) are currently retained in
utils and it should be mostly backwards compatible for now, but they are
deprecated and will eventually be removed. Some previously deprecated functions
were removed, however.
Removed deprecated functions:
emg3d.solver.solver(useemg3d.solver.solveinstead).- Aliases of
emg3d.io.data_writeandemg3d.io.data_readinemg3d.utils.
Changes:
SourceFieldhas now the same signature asField(this might break your code if you calledSourceFielddirectly, with positional arguments, and not throughget_source_field).- More functions and classes in the top namespace.
- Replaced
core.l2normwithscipy.linalg.norm, as SciPy 1.4 got the following PR: https://github.com/scipy/scipy/pull/10397 (reason to raise minimum SciPy to 1.4). - Increased minimum required versions of dependencies to
scipy>=1.4.0(raised from 1.1, see note above)empymod>=2.0.0(no min requirement before)numba>=0.45.0(raised from 0.40)
New layout
njitted->core.utilssplit infields,meshes,models,maps, andutils.
Bugfixes:
- Fixed
to_dict,from_dict, andcopyfor theSourceField. - Fixed
ioforSourceField, that was not implemented properly.
- Fixed
Scientific Software - Peer-reviewed
- Python
Published by prisae about 6 years ago
emg3d - Zero Source
Bug fixes:
- Checks now if provided source-field is zero, and exists gracefully if so, returning a zero electric field. Until now it failed with a division-by-zero error.
Improvements:
- Warnings: If
verb=1it prints a warning in case it did not converge (it finished silently until now). - Improvements to docs (figures-scaling; intersphinx).
- Adjust
Fields.phaandFields.ampin accordance withempymod v2:.phaand.ampare now methods; uses directlyempymod.utils.EMArray. - Adjust tests for
empymod v2(Fields, Fourier).
- Warnings: If
Scientific Software - Peer-reviewed
- Python
Published by prisae about 6 years ago
emg3d - Data persistence
New:
- New functions
emg3d.saveandemg3d.loadto save and load all sort ofemg3dinstances. The currently implemented backends areh5pyfor.h5-files (default, but requiresh5pyto be installed) andnumpyfor.npz-files. - Classes
emg3d.utils.Field,emg3d.utils.Model, andemg3d.utils.TensorMeshhave new methods.copy(),.to_dict(), and.from_dict(). emg3d.utils.Model: Possible to create new models by adding or subtracting existing models, and comparing two models (+,-,==and!=). New attributesshapeandsize.emg3d.utils.Modeldoes not store the volume any longer (justvnC).
- New functions
Deprecations:
- Deprecated
data_writeanddata_read.
- Deprecated
Internal and bug fixes:
- All I/O-related stuff moved to its own file
io.py. - Change from
NUMBA_DISABLE_JITto usepy_funcfor testing and coverage. - Bugfix:
emg3d.njitted.restrictdid not store the {x;y;z}-field ifsc_dirwas {4;5;6}, respectively.
- All I/O-related stuff moved to its own file
Scientific Software - Peer-reviewed
- Python
Published by prisae about 6 years ago
emg3d - Sphinx gallery
- Rename
solver.solvertosolver.solve; loadsolvealso into the main namespace asemg3d.solve. - Adjustment to termination criterion for STAGNATION: The current error is now compared to the last error of the same cycle type. Together with this the workaround for sslsolver when called with an initial efield introduced in v0.8.0 was removed.
- Adjustment to
utils.get_hx_h0(this might change your boundaries): The calculation domain is now calculated so that the distance for the signal travelling from the source to the boundary and back to the most remote receiver is at least two wavelengths away. If this is within the provided domain, then now extra buffer is added around the domain. Additionally, the function has a new parametermax_domain, which is the maximum distance from the center to the boundary; defaults to 100 km. - New parameter
logforutils.grid2grid; ifTrue, then the interpolation is carried out on a log10-scale. - Change from the notebook-based
emg3d-examples-repo to thesphinx-basedemg3d-gallery-repo.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 6 years ago
emg3d - Complex sources
- Strength input for
get_source_fieldcan now be complex; it also stores now the source location and its strength and moment. get_receivercan now take entireFieldinstances, and returns in that case (fx,fy,fz) at receiver locations.Krylov subspace solvers:
- Solver now finishes in the middle of preconditioning cycles if tolerance is reached.
- Solver now aborts if solution diverges or stagnates also for the SSL solvers; it fails and returns a zero field.
- Removed
gmresandlgmresfrom the supported SSL solvers; they do not work nice for this problem. Supported remainbicgstab(default),cgs, andgcrotmk.
Various small things:
- New attribute
Field.is_electric, so the field knows if it is electric or magnetic. - New
verb-possibility:verb=-1is a continuously updated one-liner, ideal to monitor large sets of calculations or in inversions. - The returned
infodictionary contains new keys: runtime_at_cycle: accumulated total runtime at each cycle;error_at_cycle: absolute error at each cycle.- Simple
__repr__forTensorMesh,Model,Fourier,Time.
- New attribute
Bugfixes:
- Related to
get_hx_h0,data_write, printing inFourier.
- Related to
Scientific Software - Peer-reviewed
- Python
Published by prisae over 6 years ago
emg3d - VolumeModel
New class
VolumeModel; changes inModel:Modelnow only contains resistivity, magnetic permeability, and electric permittivity.VolumeModelcontains the volume-averaged values eta and zeta; called from withinemg3d.solver.solver.- Full wave equation is enabled again, via
epsilon_r; by default it is set to None, hence diffusive approximation. - Model parameters are now internally stored as 1D arrays.
- An {isotropic, VTI, HTI} initiated model can be changed by providing the missing resistivities.
Bugfix: Up and till version 0.8.1 there was a bug. If resistivity was set with slices, e.g.,
model.res[:, :, :5]=1e10, it DID NOT update the corresponding eta. This bug was unintentionally fixed in 0.9.0, but only realised now.Various:
- The log now lists the version of emg3d.
- PEP8: internal imports now use absolute paths instead of relative ones.
- Move from conda-channel
prisaetoconda-forge. - Automatic deploy for PyPi and conda-forge.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 6 years ago
emg3d - Fourier
New routine:
emg3d.utils.Fourier, a class to handle Fourier-transform related stuff for time-domain modelling. See the example notebooks for its usage.
Utilities:
Fieldsand returned receiver-arrays (EMArray) both have amplitude (.amp) and phase (.pha) attributes.Fieldshave attributes containing frequency-information (freq,smu0).- New class
SourceField; a subclass ofField, addingvectorandv{x,y,z}attributes for the real valued source vectors. - The
Modelis not frequency-dependent any longer and does NOT take afreq-parameter any more (currently it still takes it, but it is deprecated and will be removed in the future). data_writeautomatically removes_volfromTensorMeshinstances and_eta_{x,y,z},_zetafromModelinstances. This makes the archives smaller, and they are not required, as they are simply reconstructed if needed.
Internal changes:
- The multigrid method, as implemented, only works for the diffusive approximation. Nevertheless, we always used
\sigma-i\omega\epsilon, hence a complex number. This is now changed and\epsilonset to 0, leaving only\sigma. - Change time convention from
exp(-iwt)toexp(iwt), as used inempymodand commonly in CSEM. Removed the parameterconjugatefrom the solver, to simplify. - Change own private class variables from
__to_. resandmu_rare now checked to ensure they are >0;freqis checked to ensure !=0.
- The multigrid method, as implemented, only works for the diffusive approximation. Nevertheless, we always used
New dependencies and maintenance:
empymodis a new dependency.- Travis now checks all the url's in the documentation, so there should be no broken links down the road. (Check is allowed to fail, it is visual QC.)
Bugfixes:
- Fixes to the
setuptools_scm-implementation (MANIFEST.in).
- Fixes to the
Scientific Software - Peer-reviewed
- Python
Published by prisae over 6 years ago
emg3d - setuptools_scm
- Implement
setuptools_scmfor versioning (adds git hashes for dev-versions).
Scientific Software - Peer-reviewed
- Python
Published by prisae over 6 years ago
emg3d - Laplace
- Laplace-domain calculation: By providing a negative
freq-value toutils.get_source_fieldandutils.Model, the calculation is carried out in the real Laplace domains = freqinstead of the complex frequency domains = 2i*pi*freq. New meshing helper routines (particularly useful for transient modelling where frequency-dependent/adaptive meshes are inevitable):
utils.get_hx_h0to get cell widths and origin for given parameters including a few fixed interfaces (center plus two, e.g. top anomaly, sea-floor, and sea-surface).utils.get_cell_numbersto get good values of number of cells for given primes.
Speed-up
njitted.volume_averagesignificantly thanks to @jcapriot.Bugfixes and other minor things:
- Abort if l2-norm is NaN (only works for MG).
- Workaround for the case where a
sslsolveris used together with a provided initialefield. - Changed parameter
rhotoresfor consistency reasons inutils.get_domain. - Changed parameter
h_mintomin_widthfor consistency reasons inutils.get_stretched_h.
Scientific Software - Peer-reviewed
- Python
Published by prisae over 6 years ago
emg3d - JOSS article
- Version of the JOSS article, https://doi.org/10.21105/joss.01463 .
- New function
utils.grid2gridto move from one grid to another. Both functions (utils.get_receiverandutils.grid2grid) can be used for fields and model parameters (with or without extrapolation). They are very similar, the former taking coordinates (x, y, z) as new points, the latter one another TensorMesh instance. - New jitted function
njitted.volume_averagefor interpolation using the volume-average technique. - New parameter
conjugateinsolver.solverto permit both Fourier transform conventions. - Added
exit_statusandexit_messagetoinfo_dict. - Add section
Related ecosystemto documentation.
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 7 years ago
emg3d - H-field
New routines:
utils.get_h_field: Small routine to calculate the magnetic field from the electric field using Faraday's law.utils.get_receiver: Small wrapper to interpolate a field at receiver positions. Added 3D spline interpolation; is the new default.
Re-implemented the possibility to define isotropic magnetic permeabilities in
utils.Model. Magnetic permeability is not tri-axially included in the solver currently; however, it would not be too difficult to include if there is a need.CPU-graph added on top of RAM-graph.
Expand
utils.Fieldto work with pickle/shelve.Jit
np.linalg.norm(njitted.l2norm).Use
scooby(soft dependency) for versioning, renameVersiontoReport(backwards incompatible).Bug fixes:
- Small bugfix introduced in ebd2c9d5:
sc_cycleandlr_cyclewas not updated any longer at the end of a cycle (only affectedsslsolver=True. - Small bugfix in
utils.get_hx.
- Small bugfix introduced in ebd2c9d5:
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 7 years ago
emg3d - CPU & RAM
Further speed and memory improvements:
- Add CPU & RAM-page to documentation.
- Change loop-order from x-z-y to z-x-y in Gauss-Seidel smoothing with line relaxation in y-direction. Hence reversed lexicographical order. This results in a significant speed-up, as x is the fastest changing axis.
- Move total residual calculation from
solver.residualintonjitted.amat_x. Simplifications in
utils:- Simplify
utils.get_source_field. - Simplify
utils.Model. - Removed unused timing-stuff from early development.
- Simplify
Scientific Software - Peer-reviewed
- Python
Published by prisae almost 7 years ago
emg3d - RegularGridInterpolator
- Replace
scipy.interpolate.RegularGridInterpolatorwith a custom tailored version of it (solver.RegularGridProlongator); results in twice as fast prolongation. - Simplify the fine-grid calculation in
prolongationwithout usinggridE*; memory friendlier. - Submission to JOSS.
- Add Multi-what?-page to documentation.
- Some major refactoring, particularly in
solver. - Removed
discretizeas hard dependency. - Rename
rdirandldir(and relatedp*dir;*cycle) to the more descriptivesc_dirandlr_dir.
Scientific Software - Peer-reviewed
- Python
Published by prisae about 7 years ago
emg3d - Accepts any grid size
- First open-source version.
- Include RTD, Travis, Coveralls, Codacy, and Zenodo. No benchmarks yet.
- Accepts now any grid size (warns if a bad grid size for MG is provided).
- Coarsens now to the lowest level of each dimension, not only to the coarsest level of the smallest dimension.
- Combined
restrict_rx,restrict_ry, andrestrict_rztorestrict. - Improve speed by passing pre-allocated arrays to jitted functions.
- Store
res_y,res_zand correspondingeta_y,eta_zonly ifres_y,res_zwere provided in initial call toutils.model. - Change
zetatov_mu_r. - Include rudimentary
TensorMesh-class inutils; removes hard dependency ondiscretize. - Bugfix: Take a provided
efieldinto account; don't return if provided.
Scientific Software - Peer-reviewed
- Python
Published by prisae about 7 years ago