Commit 9b47dc10 authored by Philipp Arras's avatar Philipp Arras
Browse files

nifty7 -> nifty8

parent 3a83451d
...@@ -46,7 +46,7 @@ build_docker_from_cache: ...@@ -46,7 +46,7 @@ build_docker_from_cache:
test_serial: test_serial:
stage: test stage: test
script: script:
- pytest-3 -q --cov=nifty7 test - pytest-3 -q --cov=nifty8 test
- > - >
python3 -m coverage report --omit "*plot*" | tee coverage.txt python3 -m coverage report --omit "*plot*" | tee coverage.txt
- > - >
......
...@@ -144,7 +144,7 @@ In order to dive into those subtleties I suggest running the following code and ...@@ -144,7 +144,7 @@ In order to dive into those subtleties I suggest running the following code and
playing around with the dtypes. playing around with the dtypes.
``` ```
import nifty7 as ift import nifty8 as ift
import numpy as np import numpy as np
dom = ift.UnstructuredDomain(5) dom = ift.UnstructuredDomain(5)
...@@ -185,7 +185,7 @@ The code now uses `numpy`'s new `SeedSequence` and `Generator` classes for the ...@@ -185,7 +185,7 @@ The code now uses `numpy`'s new `SeedSequence` and `Generator` classes for the
production of random numbers (introduced in numpy 1.17. This greatly simplifies production of random numbers (introduced in numpy 1.17. This greatly simplifies
the generation of reproducible random numbers in the presence of MPI parallelism the generation of reproducible random numbers in the presence of MPI parallelism
and leads to cleaner code overall. Please see the documentation of and leads to cleaner code overall. Please see the documentation of
`nifty7.random` for details. `nifty8.random` for details.
Interface Change for from_random and OuterProduct Interface Change for from_random and OuterProduct
......
...@@ -97,7 +97,7 @@ To run the tests, additional packages are required: ...@@ -97,7 +97,7 @@ To run the tests, additional packages are required:
Afterwards the tests (including a coverage report) can be run using the Afterwards the tests (including a coverage report) can be run using the
following command in the repository root: following command in the repository root:
pytest-3 --cov=nifty7 test pytest-3 --cov=nifty8 test
### First Steps ### First Steps
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
def main(): def main():
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
# In NIFTy, users can add hand-crafted point-wise nonlinearities that are then # In NIFTy, users can add hand-crafted point-wise nonlinearities that are then
# available for `Field`, `MultiField`, `Linearization` and `Operator`. This # available for `Field`, `MultiField`, `Linearization` and `Operator`. This
......
...@@ -80,11 +80,11 @@ ...@@ -80,11 +80,11 @@
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
%matplotlib inline %matplotlib inline
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
......
...@@ -25,7 +25,7 @@ import sys ...@@ -25,7 +25,7 @@ import sys
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
def make_checkerboard_mask(position_space): def make_checkerboard_mask(position_space):
......
...@@ -25,7 +25,7 @@ import sys ...@@ -25,7 +25,7 @@ import sys
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
def exposure_2d(domain): def exposure_2d(domain):
......
...@@ -29,7 +29,7 @@ import sys ...@@ -29,7 +29,7 @@ import sys
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
ift.random.push_sseq_from_seed(27) ift.random.push_sseq_from_seed(27)
......
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
## Setup code ## Setup code
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import nifty7 as ift import nifty8 as ift
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
ift.random.push_sseq_from_seed(43) ift.random.push_sseq_from_seed(43)
n_pix = 256 n_pix = 256
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
# Plotting routine # Plotting routine
def plot(fields, spectra, title=None): def plot(fields, spectra, title=None):
# Plotting preparation is normally handled by nifty7.Plot # Plotting preparation is normally handled by nifty8.Plot
# It is done manually here to be able to tweak details # It is done manually here to be able to tweak details
# Fields are assumed to have identical domains # Fields are assumed to have identical domains
fig = plt.figure(tight_layout=True, figsize=(12, 3.5)) fig = plt.figure(tight_layout=True, figsize=(12, 3.5))
if title is not None: if title is not None:
fig.suptitle(title, fontsize=14) fig.suptitle(title, fontsize=14)
......
...@@ -29,7 +29,7 @@ import sys ...@@ -29,7 +29,7 @@ import sys
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
class SingleDomain(ift.LinearOperator): class SingleDomain(ift.LinearOperator):
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
if __name__ == "__main__": if __name__ == "__main__":
filename = "getting_started_density_{}.png" filename = "getting_started_density_{}.png"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
def convtest(test_signal, delta, func): def convtest(test_signal, delta, func):
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
import numpy as np import numpy as np
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
import nifty7 as ift import nifty8 as ift
ift.random.push_sseq_from_seed(27) ift.random.push_sseq_from_seed(27)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
import nifty7 as ift import nifty8 as ift
def polynomial(coefficients, sampling_points): def polynomial(coefficients, sampling_points):
......
...@@ -28,7 +28,7 @@ import numpy as np ...@@ -28,7 +28,7 @@ import numpy as np
import pylab as plt import pylab as plt
from matplotlib.colors import LogNorm from matplotlib.colors import LogNorm
import nifty7 as ift import nifty8 as ift
def main(): def main():
......
EXCLUDE="nifty7/logger.py nifty7/git_version.py" EXCLUDE="nifty8/logger.py nifty8/git_version.py"
sphinx-apidoc -e -o docs/source/mod nifty7 ${EXCLUDE} sphinx-apidoc -e -o docs/source/mod nifty8 ${EXCLUDE}
sphinx-build -b html docs/source/ docs/build/ sphinx-build -b html docs/source/ docs/build/
...@@ -13,7 +13,7 @@ NIFTy-related publications ...@@ -13,7 +13,7 @@ NIFTy-related publications
author = {{Martin Reinecke, Theo Steininger, Marco Selig}}, author = {{Martin Reinecke, Theo Steininger, Marco Selig}},
title = {NIFTy -- Numerical Information Field TheorY}, title = {NIFTy -- Numerical Information Field TheorY},
url = {https://gitlab.mpcdf.mpg.de/ift/NIFTy}, url = {https://gitlab.mpcdf.mpg.de/ift/NIFTy},
version = {nifty7}, version = {nifty8},
date = {2018-04-05}, date = {2018-04-05},
} }
......
...@@ -36,7 +36,7 @@ Domains ...@@ -36,7 +36,7 @@ Domains
Abstract base class Abstract base class
------------------- -------------------
.. currentmodule:: nifty7.domains.domain .. currentmodule:: nifty8.domains.domain
One of the fundamental building blocks of the NIFTy7 framework is the *domain*. One of the fundamental building blocks of the NIFTy7 framework is the *domain*.
Its required capabilities are expressed by the abstract :py:class:`Domain` class. Its required capabilities are expressed by the abstract :py:class:`Domain` class.
...@@ -52,7 +52,7 @@ A domain must be able to answer the following queries: ...@@ -52,7 +52,7 @@ A domain must be able to answer the following queries:
Unstructured domains Unstructured domains
-------------------- --------------------
.. currentmodule:: nifty7.domains.unstructured_domain .. currentmodule:: nifty8.domains.unstructured_domain
Domains can be either *structured* (i.e. there is geometrical information Domains can be either *structured* (i.e. there is geometrical information
associated with them, like position in space and volume factors), associated with them, like position in space and volume factors),
...@@ -65,7 +65,7 @@ Unstructured domains can be described by instances of NIFTy's ...@@ -65,7 +65,7 @@ Unstructured domains can be described by instances of NIFTy's
Structured domains Structured domains
------------------ ------------------
.. currentmodule:: nifty7.domains.structured_domain .. currentmodule:: nifty8.domains.structured_domain
In contrast to unstructured domains, these domains have an assigned geometry. In contrast to unstructured domains, these domains have an assigned geometry.
NIFTy requires them to provide the volume elements of their grid cells. NIFTy requires them to provide the volume elements of their grid cells.
...@@ -86,7 +86,7 @@ The additional methods are specified in the abstract class ...@@ -86,7 +86,7 @@ The additional methods are specified in the abstract class
NIFTy comes with several concrete subclasses of :class:`StructuredDomain`: NIFTy comes with several concrete subclasses of :class:`StructuredDomain`:
.. currentmodule:: nifty7.domains .. currentmodule:: nifty8.domains
- :class:`~rg_space.RGSpace` represents a regular Cartesian grid with an arbitrary - :class:`~rg_space.RGSpace` represents a regular Cartesian grid with an arbitrary
number of dimensions, which is supposed to be periodic in each dimension. number of dimensions, which is supposed to be periodic in each dimension.
...@@ -123,7 +123,7 @@ Some examples are: ...@@ -123,7 +123,7 @@ Some examples are:
(on a harmonic domain) and a few inferred model parameters (e.g. on an (on a harmonic domain) and a few inferred model parameters (e.g. on an
unstructured grid). unstructured grid).
.. currentmodule:: nifty7 .. currentmodule:: nifty8
Consequently, NIFTy defines a class called :class:`~domain_tuple.DomainTuple` Consequently, NIFTy defines a class called :class:`~domain_tuple.DomainTuple`
holding a sequence of :class:`~domains.domain.Domain` objects. The full domain is holding a sequence of :class:`~domains.domain.Domain` objects. The full domain is
...@@ -228,7 +228,7 @@ Advanced operators ...@@ -228,7 +228,7 @@ Advanced operators
NIFTy provides a library of commonly employed operators which can be used for NIFTy provides a library of commonly employed operators which can be used for
specific inference problems. Currently these are: specific inference problems. Currently these are:
.. currentmodule:: nifty7.library .. currentmodule:: nifty8.library
- :class:`~smooth_linear_amplitude.SLAmplitude`, which returns a smooth power spectrum. - :class:`~smooth_linear_amplitude.SLAmplitude`, which returns a smooth power spectrum.
- :class:`~inverse_gamma_operator.InverseGammaOperator`, which models point sources which are - :class:`~inverse_gamma_operator.InverseGammaOperator`, which models point sources which are
...@@ -240,7 +240,7 @@ specific inference problems. Currently these are: ...@@ -240,7 +240,7 @@ specific inference problems. Currently these are:
Linear Operators Linear Operators
================ ================
.. currentmodule:: nifty7.operators .. currentmodule:: nifty8.operators
A linear operator (represented by NIFTy7's abstract A linear operator (represented by NIFTy7's abstract
:class:`~linear_operator.LinearOperator` class) is derived from :class:`~linear_operator.LinearOperator` class) is derived from
...@@ -282,7 +282,7 @@ This functionality is provided by NIFTy's ...@@ -282,7 +282,7 @@ This functionality is provided by NIFTy's
:class:`~inversion_enabler.InversionEnabler` class, which is itself a linear :class:`~inversion_enabler.InversionEnabler` class, which is itself a linear
operator. operator.
.. currentmodule:: nifty7.operators.operator .. currentmodule:: nifty8.operators.operator
Direct multiplication and adjoint inverse multiplication transform a field Direct multiplication and adjoint inverse multiplication transform a field
defined on the operator's :attr:`~Operator.domain` to one defined on the defined on the operator's :attr:`~Operator.domain` to one defined on the
...@@ -290,7 +290,7 @@ operator's :attr:`~Operator.target`, whereas adjoint multiplication and inverse ...@@ -290,7 +290,7 @@ operator's :attr:`~Operator.target`, whereas adjoint multiplication and inverse
multiplication transform from :attr:`~Operator.target` to multiplication transform from :attr:`~Operator.target` to
:attr:`~Operator.domain`. :attr:`~Operator.domain`.
.. currentmodule:: nifty7.operators .. currentmodule:: nifty8.operators
Operators with identical domain and target can be derived from Operators with identical domain and target can be derived from
:class:`~endomorphic_operator.EndomorphicOperator`. Typical examples for this :class:`~endomorphic_operator.EndomorphicOperator`. Typical examples for this
...@@ -299,7 +299,7 @@ multiplies its input by a scalar value, and ...@@ -299,7 +299,7 @@ multiplies its input by a scalar value, and
:class:`~diagonal_operator.DiagonalOperator`, which multiplies every value of :class:`~diagonal_operator.DiagonalOperator`, which multiplies every value of
its input field with potentially different values. its input field with potentially different values.
.. currentmodule:: nifty7 .. currentmodule:: nifty8
Further operator classes provided by NIFTy are Further operator classes provided by NIFTy are
...@@ -325,7 +325,7 @@ and ``f1`` and ``f2`` are of type :class:`~field.Field`, writing:: ...@@ -325,7 +325,7 @@ and ``f1`` and ``f2`` are of type :class:`~field.Field`, writing::
X = A(B.inverse(A.adjoint)) + C X = A(B.inverse(A.adjoint)) + C
f2 = X(f1) f2 = X(f1)
.. currentmodule:: nifty7.operators.linear_operator .. currentmodule:: nifty8.operators.linear_operator
will perform the operation suggested intuitively by the notation, checking will perform the operation suggested intuitively by the notation, checking
domain compatibility while building the composed operator. domain compatibility while building the composed operator.
...@@ -349,7 +349,7 @@ Minimization ...@@ -349,7 +349,7 @@ Minimization
Most problems in IFT are solved by (possibly nested) minimizations of Most problems in IFT are solved by (possibly nested) minimizations of
high-dimensional functions, which are often nonlinear. high-dimensional functions, which are often nonlinear.
.. currentmodule:: nifty7.minimization .. currentmodule:: nifty8.minimization
Energy functionals Energy functionals
------------------ ------------------
...@@ -362,7 +362,7 @@ function's :attr:`~energy.Energy.value`, :attr:`~energy.Energy.gradient` and ...@@ -362,7 +362,7 @@ function's :attr:`~energy.Energy.value`, :attr:`~energy.Energy.gradient` and
floating-point scalars, gradients have the form of fields defined on the energy's floating-point scalars, gradients have the form of fields defined on the energy's
position domain, and metrics are represented by linear operator objects. position domain, and metrics are represented by linear operator objects.
.. currentmodule:: nifty7 .. currentmodule:: nifty8
Energies are classes that typically have to be provided by the user when Energies are classes that typically have to be provided by the user when
tackling new IFT problems. An example of concrete energy classes delivered with tackling new IFT problems. An example of concrete energy classes delivered with
...@@ -393,7 +393,7 @@ functional for MGVI and minimize it. ...@@ -393,7 +393,7 @@ functional for MGVI and minimize it.
Iteration control Iteration control
----------------- -----------------
.. currentmodule:: nifty7.minimization.iteration_controllers .. currentmodule:: nifty8.minimization.iteration_controllers
Iterative minimization of an energy requires some means of Iterative minimization of an energy requires some means of
checking the quality of the current solution estimate and stopping once checking the quality of the current solution estimate and stopping once
...@@ -417,7 +417,7 @@ in NIFTy can be found below, but users have complete freedom to implement custom ...@@ -417,7 +417,7 @@ in NIFTy can be found below, but users have complete freedom to implement custom
Minimization algorithms Minimization algorithms
----------------------- -----------------------
.. currentmodule:: nifty7.minimization .. currentmodule:: nifty8.minimization
All minimization algorithms in NIFTy inherit from the abstract All minimization algorithms in NIFTy inherit from the abstract
:class:`~minimizer.Minimizer` class, which presents a minimalistic interface :class:`~minimizer.Minimizer` class, which presents a minimalistic interface
...@@ -458,7 +458,7 @@ available under the names :class:`~scipy_minimizer.ScipyCG` and ...@@ -458,7 +458,7 @@ available under the names :class:`~scipy_minimizer.ScipyCG` and
Application to operator inversion Application to operator inversion
--------------------------------- ---------------------------------
.. currentmodule:: nifty7 .. currentmodule:: nifty8
The machinery presented here cannot only be used for minimizing functionals The machinery presented here cannot only be used for minimizing functionals
derived from IFT, but also for the numerical inversion of linear operators, if derived from IFT, but also for the numerical inversion of linear operators, if
......
import nifty7 import nifty8
extensions = [ extensions = [
'sphinx.ext.napoleon', # Support for NumPy and Google style docstrings 'sphinx.ext.napoleon', # Support for NumPy and Google style docstrings
...@@ -19,7 +19,7 @@ project = u'NIFTy7' ...@@ -19,7 +19,7 @@ project = u'NIFTy7'
copyright = u'2013-2021, Max-Planck-Society' copyright = u'2013-2021, Max-Planck-Society'
author = u'Martin Reinecke' author = u'Martin Reinecke'
release = nifty7.version.__version__ release = nifty8.version.__version__
version = release[:-2] version = release[:-2]
language = None language = None
...@@ -30,5 +30,5 @@ html_theme = "sphinx_rtd_theme" ...@@ -30,5 +30,5 @@ html_theme = "sphinx_rtd_theme"
html_logo = 'nifty_logo_black.png' html_logo = 'nifty_logo_black.png'
exclude_patterns = [ exclude_patterns = [
'mod/modules.rst', 'mod/nifty7.git_version.rst', 'mod/nifty7.logger.rst' 'mod/modules.rst', 'mod/nifty8.git_version.rst', 'mod/nifty8.logger.rst'
] ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment