Releases: simpeg/simpeg
v0.21.1
What's Changed
- Fix hard dask dependency by @jcapriot in #1415
- Add release notes for v0.21.1 by @santisoler in #1416
Full Changelog: v0.21.0...v0.21.1
v0.21.0
What's Changed
- Add 0.20.0 release notes to toc by @jcapriot in #1277
- add plausible analytics to simpeg docs by @lheagy in #1279
- Refresh links in documentation by @mplough-kobold in #1282
- Run pytest on Azure with increased verbosity by @santisoler in #1287
- Allow to use random seed in make_synthetic_data by @santisoler in #1286
- pgi doc by @thibaut-kobold in #1291
- Fix deprecation warning for gradientType in SparseSmoothness by @santisoler in #1284
- Gravity simulation with Choclo as engine by @santisoler in #1285
- Fix minor flake8 warning by @santisoler in #1307
- ISSUE-1298: Use normal distributed noise in example. by @domfournier in #1312
- Ditch deprecated functions in utils.model_builder by @domfournier in #1311
- Triaxial magnetic gradient forward modelling by @thibaut-kobold in #1288
- Documentation improvements for classes in Objective Function Pieces by @ghwilliams in #1292
- Fix description of source_field in gravity survey by @santisoler in #1322
- Add
weights_keys
method toBaseRegularization
by @santisoler in #1320 - Bump versions of flake8 and black and pin flake plugins by @santisoler in #1330
- Move
__init__
inBaseSimulation
to the top of the class by @santisoler in #1323 - Simpeg vector update by @johnweis0480 in #1329
- Fix typo in error messages by @santisoler in #1324
- Fix issue with lengthscales in coterminal angle calculations by @domfournier in #1299
- Simplify check for invalid multipliers by @santisoler in #1336
- Ravel instead of flatten by @thibaut-kobold in #1343
- Fix implementation of coterminal function by @domfournier in #1334
- Update cross gradient hessian approximation by @jcapriot in #1355
- ISSUE-1341: Set parent of objective functions by @domfournier in #1342
- Fix partial derivatives in regularization docs by @santisoler in #1362
- Remove factor of half in data misfits and regularizations by @lheagy in #1326
- Improvements to template for a bug report issue by @lheagy in #1359
- Simplify a few gravity simulation tests by @santisoler in #1363
- Exponential Sinusoids Simulation by @lheagy in #1337
- Replace magnetic SourceField for UniformBackgroundField by @santisoler in #1364
- Remove deprecated regularization classes by @santisoler in #1365
- Removed deprecated properties of UpdateSensitivityWeights by @santisoler in #1368
- Replace indActive for active_cells in regularizations by @santisoler in #1366
- Remove the debug argument from InversionDirective by @santisoler in #1370
- Remove cellDiff properties of RegularizationMesh by @santisoler in #1371
- Remove deprecated bits of code by @santisoler in #1372
- Use choclo in gravity tutorials by @santisoler in #1378
- Remove surface2ind_topo by @santisoler in #1374
- Speed up sphinx documentation building by @jcapriot in #1382
- Add docs/sg_execution_times.rst to .gitignore by @santisoler in #1380
- Describe merge process of Pull Requests in docs by @santisoler in #1375
- Simplify private methods in gravity simulation by @santisoler in #1384
- Update Slack links: point to Mattermost by @santisoler in #1385
- added getJ for fdem and nsem simulations by @JKutt in #1276
- Add LogisticSigmoidMap by @ckohnke in #1352
- Remove the cell_weights attribute in regularizations by @santisoler in #1376
- Remove regmesh, mref and gradientType from regularizations by @santisoler in #1377
- Test if gravity sensitivities are stored on disk by @santisoler in #1388
- Check if mesh is 3D when using Choclo in gravity simulation by @santisoler in #1386
- Rotated Gradients by @jcapriot in #1167
- Add directives to the API Reference by @santisoler in #1397
- Remove deprecated modelType in mag simulation by @santisoler in #1399
- Remove mref property of PGI regularization by @santisoler in #1400
- Add link to User Tutorials to navbar in docs by @santisoler in #1401
- Improve documentation for base simulation classes by @ghwilliams in #1295
- Enforce regularization
weights
as dictionaries by @YingHuuu in #1344 - Minor adjustments to Sphinx configuration by @santisoler in #1398
- Update AUTHORS.rst by @lheagy in #1259
- Update year in LICENSE by @lheagy in #1404
- Dask MetaSim by @jcapriot in #1199
- Add Ying and Williams to AUTHORS.rst by @santisoler in #1405
- Remove link to "twitter" by @jcapriot in #1406
- Bump Black version to 24.3.0 by @santisoler in #1403
- Add release notes for SimPEG v0.21 by @santisoler in #1409
- Publish documentation on azure by @jcapriot in #1412
New Contributors
- @mplough-kobold made their first contribution in #1282
- @ghwilliams made their first contribution in #1292
- @johnweis0480 made their first contribution in #1329
- @ckohnke made their first contribution in #1352
- @YingHuuu made their first contribution in #1344
Full Changelog: v0.20.0...v0.21.0
v0.20.0
What's Changed
- Add a linearity property to mappings by @jcapriot in #1212
- Pydata sphinx theme updates by @jcapriot in #1213
- Meta/meta patches by @jcapriot in #1215
- Tiny typo triggers error when displaying error output string by @nwilliams-kobold in #1216
- Sp reimplement by @jcapriot in #1211
- Refactor PGI_BetaAlphaSchedule directive by @santisoler in #1195
- Update index.rst by @lheagy in #1217
- Replace deprecated numpy type aliases with builtin types by @yanang007 in #1224
- Cross reference vector by @jcapriot in #1214
- Discretize 0.9.0updates by @jcapriot in #1230
- Generalize add for any ComboObjectiveFunction by @santisoler in #1229
- Fix IP simulation / inversion with SimPEG.dask by @thibaut-kobold in #1231
- Amplitude regularization by @domfournier in #1103
- General Doc cleanup by @jcapriot in #1234
- conditionally allow invertible property to also be optional by @jcapriot in #1235
- Multiprocessing MetaSimulation by @jcapriot in #1201
- Merge docs for developers into a Contributing section by @santisoler in #1240
- Move flake8 ignored rules to
.flake8
and rename Makefile targets by @santisoler in #1238 - Fix flake
E711
error: wrong comparison with None by @santisoler in #1242 - Fix flake
E731
error: assign lambda functions by @santisoler in #1243 - Fix
F522
,F523
,F524
flake errors: format calls by @santisoler in #1245 - Simplify CONTRIBUTING.md by @santisoler in #1247
- Test patches by @jcapriot in #1251
- Fix
F541
flake error: f-string without placeholder by @santisoler in #1246 - Add more hints about pre-commit in documentation by @santisoler in #1249
- Fix F811 flake error: remove redefinitions by @santisoler in #1248
- Add flake8 to pre-commit configuration by @santisoler in #1239
- Rename "basic" directory in docs to "getting_started" by @santisoler in #1250
- Always calculate gzz if needed by @jcapriot in #1253
- Fix flake
F403
andF405
errors: don't use star imports by @santisoler in #1244 - Fix W291 and W293 flake errors: white spaces by @santisoler in #1252
- Fix B028 flake error: non-explicit stacklevel by @santisoler in #1254
- Refactor
BaseObjectiveFunction
andComboObjectiveFunction
by @santisoler in #1241 - Make units of gravity simulations more explicit by @santisoler in #1256
- Update pull_request_template.md by @lheagy in #1258
- Anisotropy derivative support by @jcapriot in #1237
- Optionally import utm by @jcapriot in #1260
- FDEM permittivity by @lheagy in #1236
- Set storage type of pf sensitivity matrix by @jcapriot in #1261
- Regularization docstrings by @dccowan in #1225
- final unresolved comments for PR #1225 by @dccowan in #1262
- Fix sparse inversion example: remove beta schedule by @santisoler in #1264
- unpack the data misfits for plotting tikhonov curves by @lheagy in #1257
- use setuptools_scm to track version by @jcapriot in #1274
- Add building docs and serving them to documentation by @andieie in #1267
- 0.20.0 staging by @jcapriot in #1275
New Contributors
- @yanang007 made their first contribution in #1224
- @andieie made their first contribution in #1267
Full Changelog: v0.19.0...v0.20.0
v0.19.0
What's Changed
- Fix (and test) the pgi tutorials. by @jcapriot in #1133
- Run style checks in Azure Pipelines by @santisoler in #1134
- Add property to control number of processes created. by @jcapriot in #1135
- Use r-strings on strings and docstrings that contain backslashes by @santisoler in #1136
- Run flake8 in CI against a selection of rules by @santisoler in #1141
- Rename variables to avoid shadowing builtins by @santisoler in #1137
- Ignore flake warning over empty docstrings by @santisoler in #1149
- Avoid using getattr with fixed constant strings by @santisoler in #1139
- Separate flake 8 ignores by line breaks by @jcapriot in #1150
- Avoid using mutables as default parameters by @santisoler in #1142
- Ignore b028 by @jcapriot in #1155
- Remove unused imports across SimPEG by @santisoler in #1132
- Avoid calling functions in default arguments by @santisoler in #1143
- Fix plot_inv_mag_MVI_Sparse_TreeMesh.py by @thibaut-kobold in #1159
- fix mref depreciation in regularization/pgi.py by @thibaut-kobold in #1157
- Avoid using variables not binded in function definition by @santisoler in #1145
- Remove unused loop variables by @santisoler in #1138
- Enable use of inactive cells in equivalent source models by @nwilliams-kobold in #1147
- Flexible dc boundary by @jcapriot in #1168
- Do not use multiprocessing on single thread. by @jcapriot in #1170
- fix gmm.plot_pdf new error from sklearn >=1.2 by @thibaut-kobold in #1156
- Black 23.1 by @jcapriot in #1174
- Fix for _has_fields by @jcapriot in #1175
- Do not import deprecated discretize utilities by @jcapriot in #1176
- update codecov script by @jcapriot in #1178
- Linear mapping by @jcapriot in #1177
- Use discretize.utils.active_from_xyz to get active topography cells by @dccowan in #1171
- Update minimum versions by @jcapriot in #1179
- Add B028 to flake8 ignore by @jcapriot in #1181
- Add possibility to pass fields to getJtJdiag by @jcapriot in #1182
- Mira review beta estimator by @dccowan in #1173
- Add option for amplitude threshold on UpdateSens directive by @domfournier in #1163
- Change default n_processes for potential fields by @jcapriot in #1186
- Update current_utils.py by @domfournier in #1166
- Avoid comparing bool variables to True or False by @santisoler in #1160
- Avoid using bare
except
s that catch every possible exception by @santisoler in #1140 - Update SimPEG.Report() by @prisae in #1104
- Addition regarding inversion to big_picture by @prisae in #729
- Do not store real lambdas as complex by @jcapriot in #1190
- Improve docstring of depth_weighting by @santisoler in #1192
- Add issue forms for github by @jcapriot in #1189
- Update deprecation usage in optimization module by @jcapriot in #1194
- Update getting started guides by @jcapriot in #1188
- Update DC1D for flexibility and speed by @jcapriot in #1191
- Start removing unused variables by @santisoler in #1161
- Fix check for reference_model in PGI regularization by @santisoler in #1196
- update JTV to work for an arbitrary number of models by @jcapriot in #1197
- Simulation of Simulations by @jcapriot in #1183
- Remove flake errors that were already solved by @santisoler in #1203
- Fix flake8
B015
errors: solve unused comparisons by @santisoler in #1200 - Fix flake E401 error: multiple imports in one line by @santisoler in #1202
- Patch/identity map init by @jcapriot in #1205
- Fix length scale getters by @jcapriot in #1207
- Patch/fix save sparse dict by @jcapriot in #1206
- Add PR template file by @jcapriot in #1208
- 0.19.0 Staging by @jcapriot in #1209
Full Changelog: v0.18.1...v0.19.0
Simulation
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, onlySimulation
-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.
The Simulation
class handles the forward operation, , and
the Data
class handles the noise, , and the observed data, .
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.
EM
→electromagnetics
EM.FDEM
→electromagnetics.frequency_domain
EM.TDEM
→electromagnetics.time_domain
EM.NSEM
→electromagnetics.natural_source
EM.Static
→electromagnetics.static
EM.Static.DC
→electromagnetics.static.resistivity
EM.Static.DC.Utils
→electromagnetics.static.resistivity.utils
EM.Static.IP
→electromagnetics.static.induced_polarization
EM.Static.SIP
→electromagnetics.static.spectral_induced_polarization
EM.Static.Utils
→electromagnetics.static.utils
EM.Utils
→electromagnetics.utils
VRM
→electromagnetics.viscous_remanent_magnetization
FLOW
→flow
SEIS
→seismic
PF
→potential_fields
PF.Gravity
→potential_fields.gravity
PF.GravAnalytics
→potential_fields.gravity.analytics
PF.Magnetics
→potential_fields.magnetics
PF.MagAnalytics
→potential_fields.magnetics.analytics
Utils
→utils
DataMisfit
→data_misfit
Directives
→directives
Fields
→fields
InvProblem
→inverse_problem
Inversion
→inversion
Maps
→maps
Models
→models
ObjectiveFunction
→ ``obje...
Tutorials and various bug fixes and improvements
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)
Regularization, utils.plot2Ddata updates
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)
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:
Minor updates:
Spectral Induced Polarization
Spectral Induced Polarization Inversion
-
Invert multiple time channels of IP data to recover 3D distribution of polarization
parameters:eta
,tau
, andc
-
Can handle various data types:
volt
(V) orapparent_chargeability
(V/V) -
Profile
SIP
modules to make sure it can handle large-scale time-domain IP data (storeJ=False
)
DC and IP codes
- Can handle various data types:
volt
(V) orapparent_resistivity
(ohm-m), orapparent_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
Versions
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.