Skip to content

Releases: simpeg/simpeg

v0.21.1

10 Apr 18:58
5cd200d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.21.0...v0.21.1

v0.21.0

09 Apr 21:46
de79ed0
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.20.0...v0.21.0

v0.20.0

09 Aug 18:51
364deb8
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.19.0...v0.20.0

v0.19.0

07 Jun 21:01
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.18.1...v0.19.0

Simulation

27 May 20:50
Compare
Choose a tag to compare

SimPEG 0.14.0 Release Notes

This release marks a major change in the structure of SimPEG, and it all started
with this,

  • #562: What's the problem with Problem?

We hope to answer that question with this release!

This release will break backward compatibility as many modules and classes have
been renamed. Check out the Examples and Tutorials (which have also been improved) to see how it's done.

We are also only supporting Python versions >=3.6 at this time. We have dropped all
testing and development on Python versions previous to this (especially
2.7).

Highlights

  • No more Problem-s, only Simulation-s
  • Data is important
  • PEP 8 renaming
  • Dask parallelism
  • Resistivity Simulation improvements

Simulation

We will refer to this update as the simulation update, and there are a few large
changes that we will attempt to describe here.

We (the developers) believed that there were some significant challenges with the
overall structure of the SimPEG framework, which all revolved around constructing
a forward simulation by pair-ing a Survey and a Problem. The Survey
handled things like sources, receivers, and the Problem handled the physics
engine of the forward simulation. These two items had to be created separately,
then pair-ed afterwards for both the Problem to be able to use sources, and for
the Survey to predict data. We found that this structure made it difficult to
interface with other packages and was also generally difficult to explain. Also,
field data was then attached to the Survey class.

These changes within this section are also the ones which will require the most
changes to code (which are still hopefully small).

The Simulation class

Problem has been renamed to Simulation

We decided to refactor this code into something a little more understandable.
The Simulation class is now the workhorse of the SimPEG forward simulations.
It handles things like modeling fields and projecting those fields to the data
locations defined by its survey. The Survey class is much lighter weight,
now only handling the sources and receivers. Also a single survey can now be
attached to many Simulation-s.

Previously we had something like,

survey = DC.Survey(srcList)
prob = DC.Problem3D_CC(mesh, rhoMap=mapping)
prob.pair(survey)

# Compute the fields from `prob`
fields = prob.fields(model)
# And predict data using the `survey`
dpred = survey.dpred(model, f=fields)

Now,

survey = resistivity.Survey([source_list])
sim = resistivity.Simulation3DCellCentered(
    mesh,
    survey=survey,
    rhoMap=mapping
)

# Compute the fields from `sim`
fields = sim.fields(model)
# Predict data also using `sim`
dpred = sim.dpred(model, f=fields)

See? The Simulation handles predicting data. This change will also make it
easier to interface with external codes for inversion purposes, as all that is
needed to be defined to use a Simulation for an InvProblem, is
sim.dpred, sim.Jvec and sim.Jtvec.

Please see the documentation for the SimPEG.simulation.BaseSimulation class
as well as the individual methods' Simulation-s, for a detailed description of
arguments, but largely it accepts the same arguments as the Problem class,
but now also requires a Survey to be set.

The Data class

Previously, field data would also live within the Survey class. Which was not
only confusing, but placed the importance on the wrong component. When inverting geophysical
data, we are concerned with the data. Thus we would like to enforce this importance
by making data live in a dedicated Data class. This Data class can act like a smart
dictionary to grab data associated with a specific source, receiver combination.
More importantly, this Data class is where we store information related to observed
data and its errors. This class started in the SimPEG.Survey module, but has
now been moved into its own new module SimPEG.data. See the documentation for
the SimPEG.data.Data for all of the details.

Previously,
# Add data to the survey
survey.dobs = dobs
survey.std = 0.05 # a 5% relative error
survey.eps = 1.0E-6 # a noise floor

Now,

# Create a data object
data = data.Data(dobs=dobs, relative_error=0.05, noise_floor=1e-6)

