Skip to content

Commit 8d924dd

Browse files
committed
Refactor Array references to BaseArray in delayvars.py
Replaces all references to 'Array' with 'BaseArray' in type checks and imports to align with updated class naming. This improves consistency and clarity in the codebase.
1 parent 2976c71 commit 8d924dd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

brainpy/_src/math/delayvars.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .compat_numpy import broadcast_to, expand_dims, concatenate
1515
from .environment import get_dt, get_float
1616
from .interoperability import as_jax
17-
from .ndarray import ndarray, Array
17+
from .ndarray import ndarray, BaseArray
1818
from .object_transform.base import BrainPyObject
1919
from .object_transform.controls import cond
2020
from .object_transform.variables import Variable
@@ -29,7 +29,7 @@
2929

3030

3131
def _as_jax_array(arr):
32-
return arr.value if isinstance(arr, Array) else arr
32+
return arr.value if isinstance(arr, BaseArray) else arr
3333

3434

3535
class AbstractDelay(BrainPyObject):
@@ -129,8 +129,8 @@ def __init__(
129129
super(TimeDelay, self).__init__(name=name)
130130

131131
# shape
132-
if not isinstance(delay_target, (jnp.ndarray, Array)):
133-
raise ValueError(f'Must be an instance of Array or jax.numpy.ndarray. But we got {type(delay_target)}')
132+
if not isinstance(delay_target, (jnp.ndarray, BaseArray)):
133+
raise ValueError(f'Must be an instance of BaseArray or jax.numpy.ndarray. But we got {type(delay_target)}')
134134

135135
# delay_len
136136
self.t0 = t0
@@ -453,7 +453,7 @@ def retrieve(self, delay_len, *indices):
453453
# the delay data
454454
return self.data[indices]
455455

456-
def update(self, value: Union[numbers.Number, Array, jax.Array] = None):
456+
def update(self, value: Union[numbers.Number, BaseArray, jax.Array] = None):
457457
"""Update delay variable with the new data.
458458
459459
Parameters

0 commit comments

Comments
 (0)