def run(self, **kwargs): """Run.""" print("model", min(self.model()), max(self.model())) for i in range(self.maxIter()): boxprint("Iteration #%d" % i, width=80, sym="+") self.oneStep() boxprint("Iteration: %d | Chi^2: %.2f | RMS: %.2f%%" % (i, self.chi2(), self.relrms())) if self.chi2() <= 1.0: print("Done. Reached target data misfit of chi^2 <= 1.") break phi = self.getPhi() if i > 2: print("Phi / oldphi", phi / oldphi) if (i > 10) and (phi / oldphi > (1 - self.deltaPhiAbortPercent() / 100)): print("Done. Reached data fit criteria of delta phi < %.2f%%." % self.deltaPhiAbortPercent()) break if i + 1 == self.maxIter(): print("Done. Maximum number of iterations reached.") oldphi = phi return self.model()
from pygimli.utils import boxprint from sidebar_gallery import make_gallery import pkg_resources # for doc rendering on headless machines (jenkins server) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('.')) try: # from _build.doc.conf_environment import * from conf_environment import * boxprint("Building documentation out-of-source. Good.") except ImportError: TRUNK_PATH = '..' SPHINXDOC_PATH = '.' DOC_BUILD_DIR = '' DOXY_BUILD_DIR = '' boxprint("Building documentation in-source. Don't forget to make clean.") sys.path.append(os.path.abspath(join(SPHINXDOC_PATH, '_sphinx-ext'))) # The following line is necessary for the Tools section sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python/apps'))) sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python'))) sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python/pygimli'))) # -- General configuration ----------------------------------------------------
from pygimli.utils import boxprint # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) try: #from _build.doc.conf_environment import * from conf_environment import * except ImportError: TRUNK_PATH = '..' SPHINXDOC_PATH = '.' DOC_BUILD_DIR = '' DOXY_BUILD_DIR = '' boxprint("Building documentation in-source. Don't forget to make clean.") sys.path.append(os.path.abspath(join(SPHINXDOC_PATH, '_sphinx-ext'))) # The following line is necessary for the Tools section sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python/apps'))) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = '1.2' # Check for external sphinx extensions deps = ['sphinxcontrib-programoutput', 'sphinxcontrib-bibtex', 'numpydoc'] modules = [str(m).rsplit()[0] for m in pip.get_installed_distributions()]
import pygimli from pygimli.utils import boxprint import pkg_resources # for doc rendering on headless machines (jenkins server) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. from sidebar_gallery import make_gallery try: # from _build.doc.conf_environment import * from conf_environment import * boxprint("Building documentation out-of-source. Good.") except ImportError: TRUNK_PATH = '..' SPHINXDOC_PATH = '.' DOC_BUILD_DIR = '' DOXY_BUILD_DIR = '' boxprint("Building documentation in-source. Don't forget to make clean.") sys.path.append(os.path.abspath(join(SPHINXDOC_PATH, '_sphinx-ext'))) # The following line is necessary for the Tools section sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python/apps'))) sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python'))) sys.path.append(os.path.abspath(join(TRUNK_PATH, 'python/pygimli'))) # -- General configuration ----------------------------------------------------