Skip to content
Snippets Groups Projects
Commit 04cf0176 authored by Sebastian Müller's avatar Sebastian Müller 🐈
Browse files

NoGrid: default to scalar data

parent 32ddf520
No related branches found
No related tags found
1 merge request!286Add mask to Info object
......@@ -31,8 +31,6 @@ class NoGrid(GridBase):
"""
Indicator for data without a spatial grid.
Either dim or data_shape needed.
Parameters
----------
dim : int or None, optional
......@@ -42,16 +40,13 @@ class NoGrid(GridBase):
Raises
------
ValueError
If none of dim or data_shape are given.
ValueError
If dim does not match the length of data_shape.
"""
def __init__(self, dim=None, data_shape=None):
if dim is None and data_shape is None:
msg = "NoGrid: either dim or data_shape needed."
raise ValueError(msg)
dim, data_shape = 0, tuple()
if data_shape is None:
data_shape = (-1,) * dim
if dim is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment