Skip to content

Commit

Permalink
Add numpy func compatibility and documentation, Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Routhleck committed Jun 7, 2024
1 parent ab6aec2 commit f9dcddf
Show file tree
Hide file tree
Showing 17 changed files with 6,882 additions and 310 deletions.
1 change: 1 addition & 0 deletions brainunit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================

__version__ = "0.0.1"

from ._base import *
from ._base import __all__ as _base_all
Expand Down
6 changes: 3 additions & 3 deletions brainunit/_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def test_unit_discarding_functions():
"""
Test functions that discard units.
"""
from brainunit import ones_like, zeros_like
from brainunit.math import ones_like, zeros_like

values = [3 * mV, np.array([1, 2]) * mV, np.arange(12).reshape(3, 4) * mV]
for value in values:
Expand All @@ -897,7 +897,7 @@ def test_unitsafe_functions():
"""
Test the unitsafe functions wrapping their numpy counterparts.
"""
from braincore.math import (
from brainunit.math import (
arccos,
arccosh,
arcsin,
Expand Down Expand Up @@ -966,7 +966,7 @@ def test_special_case_numpy_functions():
"""
Test a couple of functions/methods that need special treatment.
"""
from braincore.math import diagonal, dot, ravel, trace, where
from brainunit.math import diagonal, dot, ravel, trace, where

quadratic_matrix = np.reshape(np.arange(9), (3, 3)) * mV

Expand Down
19 changes: 19 additions & 0 deletions brainunit/math/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

from ._compat_numpy import *
from ._compat_numpy import __all__ as _compat_numpy_all

__all__ = _compat_numpy_all
Loading

0 comments on commit f9dcddf

Please sign in to comment.