Skip to content

Commit c63447b

Browse files
authored
Merge pull request #322 from chaoming0625/master
Improve backward compatibility
2 parents 2fe4a29 + 130c2d3 commit c63447b

File tree

14 files changed

+222
-510
lines changed

14 files changed

+222
-510
lines changed

brainpy/__init__.py

Lines changed: 3 additions & 358 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = "2.3.2"
3+
__version__ = "2.3.3"
44

55

66
# fundamental supporting modules
@@ -207,6 +207,7 @@
207207
dyn.__dict__['LoopOverTime'] = LoopOverTime
208208
dyn.__dict__['DSRunner'] = DSRunner
209209

210+
# neurons
210211
dyn.__dict__['HH'] = neurons.HH
211212
dyn.__dict__['MorrisLecar'] = neurons.MorrisLecar
212213
dyn.__dict__['PinskyRinzelModel'] = neurons.PinskyRinzelModel
@@ -225,6 +226,7 @@
225226
dyn.__dict__['PoissonGroup'] = neurons.PoissonGroup
226227
dyn.__dict__['OUProcess'] = neurons.OUProcess
227228

229+
# synapses
228230
from brainpy._src.dyn.synapses import compat
229231
dyn.__dict__['DeltaSynapse'] = compat.DeltaSynapse
230232
dyn.__dict__['ExpCUBA'] = compat.ExpCUBA
@@ -236,360 +238,3 @@
236238
dyn.__dict__['NMDA'] = compat.NMDA
237239
del compat
238240

