brainstate 0.1.0.post20250503__py2.py3-none-any.whl → 0.1.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brainstate/__init__.py +1 -1
- brainstate/_compatible_import.py +7 -3
- brainstate/_state.py +177 -177
- brainstate/_utils.py +0 -1
- brainstate/augment/_autograd.py +0 -2
- brainstate/augment/_eval_shape.py +0 -2
- brainstate/augment/_mapping.py +2 -3
- brainstate/augment/_random.py +0 -2
- brainstate/compile/_ad_checkpoint.py +0 -2
- brainstate/compile/_conditions.py +0 -2
- brainstate/compile/_error_if.py +0 -2
- brainstate/compile/_jit.py +9 -8
- brainstate/compile/_loop_collect_return.py +0 -2
- brainstate/compile/_loop_no_collection.py +0 -2
- brainstate/compile/_make_jaxpr.py +4 -6
- brainstate/compile/_progress_bar.py +0 -1
- brainstate/compile/_unvmap.py +0 -1
- brainstate/compile/_util.py +0 -2
- brainstate/environ.py +0 -2
- brainstate/functional/_activations.py +0 -2
- brainstate/functional/_normalization.py +0 -2
- brainstate/functional/_others.py +0 -2
- brainstate/functional/_spikes.py +0 -1
- brainstate/graph/_graph_node.py +1 -3
- brainstate/graph/_graph_operation.py +4 -2
- brainstate/init/_base.py +0 -2
- brainstate/init/_generic.py +0 -1
- brainstate/init/_random_inits.py +0 -1
- brainstate/init/_regular_inits.py +0 -2
- brainstate/mixin.py +0 -2
- brainstate/nn/_collective_ops.py +0 -3
- brainstate/nn/_common.py +0 -2
- brainstate/nn/_dyn_impl/_dynamics_neuron.py +0 -2
- brainstate/nn/_dyn_impl/_dynamics_synapse.py +0 -1
- brainstate/nn/_dyn_impl/_inputs.py +0 -1
- brainstate/nn/_dyn_impl/_rate_rnns.py +0 -1
- brainstate/nn/_dyn_impl/_readout.py +0 -1
- brainstate/nn/_dynamics/_dynamics_base.py +0 -1
- brainstate/nn/_dynamics/_projection_base.py +0 -1
- brainstate/nn/_dynamics/_state_delay.py +0 -2
- brainstate/nn/_dynamics/_synouts.py +0 -2
- brainstate/nn/_elementwise/_dropout.py +0 -2
- brainstate/nn/_elementwise/_elementwise.py +0 -2
- brainstate/nn/_event/_fixedprob_mv.py +0 -1
- brainstate/nn/_event/_linear_mv.py +0 -2
- brainstate/nn/_exp_euler.py +0 -2
- brainstate/nn/_interaction/_conv.py +0 -2
- brainstate/nn/_interaction/_embedding.py +0 -1
- brainstate/nn/_interaction/_linear.py +0 -2
- brainstate/nn/_interaction/_normalizations.py +0 -2
- brainstate/nn/_interaction/_poolings.py +0 -2
- brainstate/nn/_module.py +0 -1
- brainstate/nn/metrics.py +0 -2
- brainstate/optim/_base.py +0 -2
- brainstate/optim/_lr_scheduler.py +0 -1
- brainstate/optim/_optax_optimizer.py +0 -2
- brainstate/optim/_sgd_optimizer.py +0 -1
- brainstate/random/_rand_funs.py +0 -1
- brainstate/random/_rand_seed.py +0 -1
- brainstate/random/_rand_state.py +0 -1
- brainstate/surrogate.py +0 -1
- brainstate/typing.py +0 -2
- brainstate/util/_caller.py +4 -6
- brainstate/util/_others.py +0 -2
- brainstate/util/_pretty_pytree.py +201 -150
- brainstate/util/_pretty_repr.py +0 -2
- brainstate/util/_pretty_table.py +57 -3
- brainstate/util/_scaling.py +0 -2
- brainstate/util/_struct.py +0 -2
- brainstate/util/filter.py +0 -2
- {brainstate-0.1.0.post20250503.dist-info → brainstate-0.1.1.dist-info}/METADATA +11 -5
- brainstate-0.1.1.dist-info/RECORD +133 -0
- brainstate-0.1.0.post20250503.dist-info/RECORD +0 -133
- {brainstate-0.1.0.post20250503.dist-info → brainstate-0.1.1.dist-info}/LICENSE +0 -0
- {brainstate-0.1.0.post20250503.dist-info → brainstate-0.1.1.dist-info}/WHEEL +0 -0
- {brainstate-0.1.0.post20250503.dist-info → brainstate-0.1.1.dist-info}/top_level.txt +0 -0
brainstate/functional/_spikes.py
CHANGED
brainstate/graph/_graph_node.py
CHANGED
@@ -15,8 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
|
18
|
-
from __future__ import annotations
|
19
|
-
|
20
18
|
from abc import ABCMeta
|
21
19
|
from copy import deepcopy
|
22
20
|
from typing import Any, Callable, Type, TypeVar, Tuple, TYPE_CHECKING, Mapping, Iterator, Sequence
|
@@ -210,7 +208,7 @@ class List(Node):
|
|
210
208
|
def __len__(self):
|
211
209
|
return len(vars(self))
|
212
210
|
|
213
|
-
def __add__(self, other: Sequence[A]) -> List[A]:
|
211
|
+
def __add__(self, other: Sequence[A]) -> 'List[A]':
|
214
212
|
return List(list(self) + list(other))
|
215
213
|
|
216
214
|
def append(self, value):
|
@@ -18,8 +18,10 @@
|
|
18
18
|
from __future__ import annotations
|
19
19
|
|
20
20
|
import dataclasses
|
21
|
-
from typing import (
|
22
|
-
|
21
|
+
from typing import (
|
22
|
+
Any, Callable, Generic, Iterable, Iterator, Mapping, MutableMapping,
|
23
|
+
Sequence, Type, TypeVar, Union, Hashable, Tuple, Dict, Optional, overload
|
24
|
+
)
|
23
25
|
|
24
26
|
import jax
|
25
27
|
import numpy as np
|
brainstate/init/_base.py
CHANGED
brainstate/init/_generic.py
CHANGED
brainstate/init/_random_inits.py
CHANGED
brainstate/mixin.py
CHANGED
brainstate/nn/_collective_ops.py
CHANGED
@@ -13,13 +13,10 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
15
|
|
16
|
-
from __future__ import annotations
|
17
|
-
|
18
16
|
from collections import namedtuple
|
19
17
|
from typing import Callable, TypeVar, Tuple, Any, Dict
|
20
18
|
|
21
19
|
import jax
|
22
|
-
from typing import Callable, TypeVar, Tuple, Any, Dict
|
23
20
|
|
24
21
|
from brainstate._state import catch_new_states
|
25
22
|
from brainstate._utils import set_module_as
|
brainstate/nn/_common.py
CHANGED
@@ -12,7 +12,6 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
|
-
from __future__ import annotations
|
16
15
|
|
17
16
|
from typing import Union, Optional, Sequence, Callable
|
18
17
|
|
@@ -12,7 +12,6 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
|
-
from __future__ import annotations
|
16
15
|
|
17
16
|
from typing import Union, Callable, Optional
|
18
17
|
|
brainstate/nn/_exp_euler.py
CHANGED
@@ -12,7 +12,6 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
|
-
from __future__ import annotations
|
16
15
|
|
17
16
|
from typing import Optional, Callable, Union
|
18
17
|
|
brainstate/nn/_module.py
CHANGED
@@ -25,7 +25,6 @@ The basic classes include:
|
|
25
25
|
- ``Sequential``: The class for a sequential of modules, which update the modules sequentially.
|
26
26
|
|
27
27
|
"""
|
28
|
-
from __future__ import annotations
|
29
28
|
|
30
29
|
import warnings
|
31
30
|
from typing import Sequence, Optional, Tuple, Union, TYPE_CHECKING, Callable
|
brainstate/nn/metrics.py
CHANGED
brainstate/optim/_base.py
CHANGED
brainstate/random/_rand_funs.py
CHANGED
brainstate/random/_rand_seed.py
CHANGED
@@ -12,7 +12,6 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
# ==============================================================================
|
15
|
-
from __future__ import annotations
|
16
15
|
|
17
16
|
from contextlib import contextmanager
|
18
17
|
from typing import Optional
|
brainstate/random/_rand_state.py
CHANGED
brainstate/surrogate.py
CHANGED
brainstate/typing.py
CHANGED
brainstate/util/_caller.py
CHANGED
@@ -15,8 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
|
18
|
-
from __future__ import annotations
|
19
|
-
|
20
18
|
import dataclasses
|
21
19
|
from typing import Any, TypeVar, Protocol, Generic
|
22
20
|
|
@@ -82,18 +80,18 @@ class CallableProxy:
|
|
82
80
|
def __call__(self, *args, **kwargs):
|
83
81
|
return self._callable(self._accessor, *args, **kwargs)
|
84
82
|
|
85
|
-
def __getattr__(self, name) -> CallableProxy:
|
83
|
+
def __getattr__(self, name) -> 'CallableProxy':
|
86
84
|
return CallableProxy(self._callable, getattr(self._accessor, name))
|
87
85
|
|
88
|
-
def __getitem__(self, key) -> CallableProxy:
|
86
|
+
def __getitem__(self, key) -> 'CallableProxy':
|
89
87
|
return CallableProxy(self._callable, self._accessor[key])
|
90
88
|
|
91
89
|
|
92
90
|
class ApplyCaller(Protocol, Generic[A]):
|
93
|
-
def __getattr__(self, __name) -> ApplyCaller[A]:
|
91
|
+
def __getattr__(self, __name) -> 'ApplyCaller[A]':
|
94
92
|
...
|
95
93
|
|
96
|
-
def __getitem__(self, __name) -> ApplyCaller[A]:
|
94
|
+
def __getitem__(self, __name) -> 'ApplyCaller[A]':
|
97
95
|
...
|
98
96
|
|
99
97
|
def __call__(self, *args, **kwargs) -> tuple[Any, A]:
|