Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • N NIFTy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 16
    • Issues 16
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ift
  • NIFTy
  • Issues
  • #161
Closed
Open
Issue created Jul 04, 2017 by Martin Reinecke@mtrOwner

Rework methods taking an "axes" keyword

At the moment, there are a lot of routines which take an "axes" keyword, and in many of these, it could be avoided altogether or reduced to an integer.

Example 1: the "weight" method of DomainObject and derived classes

Here, axes is mostly used to determine, which particular axes in a Field belong to the space. In principle, all of this could be avoided if this method simply returned an array with one weight per pixel (or a scalar if all weights are equal), and leave all the juggling with array indices to Field.weight().

As things are, there are various alternative implementations of the re-shaping task (look for example at the weight methods of PowerSpace and GLSpace).

My suggestion is to simplify DomainObject's weight method to:

def volfactor(self):
    """ Returns an array containing the object's volume factors.
    The array must be broadcastable to the space's dimensions
    (useful if the volume factors are uniform in a direction, e.g. for GLSpace).
    Alternatively, if all volume factors are equal, returns a scalar.
    """

... and leave all the operations involving powers, reshaping etc. to the calling Field.weight method.

Example 2: Space.hermitianize_decomposition():

Here the axes variable always contains a tuple with as many entries as the space has dimensions, and the entries take the form i, i+1, i+2, ... I suggest to pass a scalar integer with the name first_axis instead, which should be less error-prone.

If there is agreement to go into this direction, there are more cases, but we can discuss them later :)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking