From a71f5b771d533beaa4ee49bf59cac9071c6d2267 Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Wed, 14 Feb 2018 22:27:40 +0100 Subject: [PATCH] doc tweaks --- docs/source/conf.py | 8 +--- docs/source/index.rst | 11 ++--- docs/source/installation.rst | 4 +- nifty4/domains/lm_space.py | 40 +++++++------------ nifty4/field.py | 30 +++++++------- .../operators/harmonic_transform_operator.py | 17 ++++---- 6 files changed, 46 insertions(+), 64 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 440e025d..b96a719f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -52,16 +52,12 @@ extensions = [ 'numpydoc', 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', - 'sphinx.ext.coverage', - 'sphinx.ext.todo', + # 'sphinx.ext.coverage', + # 'sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode' ] - - - - # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/source/index.rst b/docs/source/index.rst index 29b28108..ebc7c0e1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,24 +1,19 @@ NIFTy -- Numerical Information Field Theory =========================================== -**NIFTy** [1]_, "\ **N**\umerical **I**\nformation **F**\ield **T**\heor\ **y**\ ", is a versatile library designed to enable the development of signal inference algorithms that operate regardless of the underlying spatial grid and its resolution. +**NIFTy** [1]_, "\ **N**\umerical **I**\nformation **F**\ield **T**\heor\ **y**\ ", is a versatile library designed to enable the development of signal inference algorithms that are independent of the underlying spatial grid and its resolution. Its object-oriented framework is written in Python, although it accesses libraries written in C++ and C for efficiency. NIFTy offers a toolkit that abstracts discretized representations of continuous spaces, fields in these spaces, and operators acting on fields into classes. Thereby, the correct normalization of operations on fields is taken care of automatically without concerning the user. This allows for an abstract formulation and programming of inference algorithms, including those derived within information field theory. -Thus, NIFTy permits its user to rapidly prototype algorithms in 1D and then apply the developed code in higher-dimensional settings of real world problems. +Thus, NIFTy permits its user to rapidly prototype algorithms in 1D and then apply the developed code in higher-dimensional settings to real world problems. The set of spaces on which NIFTy operates comprises point sets, *n*-dimensional regular grids, spherical spaces, their harmonic counterparts, and product spaces constructed as combinations of those. References ---------- -.. [1] Selig et al., "NIFTy -- Numerical Information Field Theory -- a versatile Python library for signal inference", `A&A, vol. 554, id. A26 `_, 2013; `arXiv:1301.4499 `_ - -Documentation -------------- - -Welcome to NIFTy's documentation! +.. [1] Steininger et al., "NIFTy 3 - Numerical Information Field Theory - A Python framework for multicomponent signal inference on HPC clusters", 2017, submitted to PLOS One; `[arXiv:1708.01073] `_ Contents ........ diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 0f096270..b7894cac 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -2,7 +2,7 @@ Installation ============ -In the following, we assume a Debian-based distribution. For other +In the following, we assume a Debian-based Linux distribution. For other distributions, the "apt" lines will need slight changes. NIFTy4 and its mandatory dependencies can be installed via:: @@ -19,7 +19,7 @@ Plotting support is added via:: pip install --user matplotlib -Support for spherical harmonic transforms is added via: +Support for spherical harmonic transforms is added via:: pip install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git diff --git a/nifty4/domains/lm_space.py b/nifty4/domains/lm_space.py index 4ee443dd..d3eeab53 100644 --- a/nifty4/domains/lm_space.py +++ b/nifty4/domains/lm_space.py @@ -24,34 +24,22 @@ from .. import dobj class LMSpace(StructuredDomain): - """NIFTy subclass for spherical harmonics components, for representations - of fields on the two-sphere. + """NIFTy subclass for sets of spherical harmonic coefficients. + + Its harmonic partner spaces are :class:`HPSpace` and :class:`GLSpace`. Parameters ---------- lmax : int - The maximum :math:`l` value of any spherical harmonics - :math:`Y_{lm}` that is represented in this Space. - Must be >=0. - - mmax : int *optional* - The maximum :math:`m` value of any spherical harmonics - :math:`Y_{lm}` that is represented in this Space. - If not supplied, it is set to lmax. - Must be >=0 and <=lmax. - - See Also - -------- - HPSpace, GLSpace - - References - ---------- - .. [#] K.M. Gorski et al., 2005, "HEALPix: A Framework for - High-Resolution Discretization and Fast Analysis of Data - Distributed on the Sphere", *ApJ* 622..759G. - .. [#] M. Reinecke and D. Sverre Seljebotn, 2013, "Libsharp - spherical - harmonic transforms revisited"; - `arXiv:1303.4945 `_ + The maximum :math:`l` value of any spherical harmonic coefficient + :math:`a_{lm}` that is represented by this object. + Must be :math:`\ge 0`. + + mmax : int, optional + The maximum :math:`m` value of any spherical harmonic coefficient + :math:`a_{lm}` that is represented by this object. + If not supplied, it is set to `lmax`. + Must be :math:`\ge 0` and :math:`\le` `lmax`. """ def __init__(self, lmax, mmax=None): @@ -122,14 +110,14 @@ class LMSpace(StructuredDomain): @property def lmax(self): """ Returns the maximum :math:`l` value of any spherical harmonic - :math:`Y_{lm}` that is represented in this Space. + coefficient :math:`a_{lm}` that is represented in this Space. """ return self._lmax @property def mmax(self): """ Returns the maximum :math:`m` value of any spherical harmonic - :math:`Y_{lm}` that is represented in this Space. + coefficient :math:`a_{lm}` that is represented in this Space. """ return self._mmax diff --git a/nifty4/field.py b/nifty4/field.py index f083b3fd..57931182 100644 --- a/nifty4/field.py +++ b/nifty4/field.py @@ -35,7 +35,7 @@ class Field(object): Parameters ---------- - domain : None, DomainTuple, tuple(Domain), or Domain + domain : None, DomainTuple, tuple of Domain, or Domain val : None, Field, data_object, or scalar The values the array should contain after init. A scalar input will @@ -45,7 +45,7 @@ class Field(object): dtype : type A numpy.type. Most common are float and complex. - copy: boolean + copy: bool """ def __init__(self, domain=None, val=None, dtype=None, copy=False): @@ -143,7 +143,7 @@ class Field(object): Parameters ---------- - random_type : String + random_type : str 'pm1', 'normal', 'uniform' are the supported arguments for this method. @@ -155,7 +155,7 @@ class Field(object): Returns ------- - out : Field + Field The output object. """ domain = DomainTuple.make(domain) @@ -187,7 +187,8 @@ class Field(object): Returns ------- - Integer tuple containing the dimensions of the spaces in domain. + tuple of int + the dimensions of the spaces in domain. """ return self._domain.shape @@ -199,8 +200,8 @@ class Field(object): Returns ------- - out : int - The dimension of the Field. + int + the dimension of the Field. """ return self._domain.size @@ -225,7 +226,7 @@ class Field(object): Returns ------- - out : Field + Field The output object. An identical copy of 'self'. """ return Field(val=self, copy=True) @@ -263,7 +264,7 @@ class Field(object): power : number The pixels get weighted with the volume-factor**power. - spaces : tuple of ints + spaces : int or tuple of int Determines on which subspace the operation takes place. out : Field or None @@ -273,7 +274,7 @@ class Field(object): Returns ------- - out : Field + Field The weighted field. """ if out is None: @@ -313,13 +314,13 @@ class Field(object): x : Field x must live on the same domain as `self`. - spaces : None, int or tuple of ints (default: None) + spaces : None, int or tuple of int (default: None) The dot product is only carried out over the sub-domains in this tuple. If None, it is carried out over all sub-domains. Returns ------- - out : float, complex, either scalar (for full dot products) + float, complex, either scalar (for full dot products) or Field (for partial dot products) """ if not isinstance(x, Field): @@ -343,7 +344,7 @@ class Field(object): Returns ------- - norm : float + float The L2-norm of the field values. """ return np.sqrt(np.abs(self.vdot(x=self))) @@ -353,7 +354,8 @@ class Field(object): Returns ------- - The complex conjugated field. + Field + The complex conjugated field. """ return Field(self._domain, self.val.conjugate()) diff --git a/nifty4/operators/harmonic_transform_operator.py b/nifty4/operators/harmonic_transform_operator.py index bcae0c56..59882083 100644 --- a/nifty4/operators/harmonic_transform_operator.py +++ b/nifty4/operators/harmonic_transform_operator.py @@ -39,18 +39,19 @@ class HarmonicTransformOperator(LinearOperator): Parameters ---------- - domain: Space, tuple of Spaces or DomainObject + domain : Domain, tuple of Domain or DomainTuple The domain of the data that is input by "times" and output by "adjoint_times". - target: Space (optional) - The target space of the transform operation. - If omitted, a space will be chosen automatically. - Whenever the input space of the transform is an RGSpace, the codomain + target : Domain, optional + The target domain of the transform operation. + If omitted, a domain will be chosen automatically. + Whenever the input domain of the transform is an RGSpace, the codomain (and its parameters) are uniquely determined. For LMSpace, a GLSpace of sufficient resolution is chosen. - space: the index of the space on which the operator should act - If None, it is set to 0 if domain contains exactly one space. - domain[space] must be a harmonic space. + space : int, optional + The index of the domain on which the operator should act + If None, it is set to 0 if domain contains exactly one subdomain. + domain[space] must be a harmonic domain. """ def __init__(self, domain, target=None, space=None): -- GitLab