You might also notice that we changed the name of the terms used to construct
the standard deviation. See issue #846.
Previously survey.std represented an error that was relative to the absolute
value of the data. The name of this term is misleading, as it is not actually
the classic statistical standard deviation.

Previously the uncertainty was constructed as:

uncertainty = survey.std * np.abs(survey.dobs) + survey.eps

We now have updated the names to be clearer and more in line with what we would
naturally expect, which is accessed from data.standard_deviation. The value
that is returned from this is now defined as:

data.standard_deviation = (
    data.relative_error * np.abs(data.dobs) +
    data.noise_floor
)

You can also directly set the value of data.standard_deviation if you prefer
to work with that quantity.

data.standard_deviation = 0.01

This Data class is now also the object that is returned from:

data = sim.make_synthetic_data(
    m, relative_error=0.05, noise_floor=0.0, f=None, add_noise=True
)

The DataMisfit class

Previously, because the Survey class handled predicting data at the receivers,
and it also had knowledge of the observed data and its noise, we constructed the
data misfit measure using only the survey. Now we have specifically broken this
piece up into a forward Simulation object, and a Data object. This mimics
the definition of the classic data misfit measure.

image

The Simulation class handles the forward operation, image, and
the Data class handles the noise, image, and the observed data, image.
See the documentation for the SimPEG.data_misfit.L2DataMisfit for all of the details.

Previously,

# Survey knows how to predict data, knows the observed data,
# and its standard deviation
dmis = DataMisfit.l2_DataMisfit(survey)

Now,

# Create a data misfit
# The data class now knows the observed data and its standard deviation.
# The simulation knows how to create data from a model.
dmis = data_misfit.L2DataMisfit(simulation=sim, data=data)

Dask

We have begun a concerted effort to incorporate dask as a means to allow SimPEG
to scale to larger computers (and take advantage of parallelism). Checkout the
dask docs at https://docs.dask.org/en/latest/.

This feature is experimental at the moment and can be toggled on like so,

import SimPEG.dask

which will then enable parallel operations for a few modules. It will specifically
replace these functions with dask versions,

  • SimPEG.potential_fields.BasePFSimulation.linear_operator
  • SimPEG.potential_fields.magnetics.Simulation3DIntegral.getJtJdiag
  • SimPEG.potential_fields.gravity.Simulation3DIntegral.getJtJdiag
  • SimPEG.electromagnetics.static.resistivity.simulation.BaseDCSimulation.getJ
  • SimPEG.electromagnetics.static.resistivity.simulation.BaseDCSimulation.getJtJdiag
  • SimPEG.electromagnetics.static.induced_polarization.simulation.BaseDCSimulation.getJ
  • SimPEG.electromagnetics.static.induced_polarization.simulation.BaseDCSimulation.getJtJdiag

Changelog

As can be expected, there are many changes in this release, and we hope to identify
most of them here (or at least point you in the right direction).

Renamed Modules

We have taken steps to rename the modules of SimPEG to a more PEP 8 friendly
system. The previous locations do not exist.

  • EMelectromagnetics
  • EM.FDEMelectromagnetics.frequency_domain
  • EM.TDEMelectromagnetics.time_domain
  • EM.NSEMelectromagnetics.natural_source
  • EM.Staticelectromagnetics.static
  • EM.Static.DCelectromagnetics.static.resistivity
  • EM.Static.DC.Utilselectromagnetics.static.resistivity.utils
  • EM.Static.IPelectromagnetics.static.induced_polarization
  • EM.Static.SIPelectromagnetics.static.spectral_induced_polarization
  • EM.Static.Utilselectromagnetics.static.utils
  • EM.Utilselectromagnetics.utils
  • VRMelectromagnetics.viscous_remanent_magnetization
  • FLOWflow
  • SEISseismic
  • PFpotential_fields
  • PF.Gravitypotential_fields.gravity
  • PF.GravAnalyticspotential_fields.gravity.analytics
  • PF.Magneticspotential_fields.magnetics
  • PF.MagAnalyticspotential_fields.magnetics.analytics
  • Utilsutils
  • DataMisfitdata_misfit
  • Directivesdirectives
  • Fieldsfields
  • InvProbleminverse_problem
  • Inversioninversion
  • Mapsmaps
  • Modelsmodels
  • ObjectiveFunction → ``obje...
