Skip to content

Commit

Permalink
Made merged PR nest#446 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
sepehrmn committed Sep 28, 2016
1 parent c7ec080 commit 6f9c841
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 34 deletions.
56 changes: 23 additions & 33 deletions models/lowpassfilter_spike_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,42 +158,32 @@ nest::lowpassfilter_spike_detector::init_buffers_()
void
nest::lowpassfilter_spike_detector::calibrate()
{
if ( !user_set_precise_times_
&& kernel().event_delivery_manager.get_off_grid_communication() )
if ( kernel().event_delivery_manager.get_off_grid_communication()
and not spikes_device_.is_precise_times_user_set() )
{
spikes_device_.set_precise( true, 15 );

LOG( M_INFO,
"lowpassfilter_spike_detector:calibrate",
String::compose(
"Precise neuron models exist: the property precise_times "
"of the %1 with gid %2 has been set to true, precision has "
"been set to 15.",
get_name(),
get_gid() ) );
}
spikes_device_.set_precise_times( true );
filtered_device_.set_precise_times( true );
std::string msg = String::compose(
"Precise neuron models exist: the property precise_times "
"of the %1 with gid %2 has been set to true",
get_name(),
get_gid() );

if ( spikes_device_.is_precision_user_set() )
{
// if user explicitly set the precision, there is no need to do anything.
msg += ".";
}

if ( !user_set_precise_times_
&& kernel().event_delivery_manager.get_off_grid_communication() )
{
LOG( M_INFO,
"lowpassfilter_spike_detector::calibrate",
String::compose(
"Precise neuron models exist: this version is not made to calculate"
"traces for precise models.",
get_name(),
get_gid() ) );
}
else
{
// it makes sense to increase the precision if precise models are used.
spikes_device_.set_precision( 15 );
filtered_device_.set_precision( 15 );
msg += ", precision has been set to 15.";
}

if ( P_.filter_start_times_.size() == 0 )
{
LOG(
M_INFO,
"lowpassfilter_spike_detector::calibrate",
String::compose(
"Properties filter_start_times and filter_stop_times not specified. ",
get_name(),
get_gid() ) );
LOG( M_INFO, "spike_detector::calibrate", msg );
}

spikes_device_.calibrate();
Expand Down
2 changes: 1 addition & 1 deletion testsuite/unittests/test_lowpassfilter_spike_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,4 @@ def run():


if __name__ == "__main__":
run() #test
run()

0 comments on commit 6f9c841

Please sign in to comment.