brian-team/brian2

module 'brian2' has no attribute 'units'

MichielMoe opened this issue · 2 comments

Hello there, could anyone help me out. I don't see what's wrong with this code :

step_current = input_factory.get_step_current(t_start = 50, t_end = 250, unit_time = 1*b2.ms, amplitude = 50*b2.uamp )
state_monitor = HH.simulate_HH_neuron(step_current, 300*b2.ms)
HH.plot_data(state_monitor)

But I get the following error :

----> 8 step_current = input_factory.get_step_current(t_start = 50,
9 t_end = 250,
10 unit_time = 1b2.ms,
11 amplitude = 50
b2.uamp
12 )
13 state_monitor = HH.simulate_HH_neuron(step_current, 300*b2.ms)
14 HH.plot_data(state_monitor)

File ~/anaconda3/lib/python3.11/site-packages/neurodynex3/tools/input_factory.py:48, in get_step_current(t_start, t_end, unit_time, amplitude, append_zero)
46 assert isinstance(t_start, int), "t_start_ms must be of type int"
47 assert isinstance(t_end, int), "t_end must be of type int"
---> 48 assert b2.units.fundamentalunits.have_same_dimensions(amplitude, b2.amp),
49 "amplitude must have the dimension of current e.g. brian2.uamp"
50 tmp_size = 1 + t_end # +1 for t=0
51 if append_zero:

AttributeError: module 'brian2' has no attribute 'units'

[In the future, please direct questions or error reports where you are not sure whether it is "Brian's fault" to Brian's discussion forum, we try to keep the github issues for bugs and feature requests.]

Could you give some more information on what version of Brian and neurodynex3 you have installed ?

Since there hasn't been any reply and there isn't anything we can do here, I am closing this issue.