Read more

Tutorials and various bug fixes and improvements

17 Jan 03:39
Compare
Choose a tag to compare

SimPEG 0.13.1 release notes

from PR: #813, #824, #828, #829, #833
commits from: @dccowan, @fperez, @lheagy, @rowanc1, @thast

List of updates:

  • fix for the VRM examples, updated for matplotlib 3.1.1 (PR #813)
  • Add a .mailmap file to help organize author statistics. (PR #828)
  • unpin sphinx version in the dev requirements (PR #829)
  • fix bug in computing the extension of the topography data in surfac2ind_topo (PR #833)
  • tutorials for models and mapping (PR #824)
    image

Regularization, utils.plot2Ddata updates

13 Sep 21:25
Compare
Choose a tag to compare

Updates to Simple regularization

Summary

Proposed modification to the model gradient measure for Simple and Sparse regularization.
Normalized length scales are multiplying cell_weights before averaging to cell faces.

  • Reduces the dependency of the model on cell size changes
  • Still allows for IRLS weights to be mesh independent
  • Default alpha's remain at 1 (takes care of length scales internally)

Before
image

After
LengthScalesApplied

Additional Notes
This pr also removed 2 VRM examples and the 1D MT example as they were failing. Issues #812, #814 document the issues, and pr's #813 and #815 have been started to resolve those issues.

Updates to Utils.plot2Ddata

summary

add shading options in utils.plot2Ddata

Illustrations:

  • On the docs example:
    image

  • On a mag dataset:
    image

Minor updates:

  • small fix in the calling of mkvc in the regularization mesh (from #810, commits from @thast)
  • update dependencies in the setup.py to remove indirect ones (from #188, commits from @lheagy)

Spectral Induced Polarization

31 Jul 21:09
Compare
Choose a tag to compare

Spectral Induced Polarization Inversion

  • Invert multiple time channels of IP data to recover 3D distribution of polarization
    parameters: eta, tau, and c

  • Can handle various data types: volt (V) or apparent_chargeability (V/V)

  • Profile SIP modules to make sure it can handle large-scale time-domain IP data (storeJ=False)

image

DC and IP codes

  • Can handle various data types: volt (V) or apparent_resistivity (ohm-m), or apparent_chargeability (V/V)

Examples using DC, IP, SIP codes are available through:

https://github.com/simpeg-research/kang-2018-spectral-inducedpolarization/tree/master/notebooks

break regularization into multiple files

30 Jul 04:45
Compare
Choose a tag to compare

Summary

  • break up Regularization.py into multiple files in a regularization module
    • Regularization Mesh in regularization_mesh.py
    • BaseRegularization and BaseComboRegularization in base.py
    • Tikhonov and Simple in tikhonov.py
    • Sparse in sparse.py

Versions

25 Jun 18:23
Compare
Choose a tag to compare

Replace func versions by class Versions

Turns out that there is a way to have html in a notebook and non-html in all the rest without even checking if you are in a notebook or not (thanks @banesullivan; simpeg/discretize#142).

All that is needed is a Versions-class which has the right functions linked to __repr__ and _repr_html_:

class Versions:

    def __init__(self, add_pckg=None, ncol=4):
        self.add_pckg = add_pckg
        self.ncol = ncol

    def __repr__(self):
        return versions_text(self.add_pckg)

    def _repr_html_(self):
        return versions_html(self.add_pckg, self.ncol)

By removing the old functions, respectively integrating the relevant parts into the new class, the whole version printing utility gets a lot simpler (however, it is not backwards compatible).

Before, you had to do

from SimPEG import versions
versions()

in Python, IPython etc, and in Jupyter

from SimPEG import versions
versions('HTML')

Updating your code

Now, you simply do

from SimPEG import Versions
Versions()

EVERYWHERE (note the uppercase V), and it will automatically print a html table in a notebook, and plain text everywhere else.