Skip to content

Conversation

@mmohrhard
Copy link
Contributor

No description provided.

@FabioLuporini
Copy link
Contributor

Thanks for this!

What's the cause of the issue? Could you attach a tiny MFE?

@mmohrhard
Copy link
Contributor Author

Hey Fabio,

This is an old DUG patch from Tim that allows you to create a Data object directly. Take the following simple example:

from devito.data import Data
import numpy as np

data = Data((1000,), dtype=np.uint8)
Traceback (most recent call last):
  File "xxx/devito3/test.py", line 4, in <module>
    data = Data((1000,), dtype=np.uint8)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/devito3/devito/data/data.py", line 53, in __new__
    assert len(shape) == len(modulo)
                         ^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

If you check the code, the statement obj._modulo = modulo or (False,)*len(shape) is already meant to handle this case and the assert just seems in the wrong location.

@mloubout mloubout added the API api (symbolics, types, ...) label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants