Skip to content

iris.exceptions.NotYetImplementedError: Coord AuxCoord #4000

@SarahAlidoost

Description

@SarahAlidoost

🐛 Bug Report

The order in which a mathematical operation is applied on a 'iris.coords.AuxCoord' and 'iris.cube.Cube' makes a difference, i.e.
iris.cube.Cube / iris.coords.AuxCoord works fine whereas iris.coords.AuxCoord / iris.cube.Cube returns the error as:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sarah/anaconda3/envs/iris/lib/python3.8/site-packages/iris/coords.py", line 464, in __truediv__
    return self.__binary_operator__(other, self._MODE_DIV)
  File "/home/sarah/anaconda3/envs/iris/lib/python3.8/site-packages/iris/coords.py", line 425, in __binary_operator__
    raise iris.exceptions.NotYetImplementedError(emsg)
iris.exceptions.NotYetImplementedError: Coord / AuxCoord

A workaround to avoid the error is that the user takes care of the order of "Cubes" and "Auxcoords". However, this can cause a problem in complicated equations including several terms.

How To Reproduce

Steps to reproduce the behaviour:

  1. please see cube math documentation, section Combining Multiple Phenomena to Form a New One.
  2. first, load the pressure cube as it is explained.
  3. then, define P0 as it is explained.
  4. calculate the new pressure using the equation (pressure / p0): this works fine.
  5. now make a different equation by changing the order i.e. (p0 / pressure): this returns the error, mentioned above.
  6. replace the operator " / " with any operators of " + ", " - ", or " * " and repeat steps 3 and 4: the same things happen.

Environment

  • OS & Version: Ubuntu 20.04 LTS
  • Iris Version: 3.0.1
  • environment file is attached iris.txt.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions