brainunit 0.2.1__tar.gz → 0.3.0__tar.gz
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.
- {brainunit-0.2.1 → brainunit-0.3.0}/PKG-INFO +21 -9
- {brainunit-0.2.1 → brainunit-0.3.0}/README.md +6 -6
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/__init__.py +34 -3
- brainunit-0.3.0/brainunit/_backend.py +17 -0
- brainunit-0.3.0/brainunit/_exceptions.py +17 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/linalg/__init__.py +6 -2
- brainunit-0.3.0/brainunit/py.typed +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit.egg-info/PKG-INFO +21 -9
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit.egg-info/SOURCES.txt +3 -0
- brainunit-0.3.0/brainunit.egg-info/requires.txt +37 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/pyproject.toml +12 -3
- brainunit-0.2.1/brainunit.egg-info/requires.txt +0 -19
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_base_decorators.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_base_dimension.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_base_getters.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_base_quantity.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_base_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_celsius.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_misc.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_unit_common.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_unit_constants.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/_unit_shortcuts.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/autograd/__init__.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/autograd/_hessian.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/autograd/_jacobian.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/autograd/_value_and_grad.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/autograd/_vector_grad.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/constants.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/custom_array.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/fft/__init__.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/fft/_fft_change_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/fft/_fft_keep_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/__init__.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_lax_accept_unitless.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_lax_array_creation.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_lax_change_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_lax_keep_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_lax_linalg.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_lax_remove_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/lax/_misc.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/linalg/_linalg_change_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/linalg/_linalg_keep_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/linalg/_linalg_remove_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/__init__.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_activation.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_alias.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_einops.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_fun_accept_unitless.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_fun_array_creation.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_fun_change_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_fun_keep_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_fun_remove_unit.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/_misc.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/fft.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/math/linalg.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/sparse/__init__.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/sparse/_coo.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/sparse/_csr.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit/typing.py +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit.egg-info/dependency_links.txt +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/brainunit.egg-info/top_level.txt +0 -0
- {brainunit-0.2.1 → brainunit-0.3.0}/setup.cfg +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: brainunit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Physical Units and Unit-Aware Mathematical System for General-Purpose Brain Dynamics Modeling
|
|
5
5
|
Author-email: BrainUnit Developers <chao.brain@qq.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: homepage, https://github.com/chaobrain/brainunit
|
|
8
8
|
Project-URL: repository, https://github.com/chaobrain/brainunit
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/chaobrain/brainunit/issues
|
|
10
|
-
Project-URL: Documentation, https://
|
|
10
|
+
Project-URL: Documentation, https://brainx.chaobrain.com/brainunit/
|
|
11
11
|
Keywords: physical unit,physical quantity,brain modeling
|
|
12
12
|
Classifier: Natural Language :: English
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
@@ -30,10 +30,12 @@ Requires-Python: >=3.10
|
|
|
30
30
|
Description-Content-Type: text/markdown
|
|
31
31
|
Requires-Dist: numpy
|
|
32
32
|
Requires-Dist: typing_extensions
|
|
33
|
-
Requires-Dist: saiunit==0.
|
|
33
|
+
Requires-Dist: saiunit==0.3.0
|
|
34
34
|
Provides-Extra: testing
|
|
35
35
|
Requires-Dist: pytest; extra == "testing"
|
|
36
36
|
Requires-Dist: brainstate; extra == "testing"
|
|
37
|
+
Provides-Extra: jax
|
|
38
|
+
Requires-Dist: jax; extra == "jax"
|
|
37
39
|
Provides-Extra: cpu
|
|
38
40
|
Requires-Dist: jax[cpu]; extra == "cpu"
|
|
39
41
|
Provides-Extra: cuda12
|
|
@@ -42,12 +44,22 @@ Provides-Extra: cuda13
|
|
|
42
44
|
Requires-Dist: jax[cuda13]; extra == "cuda13"
|
|
43
45
|
Provides-Extra: tpu
|
|
44
46
|
Requires-Dist: jax[tpu]; extra == "tpu"
|
|
47
|
+
Provides-Extra: cupy
|
|
48
|
+
Requires-Dist: cupy-cuda12x>=13.0; extra == "cupy"
|
|
49
|
+
Provides-Extra: torch
|
|
50
|
+
Requires-Dist: torch>=2.0; extra == "torch"
|
|
51
|
+
Provides-Extra: dask
|
|
52
|
+
Requires-Dist: dask[array]>=2024.1; extra == "dask"
|
|
53
|
+
Provides-Extra: ndonnx
|
|
54
|
+
Requires-Dist: ndonnx>=0.9; extra == "ndonnx"
|
|
55
|
+
Provides-Extra: all
|
|
56
|
+
Requires-Dist: brainunit[cupy,dask,jax,ndonnx,torch]; extra == "all"
|
|
45
57
|
|
|
46
58
|
<h1 align='center'>BrainUnit</h1>
|
|
47
59
|
<h2 align='center'>Physical units and unit-aware math system for general-purpose brain dynamics modeling</h2>
|
|
48
60
|
|
|
49
61
|
<p align="center">
|
|
50
|
-
<img alt="Header image of brainunit." src="https://
|
|
62
|
+
<img alt="Header image of brainunit." src="https://brainx.chaobrain.com/images/brainunit.webp" width=30%>
|
|
51
63
|
</p>
|
|
52
64
|
|
|
53
65
|
|
|
@@ -55,7 +67,7 @@ Requires-Dist: jax[tpu]; extra == "tpu"
|
|
|
55
67
|
<p align="center">
|
|
56
68
|
<a href="https://pypi.org/project/brainunit/"><img alt="Supported Python Version" src="https://img.shields.io/pypi/pyversions/brainunit"></a>
|
|
57
69
|
<a href="https://github.com/chaobrain/brainunit/blob/main/LICENSE"><img alt="LICENSE" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
|
|
58
|
-
<a href='https://
|
|
70
|
+
<a href='https://brainx.chaobrain.com/braintools/'>
|
|
59
71
|
<img src='https://readthedocs.org/projects/brainunit/badge/?version=latest' alt='Documentation Status' />
|
|
60
72
|
</a>
|
|
61
73
|
<a href="https://badge.fury.io/py/brainunit"><img alt="PyPI version" src="https://badge.fury.io/py/brainunit.svg"></a>
|
|
@@ -67,7 +79,7 @@ Requires-Dist: jax[tpu]; extra == "tpu"
|
|
|
67
79
|
|
|
68
80
|
[BrainUnit](https://github.com/chaobrain/brainunit) provides physical units and unit-aware mathematical system in JAX for brain dynamics modeling. It introduces rigoirous physical units into high-performance AI-driven abstract numerical computing.
|
|
69
81
|
|
|
70
|
-
BrainUnit is initially designed to enable unit-aware computations in brain dynamics modeling (see our [BDP ecosystem](https://
|
|
82
|
+
BrainUnit is initially designed to enable unit-aware computations in brain dynamics modeling (see our [BDP ecosystem](https://brainx.chaobrain.com/)). However, its features and capacities can be applied to general domains in scientific computing and AI4Science. Starting in 2025/02, BrainUnit has been fully integrated into [SAIUnit](https://github.com/chaobrain/saiunit) (the **Unit** system for **S**cientific **AI**).
|
|
71
83
|
|
|
72
84
|
Functionalities are the same for both ``brainunit`` and ``saiunit``, and their functions and data structures are interoperable, sharing the same set of APIs, and eliminating any potential conflicts. This meas that
|
|
73
85
|
|
|
@@ -87,13 +99,13 @@ For users primarily engaged in general scientific computing, `saiunit` is likely
|
|
|
87
99
|
|
|
88
100
|
## Documentation
|
|
89
101
|
|
|
90
|
-
The official documentation of BrainUnit is hosted on Read the Docs: [https://
|
|
102
|
+
The official documentation of BrainUnit is hosted on Read the Docs: [https://brainx.chaobrain.com/brainunit](https://brainx.chaobrain.com/brainunit)
|
|
91
103
|
|
|
92
104
|
|
|
93
105
|
|
|
94
106
|
## Features
|
|
95
107
|
|
|
96
|
-
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://
|
|
108
|
+
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://brainx.chaobrain.com/), such as, the checkpointing of [braintools](https://github.com/chaobrain/braintools), the event-driven operators in [brainevent](https://github.com/chaobrain/brainevent), the state-based JIT compilation in [brainstate](https://github.com/chaobrain/brainstate), online learning rules in [brainscale](https://github.com/chaobrain/brainscale), or event more.
|
|
97
109
|
|
|
98
110
|
A quick example for this kind of integration:
|
|
99
111
|
|
|
@@ -175,4 +187,4 @@ If you use `brainunit` in your research, please consider citing the following pa
|
|
|
175
187
|
|
|
176
188
|
## See also the ecosystem
|
|
177
189
|
|
|
178
|
-
``brainunit`` is one part of our [brain modeling ecosystem](https://
|
|
190
|
+
``brainunit`` is one part of our [brain modeling ecosystem](https://brainx.chaobrain.com/).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<h2 align='center'>Physical units and unit-aware math system for general-purpose brain dynamics modeling</h2>
|
|
3
3
|
|
|
4
4
|
<p align="center">
|
|
5
|
-
<img alt="Header image of brainunit." src="https://
|
|
5
|
+
<img alt="Header image of brainunit." src="https://brainx.chaobrain.com/images/brainunit.webp" width=30%>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<p align="center">
|
|
11
11
|
<a href="https://pypi.org/project/brainunit/"><img alt="Supported Python Version" src="https://img.shields.io/pypi/pyversions/brainunit"></a>
|
|
12
12
|
<a href="https://github.com/chaobrain/brainunit/blob/main/LICENSE"><img alt="LICENSE" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
|
|
13
|
-
<a href='https://
|
|
13
|
+
<a href='https://brainx.chaobrain.com/braintools/'>
|
|
14
14
|
<img src='https://readthedocs.org/projects/brainunit/badge/?version=latest' alt='Documentation Status' />
|
|
15
15
|
</a>
|
|
16
16
|
<a href="https://badge.fury.io/py/brainunit"><img alt="PyPI version" src="https://badge.fury.io/py/brainunit.svg"></a>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
[BrainUnit](https://github.com/chaobrain/brainunit) provides physical units and unit-aware mathematical system in JAX for brain dynamics modeling. It introduces rigoirous physical units into high-performance AI-driven abstract numerical computing.
|
|
24
24
|
|
|
25
|
-
BrainUnit is initially designed to enable unit-aware computations in brain dynamics modeling (see our [BDP ecosystem](https://
|
|
25
|
+
BrainUnit is initially designed to enable unit-aware computations in brain dynamics modeling (see our [BDP ecosystem](https://brainx.chaobrain.com/)). However, its features and capacities can be applied to general domains in scientific computing and AI4Science. Starting in 2025/02, BrainUnit has been fully integrated into [SAIUnit](https://github.com/chaobrain/saiunit) (the **Unit** system for **S**cientific **AI**).
|
|
26
26
|
|
|
27
27
|
Functionalities are the same for both ``brainunit`` and ``saiunit``, and their functions and data structures are interoperable, sharing the same set of APIs, and eliminating any potential conflicts. This meas that
|
|
28
28
|
|
|
@@ -42,13 +42,13 @@ For users primarily engaged in general scientific computing, `saiunit` is likely
|
|
|
42
42
|
|
|
43
43
|
## Documentation
|
|
44
44
|
|
|
45
|
-
The official documentation of BrainUnit is hosted on Read the Docs: [https://
|
|
45
|
+
The official documentation of BrainUnit is hosted on Read the Docs: [https://brainx.chaobrain.com/brainunit](https://brainx.chaobrain.com/brainunit)
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
## Features
|
|
50
50
|
|
|
51
|
-
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://
|
|
51
|
+
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://brainx.chaobrain.com/), such as, the checkpointing of [braintools](https://github.com/chaobrain/braintools), the event-driven operators in [brainevent](https://github.com/chaobrain/brainevent), the state-based JIT compilation in [brainstate](https://github.com/chaobrain/brainstate), online learning rules in [brainscale](https://github.com/chaobrain/brainscale), or event more.
|
|
52
52
|
|
|
53
53
|
A quick example for this kind of integration:
|
|
54
54
|
|
|
@@ -130,4 +130,4 @@ If you use `brainunit` in your research, please consider citing the following pa
|
|
|
130
130
|
|
|
131
131
|
## See also the ecosystem
|
|
132
132
|
|
|
133
|
-
``brainunit`` is one part of our [brain modeling ecosystem](https://
|
|
133
|
+
``brainunit`` is one part of our [brain modeling ecosystem](https://brainx.chaobrain.com/).
|
|
@@ -18,6 +18,7 @@ __version__ = saiunit.__version__
|
|
|
18
18
|
__version_info__ = saiunit.__version_info__
|
|
19
19
|
|
|
20
20
|
from . import autograd
|
|
21
|
+
from saiunit._matplotlib_compat import enable_matplotlib_support
|
|
21
22
|
from . import constants
|
|
22
23
|
from . import fft
|
|
23
24
|
from . import lax
|
|
@@ -34,6 +35,18 @@ from ._base_dimension import (
|
|
|
34
35
|
get_dim_for_display,
|
|
35
36
|
get_or_create_dimension,
|
|
36
37
|
)
|
|
38
|
+
from ._backend import (
|
|
39
|
+
get_default_backend,
|
|
40
|
+
is_cupy_array,
|
|
41
|
+
is_dask_array,
|
|
42
|
+
is_jax_array,
|
|
43
|
+
is_ndonnx_array,
|
|
44
|
+
is_numpy_array,
|
|
45
|
+
is_torch_array,
|
|
46
|
+
set_default_backend,
|
|
47
|
+
using_backend,
|
|
48
|
+
)
|
|
49
|
+
from ._exceptions import BackendError
|
|
37
50
|
from ._base_getters import (
|
|
38
51
|
array_with_unit,
|
|
39
52
|
assert_quantity,
|
|
@@ -48,14 +61,15 @@ from ._base_getters import (
|
|
|
48
61
|
have_same_dim,
|
|
49
62
|
is_dimensionless,
|
|
50
63
|
is_scalar_type,
|
|
64
|
+
is_unit_equal_math,
|
|
51
65
|
is_unitless,
|
|
52
66
|
maybe_decimal,
|
|
53
67
|
split_mantissa_unit,
|
|
54
68
|
unit_scale_align_to_first,
|
|
55
69
|
)
|
|
56
|
-
from ._base_quantity import Quantity
|
|
70
|
+
from ._base_quantity import Quantity
|
|
57
71
|
from ._base_unit import UNITLESS, Unit, add_standard_unit, parse_unit
|
|
58
|
-
from ._celsius import celsius2kelvin, kelvin2celsius
|
|
72
|
+
from ._celsius import celsius2kelvin, kelvin2celsius, fahrenheit2kelvin, kelvin2fahrenheit
|
|
59
73
|
from ._misc import maybe_custom_array, maybe_custom_array_tree
|
|
60
74
|
from ._unit_common import *
|
|
61
75
|
from ._unit_common import __all__ as _common_all
|
|
@@ -100,6 +114,18 @@ __all__ = [
|
|
|
100
114
|
'DIMENSIONLESS',
|
|
101
115
|
'DimensionMismatchError',
|
|
102
116
|
'UnitMismatchError',
|
|
117
|
+
'BackendError',
|
|
118
|
+
|
|
119
|
+
# _backend
|
|
120
|
+
'get_default_backend',
|
|
121
|
+
'set_default_backend',
|
|
122
|
+
'using_backend',
|
|
123
|
+
'is_jax_array',
|
|
124
|
+
'is_numpy_array',
|
|
125
|
+
'is_cupy_array',
|
|
126
|
+
'is_torch_array',
|
|
127
|
+
'is_dask_array',
|
|
128
|
+
'is_ndonnx_array',
|
|
103
129
|
'get_or_create_dimension',
|
|
104
130
|
'get_dim_for_display',
|
|
105
131
|
|
|
@@ -125,12 +151,12 @@ __all__ = [
|
|
|
125
151
|
'assert_quantity',
|
|
126
152
|
'have_same_dim',
|
|
127
153
|
'has_same_unit',
|
|
154
|
+
'is_unit_equal_math',
|
|
128
155
|
'unit_scale_align_to_first',
|
|
129
156
|
'array_with_unit',
|
|
130
157
|
|
|
131
158
|
# _base_quantity
|
|
132
159
|
'Quantity',
|
|
133
|
-
'compatible_with_equinox',
|
|
134
160
|
|
|
135
161
|
# _base_decorators
|
|
136
162
|
'check_dims',
|
|
@@ -140,6 +166,11 @@ __all__ = [
|
|
|
140
166
|
# _celsius
|
|
141
167
|
'celsius2kelvin',
|
|
142
168
|
'kelvin2celsius',
|
|
169
|
+
'fahrenheit2kelvin',
|
|
170
|
+
'kelvin2fahrenheit',
|
|
171
|
+
|
|
172
|
+
# _matplotlib_compat
|
|
173
|
+
'enable_matplotlib_support',
|
|
143
174
|
|
|
144
175
|
# old version compatibility
|
|
145
176
|
'avogadro_constant',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright 2026 BrainX Ecosystem Limited. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
# ==============================================================================
|
|
15
|
+
|
|
16
|
+
from saiunit._backend import *
|
|
17
|
+
from saiunit._backend import __all__
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright 2026 BrainX Ecosystem Limited. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
# ==============================================================================
|
|
15
|
+
|
|
16
|
+
from saiunit._exceptions import *
|
|
17
|
+
from saiunit._exceptions import __all__
|
|
@@ -17,9 +17,13 @@ from ._linalg_change_unit import *
|
|
|
17
17
|
from ._linalg_change_unit import __all__ as _linalg_change_unit_all
|
|
18
18
|
from ._linalg_keep_unit import *
|
|
19
19
|
from ._linalg_keep_unit import __all__ as _linalg_keep_unit_all
|
|
20
|
+
from ._linalg_remove_unit import *
|
|
21
|
+
from ._linalg_remove_unit import __all__ as _linalg_remove_unit_all
|
|
20
22
|
|
|
21
23
|
__all__ = (_linalg_change_unit_all +
|
|
22
|
-
_linalg_keep_unit_all
|
|
24
|
+
_linalg_keep_unit_all +
|
|
25
|
+
_linalg_remove_unit_all)
|
|
23
26
|
|
|
24
27
|
del (_linalg_change_unit_all,
|
|
25
|
-
_linalg_keep_unit_all
|
|
28
|
+
_linalg_keep_unit_all,
|
|
29
|
+
_linalg_remove_unit_all)
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: brainunit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Physical Units and Unit-Aware Mathematical System for General-Purpose Brain Dynamics Modeling
|
|
5
5
|
Author-email: BrainUnit Developers <chao.brain@qq.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: homepage, https://github.com/chaobrain/brainunit
|
|
8
8
|
Project-URL: repository, https://github.com/chaobrain/brainunit
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/chaobrain/brainunit/issues
|
|
10
|
-
Project-URL: Documentation, https://
|
|
10
|
+
Project-URL: Documentation, https://brainx.chaobrain.com/brainunit/
|
|
11
11
|
Keywords: physical unit,physical quantity,brain modeling
|
|
12
12
|
Classifier: Natural Language :: English
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
@@ -30,10 +30,12 @@ Requires-Python: >=3.10
|
|
|
30
30
|
Description-Content-Type: text/markdown
|
|
31
31
|
Requires-Dist: numpy
|
|
32
32
|
Requires-Dist: typing_extensions
|
|
33
|
-
Requires-Dist: saiunit==0.
|
|
33
|
+
Requires-Dist: saiunit==0.3.0
|
|
34
34
|
Provides-Extra: testing
|
|
35
35
|
Requires-Dist: pytest; extra == "testing"
|
|
36
36
|
Requires-Dist: brainstate; extra == "testing"
|
|
37
|
+
Provides-Extra: jax
|
|
38
|
+
Requires-Dist: jax; extra == "jax"
|
|
37
39
|
Provides-Extra: cpu
|
|
38
40
|
Requires-Dist: jax[cpu]; extra == "cpu"
|
|
39
41
|
Provides-Extra: cuda12
|
|
@@ -42,12 +44,22 @@ Provides-Extra: cuda13
|
|
|
42
44
|
Requires-Dist: jax[cuda13]; extra == "cuda13"
|
|
43
45
|
Provides-Extra: tpu
|
|
44
46
|
Requires-Dist: jax[tpu]; extra == "tpu"
|
|
47
|
+
Provides-Extra: cupy
|
|
48
|
+
Requires-Dist: cupy-cuda12x>=13.0; extra == "cupy"
|
|
49
|
+
Provides-Extra: torch
|
|
50
|
+
Requires-Dist: torch>=2.0; extra == "torch"
|
|
51
|
+
Provides-Extra: dask
|
|
52
|
+
Requires-Dist: dask[array]>=2024.1; extra == "dask"
|
|
53
|
+
Provides-Extra: ndonnx
|
|
54
|
+
Requires-Dist: ndonnx>=0.9; extra == "ndonnx"
|
|
55
|
+
Provides-Extra: all
|
|
56
|
+
Requires-Dist: brainunit[cupy,dask,jax,ndonnx,torch]; extra == "all"
|
|
45
57
|
|
|
46
58
|
<h1 align='center'>BrainUnit</h1>
|
|
47
59
|
<h2 align='center'>Physical units and unit-aware math system for general-purpose brain dynamics modeling</h2>
|
|
48
60
|
|
|
49
61
|
<p align="center">
|
|
50
|
-
<img alt="Header image of brainunit." src="https://
|
|
62
|
+
<img alt="Header image of brainunit." src="https://brainx.chaobrain.com/images/brainunit.webp" width=30%>
|
|
51
63
|
</p>
|
|
52
64
|
|
|
53
65
|
|
|
@@ -55,7 +67,7 @@ Requires-Dist: jax[tpu]; extra == "tpu"
|
|
|
55
67
|
<p align="center">
|
|
56
68
|
<a href="https://pypi.org/project/brainunit/"><img alt="Supported Python Version" src="https://img.shields.io/pypi/pyversions/brainunit"></a>
|
|
57
69
|
<a href="https://github.com/chaobrain/brainunit/blob/main/LICENSE"><img alt="LICENSE" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
|
|
58
|
-
<a href='https://
|
|
70
|
+
<a href='https://brainx.chaobrain.com/braintools/'>
|
|
59
71
|
<img src='https://readthedocs.org/projects/brainunit/badge/?version=latest' alt='Documentation Status' />
|
|
60
72
|
</a>
|
|
61
73
|
<a href="https://badge.fury.io/py/brainunit"><img alt="PyPI version" src="https://badge.fury.io/py/brainunit.svg"></a>
|
|
@@ -67,7 +79,7 @@ Requires-Dist: jax[tpu]; extra == "tpu"
|
|
|
67
79
|
|
|
68
80
|
[BrainUnit](https://github.com/chaobrain/brainunit) provides physical units and unit-aware mathematical system in JAX for brain dynamics modeling. It introduces rigoirous physical units into high-performance AI-driven abstract numerical computing.
|
|
69
81
|
|
|
70
|
-
BrainUnit is initially designed to enable unit-aware computations in brain dynamics modeling (see our [BDP ecosystem](https://
|
|
82
|
+
BrainUnit is initially designed to enable unit-aware computations in brain dynamics modeling (see our [BDP ecosystem](https://brainx.chaobrain.com/)). However, its features and capacities can be applied to general domains in scientific computing and AI4Science. Starting in 2025/02, BrainUnit has been fully integrated into [SAIUnit](https://github.com/chaobrain/saiunit) (the **Unit** system for **S**cientific **AI**).
|
|
71
83
|
|
|
72
84
|
Functionalities are the same for both ``brainunit`` and ``saiunit``, and their functions and data structures are interoperable, sharing the same set of APIs, and eliminating any potential conflicts. This meas that
|
|
73
85
|
|
|
@@ -87,13 +99,13 @@ For users primarily engaged in general scientific computing, `saiunit` is likely
|
|
|
87
99
|
|
|
88
100
|
## Documentation
|
|
89
101
|
|
|
90
|
-
The official documentation of BrainUnit is hosted on Read the Docs: [https://
|
|
102
|
+
The official documentation of BrainUnit is hosted on Read the Docs: [https://brainx.chaobrain.com/brainunit](https://brainx.chaobrain.com/brainunit)
|
|
91
103
|
|
|
92
104
|
|
|
93
105
|
|
|
94
106
|
## Features
|
|
95
107
|
|
|
96
|
-
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://
|
|
108
|
+
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://brainx.chaobrain.com/), such as, the checkpointing of [braintools](https://github.com/chaobrain/braintools), the event-driven operators in [brainevent](https://github.com/chaobrain/brainevent), the state-based JIT compilation in [brainstate](https://github.com/chaobrain/brainstate), online learning rules in [brainscale](https://github.com/chaobrain/brainscale), or event more.
|
|
97
109
|
|
|
98
110
|
A quick example for this kind of integration:
|
|
99
111
|
|
|
@@ -175,4 +187,4 @@ If you use `brainunit` in your research, please consider citing the following pa
|
|
|
175
187
|
|
|
176
188
|
## See also the ecosystem
|
|
177
189
|
|
|
178
|
-
``brainunit`` is one part of our [brain modeling ecosystem](https://
|
|
190
|
+
``brainunit`` is one part of our [brain modeling ecosystem](https://brainx.chaobrain.com/).
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
pyproject.toml
|
|
3
3
|
brainunit/__init__.py
|
|
4
|
+
brainunit/_backend.py
|
|
4
5
|
brainunit/_base_decorators.py
|
|
5
6
|
brainunit/_base_dimension.py
|
|
6
7
|
brainunit/_base_getters.py
|
|
7
8
|
brainunit/_base_quantity.py
|
|
8
9
|
brainunit/_base_unit.py
|
|
9
10
|
brainunit/_celsius.py
|
|
11
|
+
brainunit/_exceptions.py
|
|
10
12
|
brainunit/_misc.py
|
|
11
13
|
brainunit/_unit_common.py
|
|
12
14
|
brainunit/_unit_constants.py
|
|
13
15
|
brainunit/_unit_shortcuts.py
|
|
14
16
|
brainunit/constants.py
|
|
15
17
|
brainunit/custom_array.py
|
|
18
|
+
brainunit/py.typed
|
|
16
19
|
brainunit/typing.py
|
|
17
20
|
brainunit.egg-info/PKG-INFO
|
|
18
21
|
brainunit.egg-info/SOURCES.txt
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
numpy
|
|
2
|
+
typing_extensions
|
|
3
|
+
saiunit==0.3.0
|
|
4
|
+
|
|
5
|
+
[all]
|
|
6
|
+
brainunit[cupy,dask,jax,ndonnx,torch]
|
|
7
|
+
|
|
8
|
+
[cpu]
|
|
9
|
+
jax[cpu]
|
|
10
|
+
|
|
11
|
+
[cuda12]
|
|
12
|
+
jax[cuda12]
|
|
13
|
+
|
|
14
|
+
[cuda13]
|
|
15
|
+
jax[cuda13]
|
|
16
|
+
|
|
17
|
+
[cupy]
|
|
18
|
+
cupy-cuda12x>=13.0
|
|
19
|
+
|
|
20
|
+
[dask]
|
|
21
|
+
dask[array]>=2024.1
|
|
22
|
+
|
|
23
|
+
[jax]
|
|
24
|
+
jax
|
|
25
|
+
|
|
26
|
+
[ndonnx]
|
|
27
|
+
ndonnx>=0.9
|
|
28
|
+
|
|
29
|
+
[testing]
|
|
30
|
+
pytest
|
|
31
|
+
brainstate
|
|
32
|
+
|
|
33
|
+
[torch]
|
|
34
|
+
torch>=2.0
|
|
35
|
+
|
|
36
|
+
[tpu]
|
|
37
|
+
jax[tpu]
|
|
@@ -14,9 +14,12 @@ exclude = [
|
|
|
14
14
|
"brainunit/__init__.py"
|
|
15
15
|
]
|
|
16
16
|
|
|
17
|
+
[tool.setuptools.package-data]
|
|
18
|
+
brainunit = ["py.typed"]
|
|
19
|
+
|
|
17
20
|
[project]
|
|
18
21
|
name = "brainunit"
|
|
19
|
-
version = "0.
|
|
22
|
+
version = "0.3.0"
|
|
20
23
|
description = "Physical Units and Unit-Aware Mathematical System for General-Purpose Brain Dynamics Modeling"
|
|
21
24
|
readme = 'README.md'
|
|
22
25
|
license = 'Apache-2.0'
|
|
@@ -48,7 +51,7 @@ keywords = ['physical unit', 'physical quantity', 'brain modeling']
|
|
|
48
51
|
dependencies = [
|
|
49
52
|
'numpy',
|
|
50
53
|
'typing_extensions',
|
|
51
|
-
'saiunit==0.
|
|
54
|
+
'saiunit==0.3.0',
|
|
52
55
|
]
|
|
53
56
|
|
|
54
57
|
[tool.flit.module]
|
|
@@ -58,11 +61,17 @@ name = "brainunit"
|
|
|
58
61
|
homepage = 'https://github.com/chaobrain/brainunit'
|
|
59
62
|
repository = 'https://github.com/chaobrain/brainunit'
|
|
60
63
|
"Bug Tracker" = "https://github.com/chaobrain/brainunit/issues"
|
|
61
|
-
"Documentation" = "https://
|
|
64
|
+
"Documentation" = "https://brainx.chaobrain.com/brainunit/"
|
|
62
65
|
|
|
63
66
|
[project.optional-dependencies]
|
|
64
67
|
testing = ["pytest", "brainstate"]
|
|
68
|
+
jax = ["jax"]
|
|
65
69
|
cpu = ["jax[cpu]"]
|
|
66
70
|
cuda12 = ["jax[cuda12]"]
|
|
67
71
|
cuda13 = ["jax[cuda13]"]
|
|
68
72
|
tpu = ["jax[tpu]"]
|
|
73
|
+
cupy = ["cupy-cuda12x>=13.0"]
|
|
74
|
+
torch = ["torch>=2.0"]
|
|
75
|
+
dask = ["dask[array]>=2024.1"]
|
|
76
|
+
ndonnx = ["ndonnx>=0.9"]
|
|
77
|
+
all = ["brainunit[jax,cupy,torch,dask,ndonnx]"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|