239-
240-
# import brainpy._src.math.arraycompatible as bm
241-
# math.__dict__['full'] = bm.full
242-
# math.__dict__['full_like'] = bm.full_like
243-
# math.__dict__['eye'] = bm.eye
244-
# math.__dict__['identity'] = bm.identity
245-
# math.__dict__['diag'] = bm.diag
246-
# math.__dict__['tri'] = bm.tri
247-
# math.__dict__['tril'] = bm.tril
248-
# math.__dict__['triu'] = bm.triu
249-
# math.__dict__['real'] = bm.real
250-
# math.__dict__['imag'] = bm.imag
251-
# math.__dict__['conj'] = bm.conj
252-
# math.__dict__['conjugate'] = bm.conjugate
253-
# math.__dict__['ndim'] = bm.ndim
254-
# math.__dict__['isreal'] = bm.isreal
255-
# math.__dict__['isscalar'] = bm.isscalar
256-
# math.__dict__['add'] = bm.add
257-
# math.__dict__['reciprocal'] = bm.reciprocal
258-
# math.__dict__['negative'] = bm.negative
259-
# math.__dict__['positive'] = bm.positive
260-
# math.__dict__['multiply'] = bm.multiply
261-
# math.__dict__['divide'] = bm.divide
262-
# math.__dict__['power'] = bm.power
263-
# math.__dict__['subtract'] = bm.subtract
264-
# math.__dict__['true_divide'] = bm.true_divide
265-
# math.__dict__['floor_divide'] = bm.floor_divide
266-
# math.__dict__['float_power'] = bm.float_power
267-
# math.__dict__['fmod'] = bm.fmod
268-
# math.__dict__['mod'] = bm.mod
269-
# math.__dict__['modf'] = bm.modf
270-
# math.__dict__['divmod'] = bm.divmod
271-
# math.__dict__['remainder'] = bm.remainder
272-
# math.__dict__['abs'] = bm.abs
273-
# math.__dict__['exp'] = bm.exp
274-
# math.__dict__['exp2'] = bm.exp2
275-
# math.__dict__['expm1'] = bm.expm1
276-
# math.__dict__['log'] = bm.log
277-
# math.__dict__['log10'] = bm.log10
278-
# math.__dict__['log1p'] = bm.log1p
279-
# math.__dict__['log2'] = bm.log2
280-
# math.__dict__['logaddexp'] = bm.logaddexp
281-
# math.__dict__['logaddexp2'] = bm.logaddexp2
282-
# math.__dict__['lcm'] = bm.lcm
283-
# math.__dict__['gcd'] = bm.gcd
284-
# math.__dict__['arccos'] = bm.arccos
285-
# math.__dict__['arccosh'] = bm.arccosh
286-
# math.__dict__['arcsin'] = bm.arcsin
287-
# math.__dict__['arcsinh'] = bm.arcsinh
288-
# math.__dict__['arctan'] = bm.arctan
289-
# math.__dict__['arctan2'] = bm.arctan2
290-
# math.__dict__['arctanh'] = bm.arctanh
291-
# math.__dict__['cos'] = bm.cos
292-
# math.__dict__['cosh'] = bm.cosh
293-
# math.__dict__['sin'] = bm.sin
294-
# math.__dict__['sinc'] = bm.sinc
295-
# math.__dict__['sinh'] = bm.sinh
296-
# math.__dict__['tan'] = bm.tan
297-
# math.__dict__['tanh'] = bm.tanh
298-
# math.__dict__['deg2rad'] = bm.deg2rad
299-
# math.__dict__['hypot'] = bm.hypot
300-
# math.__dict__['rad2deg'] = bm.rad2deg
301-
# math.__dict__['degrees'] = bm.degrees
302-
# math.__dict__['radians'] = bm.radians
303-
# math.__dict__['round'] = bm.round
304-
# math.__dict__['around'] = bm.around
305-
# math.__dict__['round_'] = bm.round_
306-
# math.__dict__['rint'] = bm.rint
307-
# math.__dict__['floor'] = bm.floor
308-
# math.__dict__['ceil'] = bm.ceil
309-
# math.__dict__['trunc'] = bm.trunc
310-
# math.__dict__['fix'] = bm.fix
311-
# math.__dict__['prod'] = bm.prod
312-
# math.__dict__['sum'] = bm.sum
313-
# math.__dict__['diff'] = bm.diff
314-
# math.__dict__['median'] = bm.median
315-
# math.__dict__['nancumprod'] = bm.nancumprod
316-
# math.__dict__['nancumsum'] = bm.nancumsum
317-
# math.__dict__['nanprod'] = bm.nanprod
318-
# math.__dict__['nansum'] = bm.nansum
319-
# math.__dict__['cumprod'] = bm.cumprod
320-
# math.__dict__['cumsum'] = bm.cumsum
321-
# math.__dict__['ediff1d'] = bm.ediff1d
322-
# math.__dict__['cross'] = bm.cross
323-
# math.__dict__['trapz'] = bm.trapz
324-
# math.__dict__['isfinite'] = bm.isfinite
325-
# math.__dict__['isinf'] = bm.isinf
326-
# math.__dict__['isnan'] = bm.isnan
327-
# math.__dict__['signbit'] = bm.signbit
328-
# math.__dict__['copysign'] = bm.copysign
329-
# math.__dict__['nextafter'] = bm.nextafter
330-
# math.__dict__['ldexp'] = bm.ldexp
331-
# math.__dict__['frexp'] = bm.frexp
332-
# math.__dict__['convolve'] = bm.convolve
333-
# math.__dict__['sqrt'] = bm.sqrt
334-
# math.__dict__['cbrt'] = bm.cbrt
335-
# math.__dict__['square'] = bm.square
336-
# math.__dict__['absolute'] = bm.absolute
337-
# math.__dict__['fabs'] = bm.fabs
338-
# math.__dict__['sign'] = bm.sign
339-
# math.__dict__['heaviside'] = bm.heaviside
340-
# math.__dict__['maximum'] = bm.maximum
341-
# math.__dict__['minimum'] = bm.minimum
342-
# math.__dict__['fmax'] = bm.fmax
343-
# math.__dict__['fmin'] = bm.fmin
344-
# math.__dict__['interp'] = bm.interp
345-
# math.__dict__['clip'] = bm.clip
346-
# math.__dict__['angle'] = bm.angle
347-
# math.__dict__['bitwise_and'] = bm.bitwise_and
348-
# math.__dict__['bitwise_not'] = bm.bitwise_not
349-
# math.__dict__['bitwise_or'] = bm.bitwise_or
350-
# math.__dict__['bitwise_xor'] = bm.bitwise_xor
351-
# math.__dict__['invert'] = bm.invert
352-
# math.__dict__['left_shift'] = bm.left_shift
353-
# math.__dict__['right_shift'] = bm.right_shift
354-
# math.__dict__['equal'] = bm.equal
355-
# math.__dict__['not_equal'] = bm.not_equal
356-
# math.__dict__['greater'] = bm.greater
357-
# math.__dict__['greater_equal'] = bm.greater_equal
358-
# math.__dict__['less'] = bm.less
359-
# math.__dict__['less_equal'] = bm.less_equal
360-
# math.__dict__['array_equal'] = bm.array_equal
361-
# math.__dict__['isclose'] = bm.isclose
362-
# math.__dict__['allclose'] = bm.allclose
363-
# math.__dict__['logical_and'] = bm.logical_and
364-
# math.__dict__['logical_not'] = bm.logical_not
365-
# math.__dict__['logical_or'] = bm.logical_or
366-
# math.__dict__['logical_xor'] = bm.logical_xor
367-
# math.__dict__['all'] = bm.all
368-
# math.__dict__['any'] = bm.any
369-
# math.__dict__['alltrue'] = bm.alltrue
370-
# math.__dict__['sometrue'] = bm.sometrue
371-
# math.__dict__['shape'] = bm.shape
372-
# math.__dict__['size'] = bm.size
373-
# math.__dict__['reshape'] = bm.reshape
374-
# math.__dict__['ravel'] = bm.ravel
375-
# math.__dict__['moveaxis'] = bm.moveaxis
376-
# math.__dict__['transpose'] = bm.transpose
377-
# math.__dict__['swapaxes'] = bm.swapaxes
378-
# math.__dict__['concatenate'] = bm.concatenate
379-
# math.__dict__['stack'] = bm.stack
380-
# math.__dict__['vstack'] = bm.vstack
381-
# math.__dict__['hstack'] = bm.hstack
382-
# math.__dict__['dstack'] = bm.dstack
383-
# math.__dict__['column_stack'] = bm.column_stack
384-
# math.__dict__['split'] = bm.split
385-
# math.__dict__['dsplit'] = bm.dsplit
386-
# math.__dict__['hsplit'] = bm.hsplit
387-
# math.__dict__['vsplit'] = bm.vsplit
388-
# math.__dict__['tile'] = bm.tile
389-
# math.__dict__['repeat'] = bm.repeat
390-
# math.__dict__['unique'] = bm.unique
391-
# math.__dict__['append'] = bm.append
392-
# math.__dict__['flip'] = bm.flip
393-
# math.__dict__['fliplr'] = bm.fliplr
394-
# math.__dict__['flipud'] = bm.flipud
395-
# math.__dict__['roll'] = bm.roll
396-
# math.__dict__['atleast_1d'] = bm.atleast_1d
397-
# math.__dict__['atleast_2d'] = bm.atleast_2d
398-
# math.__dict__['atleast_3d'] = bm.atleast_3d
399-
# math.__dict__['expand_dims'] = bm.expand_dims
400-
# math.__dict__['squeeze'] = bm.squeeze
401-
# math.__dict__['sort'] = bm.sort
402-
# math.__dict__['argsort'] = bm.argsort
403-
# math.__dict__['argmax'] = bm.argmax
404-
# math.__dict__['argmin'] = bm.argmin
405-
# math.__dict__['argwhere'] = bm.argwhere
406-
# math.__dict__['nonzero'] = bm.nonzero
407-
# math.__dict__['flatnonzero'] = bm.flatnonzero
408-
# math.__dict__['where'] = bm.where
409-
# math.__dict__['searchsorted'] = bm.searchsorted
410-
# math.__dict__['extract'] = bm.extract
411-
# math.__dict__['count_nonzero'] = bm.count_nonzero
412-
# math.__dict__['max'] = bm.max
413-
# math.__dict__['min'] = bm.min
414-
# math.__dict__['amax'] = bm.amax
415-
# math.__dict__['amin'] = bm.amin
416-
# math.__dict__['array_split'] = bm.array_split
417-
# math.__dict__['meshgrid'] = bm.meshgrid
418-
# math.__dict__['vander'] = bm.vander
419-
# math.__dict__['nonzero'] = bm.nonzero
420-
# math.__dict__['where'] = bm.where
421-
# math.__dict__['tril_indices'] = bm.tril_indices
422-
# math.__dict__['tril_indices_from'] = bm.tril_indices_from
423-
# math.__dict__['triu_indices'] = bm.triu_indices
424-
# math.__dict__['triu_indices_from'] = bm.triu_indices_from
425-
# math.__dict__['take'] = bm.take
426-
# math.__dict__['select'] = bm.select
427-
# math.__dict__['nanmin'] = bm.nanmin
428-
# math.__dict__['nanmax'] = bm.nanmax
429-
# math.__dict__['ptp'] = bm.ptp
430-
# math.__dict__['percentile'] = bm.percentile
431-
# math.__dict__['nanpercentile'] = bm.nanpercentile
432-
# math.__dict__['quantile'] = bm.quantile
433-
# math.__dict__['nanquantile'] = bm.nanquantile
434-
# math.__dict__['median'] = bm.median
435-
# math.__dict__['average'] = bm.average
436-
# math.__dict__['mean'] = bm.mean
437-
# math.__dict__['std'] = bm.std
438-
# math.__dict__['var'] = bm.var
439-
# math.__dict__['nanmedian'] = bm.nanmedian
440-
# math.__dict__['nanmean'] = bm.nanmean
441-
# math.__dict__['nanstd'] = bm.nanstd
442-
# math.__dict__['nanvar'] = bm.nanvar
443-
# math.__dict__['corrcoef'] = bm.corrcoef
444-
# math.__dict__['correlate'] = bm.correlate
445-
# math.__dict__['cov'] = bm.cov
446-
# math.__dict__['histogram'] = bm.histogram
447-
# math.__dict__['bincount'] = bm.bincount
448-
# math.__dict__['digitize'] = bm.digitize
449-
# math.__dict__['bartlett'] = bm.bartlett
450-
# math.__dict__['blackman'] = bm.blackman
451-
# math.__dict__['hamming'] = bm.hamming
452-
# math.__dict__['hanning'] = bm.hanning
453-
# math.__dict__['kaiser'] = bm.kaiser
454-
# math.__dict__['e'] = bm.e
455-
# math.__dict__['pi'] = bm.pi
456-
# math.__dict__['inf'] = bm.inf
457-
# math.__dict__['dot'] = bm.dot
458-
# math.__dict__['vdot'] = bm.vdot
459-
# math.__dict__['inner'] = bm.inner
460-
# math.__dict__['outer'] = bm.outer
461-
# math.__dict__['kron'] = bm.kron
462-
# math.__dict__['matmul'] = bm.matmul
463-
# math.__dict__['trace'] = bm.trace
464-
# math.__dict__['dtype'] = bm.dtype
465-
# math.__dict__['finfo'] = bm.finfo
466-
# math.__dict__['iinfo'] = bm.iinfo
467-
# math.__dict__['uint8'] = bm.uint8
468-
# math.__dict__['uint16'] = bm.uint16
469-
# math.__dict__['uint32'] = bm.uint32
470-
# math.__dict__['uint64'] = bm.uint64
471-
# math.__dict__['int8'] = bm.int8
472-
# math.__dict__['int16'] = bm.int16
473-
# math.__dict__['int32'] = bm.int32
474-
# math.__dict__['int64'] = bm.int64
475-
# math.__dict__['float16'] = bm.float16
476-
# math.__dict__['float32'] = bm.float32
477-
# math.__dict__['float64'] = bm.float64
478-
# math.__dict__['complex64'] = bm.complex64
479-
# math.__dict__['complex128'] = bm.complex128
480-
# math.__dict__['product'] = bm.product
481-
# math.__dict__['row_stack'] = bm.row_stack
482-
# math.__dict__['apply_over_axes'] = bm.apply_over_axes
483-
# math.__dict__['apply_along_axis'] = bm.apply_along_axis
484-
# math.__dict__['array_equiv'] = bm.array_equiv
485-
# math.__dict__['array_repr'] = bm.array_repr
486-
# math.__dict__['array_str'] = bm.array_str
487-
# math.__dict__['block'] = bm.block
488-
# math.__dict__['broadcast_arrays'] = bm.broadcast_arrays
489-
# math.__dict__['broadcast_shapes'] = bm.broadcast_shapes
490-
# math.__dict__['broadcast_to'] = bm.broadcast_to
491-
# math.__dict__['compress'] = bm.compress
492-
# math.__dict__['cumproduct'] = bm.cumproduct
493-
# math.__dict__['diag_indices'] = bm.diag_indices
494-
# math.__dict__['diag_indices_from'] = bm.diag_indices_from
495-
# math.__dict__['diagflat'] = bm.diagflat
496-
# math.__dict__['diagonal'] = bm.diagonal
497-
# math.__dict__['einsum'] = bm.einsum
498-
# math.__dict__['einsum_path'] = bm.einsum_path
499-
# math.__dict__['geomspace'] = bm.geomspace
500-
# math.__dict__['gradient'] = bm.gradient
501-
# math.__dict__['histogram2d'] = bm.histogram2d
502-
# math.__dict__['histogram_bin_edges'] = bm.histogram_bin_edges
503-
# math.__dict__['histogramdd'] = bm.histogramdd
504-
# math.__dict__['i0'] = bm.i0
505-
# math.__dict__['in1d'] = bm.in1d
506-
# math.__dict__['indices'] = bm.indices
507-
# math.__dict__['insert'] = bm.insert
508-
# math.__dict__['intersect1d'] = bm.intersect1d
509-
# math.__dict__['iscomplex'] = bm.iscomplex
510-
# math.__dict__['isin'] = bm.isin
511-
# math.__dict__['ix_'] = bm.ix_
512-
# math.__dict__['lexsort'] = bm.lexsort
513-
# math.__dict__['load'] = bm.load
514-
# math.__dict__['save'] = bm.save
515-
# math.__dict__['savez'] = bm.savez
516-
# math.__dict__['mask_indices'] = bm.mask_indices
517-
# math.__dict__['msort'] = bm.msort
518-
# math.__dict__['nan_to_num'] = bm.nan_to_num
519-
# math.__dict__['nanargmax'] = bm.nanargmax
520-
# math.__dict__['setdiff1d'] = bm.setdiff1d
521-
# math.__dict__['nanargmin'] = bm.nanargmin
522-
# math.__dict__['pad'] = bm.pad
523-
# math.__dict__['poly'] = bm.poly
524-
# math.__dict__['polyadd'] = bm.polyadd
525-
# math.__dict__['polyder'] = bm.polyder
526-
# math.__dict__['polyfit'] = bm.polyfit
527-
# math.__dict__['polyint'] = bm.polyint
528-
# math.__dict__['polymul'] = bm.polymul
529-
# math.__dict__['polysub'] = bm.polysub
530-
# math.__dict__['polyval'] = bm.polyval
531-
# math.__dict__['resize'] = bm.resize
532-
# math.__dict__['rollaxis'] = bm.rollaxis
533-
# math.__dict__['roots'] = bm.roots
534-
# math.__dict__['rot90'] = bm.rot90
535-
# math.__dict__['setxor1d'] = bm.setxor1d
536-
# math.__dict__['tensordot'] = bm.tensordot
537-
# math.__dict__['trim_zeros'] = bm.trim_zeros
538-
# math.__dict__['union1d'] = bm.union1d
539-
# math.__dict__['unravel_index'] = bm.unravel_index
540-
# math.__dict__['unwrap'] = bm.unwrap
541-
# math.__dict__['take_along_axis'] = bm.take_along_axis
542-
# math.__dict__['can_cast'] = bm.can_cast
543-
# math.__dict__['choose'] = bm.choose
544-
# math.__dict__['copy'] = bm.copy
545-
# math.__dict__['frombuffer'] = bm.frombuffer
546-
# math.__dict__['fromfile'] = bm.fromfile
547-
# math.__dict__['fromfunction'] = bm.fromfunction
548-
# math.__dict__['fromiter'] = bm.fromiter
549-
# math.__dict__['fromstring'] = bm.fromstring
550-
# math.__dict__['get_printoptions'] = bm.get_printoptions
551-
# math.__dict__['iscomplexobj'] = bm.iscomplexobj
552-
# math.__dict__['isneginf'] = bm.isneginf
553-
# math.__dict__['isposinf'] = bm.isposinf
554-
# math.__dict__['isrealobj'] = bm.isrealobj
555-
# math.__dict__['issubdtype'] = bm.issubdtype
556-
# math.__dict__['issubsctype'] = bm.issubsctype
557-
# math.__dict__['iterable'] = bm.iterable
558-
# math.__dict__['packbits'] = bm.packbits
559-
# math.__dict__['piecewise'] = bm.piecewise
560-
# math.__dict__['printoptions'] = bm.printoptions
561-
# math.__dict__['set_printoptions'] = bm.set_printoptions
562-
# math.__dict__['promote_types'] = bm.promote_types
563-
# math.__dict__['ravel_multi_index'] = bm.ravel_multi_index
564-
# math.__dict__['result_type'] = bm.result_type
565-
# math.__dict__['sort_complex'] = bm.sort_complex
566-
# math.__dict__['unpackbits'] = bm.unpackbits
567-
# math.__dict__['delete'] = bm.delete
568-
# math.__dict__['add_docstring'] = bm.add_docstring
569-
# math.__dict__['add_newdoc'] = bm.add_newdoc
570-
# math.__dict__['add_newdoc_ufunc'] = bm.add_newdoc_ufunc
571-
# math.__dict__['array2string'] = bm.array2string
572-
# math.__dict__['asanyarray'] = bm.asanyarray
573-
# math.__dict__['ascontiguousarray'] = bm.ascontiguousarray
574-
# math.__dict__['asfarray'] = bm.asfarray
575-
# math.__dict__['asscalar'] = bm.asscalar
576-
# math.__dict__['common_type'] = bm.common_type
577-
# math.__dict__['disp'] = bm.disp
578-
# math.__dict__['genfromtxt'] = bm.genfromtxt
579-
# math.__dict__['loadtxt'] = bm.loadtxt
580-
# math.__dict__['info'] = bm.info
581-
# math.__dict__['issubclass_'] = bm.issubclass_
582-
# math.__dict__['place'] = bm.place
583-
# math.__dict__['polydiv'] = bm.polydiv
584-
# math.__dict__['put'] = bm.put
585-
# math.__dict__['putmask'] = bm.putmask
586-
# math.__dict__['safe_eval'] = bm.safe_eval
587-
# math.__dict__['savetxt'] = bm.savetxt
588-
# math.__dict__['savez_compressed'] = bm.savez_compressed
589-
# math.__dict__['show_config'] = bm.show_config
590-
# math.__dict__['typename'] = bm.typename
591-
# math.__dict__['copyto'] = bm.copyto
592-
# math.__dict__['matrix'] = bm.matrix
593-
# math.__dict__['asmatrix'] = bm.asmatrix
594-
# math.__dict__['mat'] = bm.mat
595-
# del bm

0 commit comments

Comments
 (0)