nata icon indicating copy to clipboard operation
nata copied to clipboard

`axes_type` for backend

Open ahelm opened this issue 5 years ago • 2 comments

Currently, we only return min and max for the different axes in a GridBackend. We should consider two things:

  1. Provide an additional Sequence[str] determining what type of axes it is, e.g., log, linear, something_else. It should appear in the docs what is possible.
  2. Provide additional attribute axes_values. If this is present discard above's logic so that this axes_values are used.

I think the latter point would even provide the possibility to use non-uniform grids.

The updated protocol would be something like this:

class GridBackendType(BackendType, Protocol):
    ...

    axes_type: Sequence[str]

    axes_min: Optional[np.ndarray]
    axes_max: Optional[np.ndarray]

    axes_values: Optional[Sequence[np.ndarray]]

    ...

ahelm avatar Jul 29 '20 21:07 ahelm

Since we now building all values when axes are created, I think this does not apply anymore. Am I wrong, @ahelm?

fabiocruz avatar Apr 16 '21 16:04 fabiocruz

No. It still applies. I wanted to include information from the backend if the axis type is not linear. This is currently not addressed, and we should have this somewhere in the backend if we want to have a logarithmic radius simulation 😉 .

ahelm avatar Apr 16 '21 16:04 ahelm