Skip to content

Commit

Permalink
Ready for publish (#311)
Browse files Browse the repository at this point in the history
Ready for publish
  • Loading branch information
chaoming0625 authored Dec 19, 2022
2 parents 5abd7fc + ad4837e commit ac1ac12
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 677 deletions.
3 changes: 1 addition & 2 deletions brainpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


# fundamental modules
from . import errors, tools, check, modes
from . import check, errors, tools, modes

# "base" module
from . import base
Expand All @@ -25,7 +25,6 @@
optimizers, # gradient descent optimizers
losses, # loss functions
measure, # methods for data analysis
datasets, # methods for generating data
inputs, # methods for generating input currents
algorithms, # online or offline training algorithms
)
Expand Down
44 changes: 24 additions & 20 deletions brainpy/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,7 @@

_check = True

_BRAINPYLIB_MINIMAL_VERSION = '0.1.2'


def is_checking():
"""Whether the checking is turn on."""
return _check


def turn_on():
"""Turn on the checking."""
global _check
_check = True


def turn_off():
"""Turn off the checking."""
global _check
_check = False
_BRAINPYLIB_MINIMAL_VERSION = '0.1.3'


try:
Expand Down Expand Up @@ -62,20 +45,41 @@ def turn_off():
''') from None


try:
import brainpylib

if brainpylib.__version__ < _BRAINPYLIB_MINIMAL_VERSION:
raise PackageMissingError(
f'brainpy need "brainpylib>={_BRAINPYLIB_MINIMAL_VERSION}". \n'
f'\nbrainpy need "brainpylib>={_BRAINPYLIB_MINIMAL_VERSION}". \n'
f'Please install it through:\n\n'
f'>>> pip install brainpylib -U'
)

del brainpylib
except ModuleNotFoundError:
raise PackageMissingError(
f'brainpy need "brainpylib>={_BRAINPYLIB_MINIMAL_VERSION}". \n'
f'\nbrainpy need "brainpylib>={_BRAINPYLIB_MINIMAL_VERSION}". \n'
f'Please install "brainpylib>={_BRAINPYLIB_MINIMAL_VERSION}" through:\n\n'
f'>>> pip install brainpylib'
)


def is_checking():
"""Whether the checking is turn on."""
return _check


def turn_on():
"""Turn on the checking."""
global _check
_check = True


def turn_off():
"""Turn off the checking."""
global _check
_check = False



4 changes: 0 additions & 4 deletions brainpy/datasets/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions brainpy/datasets/chaos/__init__.py

This file was deleted.

Loading

0 comments on commit ac1ac12

Please sign in to comment.