Skip to content

Commit

Permalink
add dt and tstop attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ntolley authored and gtdang committed Aug 12, 2024
1 parent 3f81fd8 commit be0c9fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hnn_core/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def simulate_dipole(net, tstop, dt=0.025, n_trials=None, record_vsec=False,

net._params['record_ca'] = record_ca

net._tstop = tstop

net._dt = dt

if postproc:
warnings.warn('The postproc-argument is deprecated and will be removed'
' in a future release of hnn-core. Please define '
Expand Down
3 changes: 3 additions & 0 deletions hnn_core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ def __init__(self, params, add_drives_from_params=False,
if add_drives_from_params:
_add_drives_from_params(self)

self._tstop = None
self._dt = None

def __repr__(self):
class_name = self.__class__.__name__
s = ("%d x %d Pyramidal cells (L2, L5)"
Expand Down
2 changes: 2 additions & 0 deletions hnn_core/tests/test_dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def test_dipole_simulation():

# test Network.copy() returns 'bare' network after simulating
dpl = simulate_dipole(net, tstop=25., n_trials=1)[0]
assert net._dt == 0.025
assert net._tstop == 25.0
net_copy = net.copy()
assert len(net_copy.external_drives['evprox1']['events']) == 0

Expand Down

0 comments on commit be0c9fe

Please sign in to comment.