Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
33a5c01
Port ticket 80-175-179 to py
otcathatsya Jun 13, 2023
a2a05fa
test wip
Jun 28, 2023
69597f7
test works
Jun 29, 2023
7dbb500
Merge branch 'nest:master' into port_ticket-80_175_179
otcathatsya Jun 30, 2023
dccc6f9
Reformat for black to be happy
otcathatsya Jun 30, 2023
b13547f
test works, flake8 passes
Jul 5, 2023
ab81129
test wip
Jul 5, 2023
ac5a513
fix copyright formatting
Jul 5, 2023
9cbce6e
Merge branch 'master' into test_iaf_ps_psp_accuracy_sli2py
Jul 5, 2023
336a0eb
Add t_ref in parameters in documentation
babsey Jul 27, 2023
8d71cfd
Require node_id > 0 to be a valid node_id
nicolossus Aug 8, 2023
545195d
Add regression test for issue 2795
nicolossus Aug 8, 2023
fd9ea78
use assert_allclose
Aug 8, 2023
0307021
flake8 passes
Aug 8, 2023
241aaaa
Merge remote-tracking branch 'nest/master' into test_iaf_ps_psp_accur…
Aug 8, 2023
d1403f0
[StepSecurity] ci: Harden GitHub Actions – GITHUB_TOKEN permissions
step-security-bot Aug 8, 2023
55a5e1d
Regression test for issue 2636 and 2795
nicolossus Aug 8, 2023
c195542
Remove trailing whitespace
nicolossus Aug 8, 2023
09d9938
wip
Aug 9, 2023
b746925
reformat and expand test
Aug 9, 2023
300fa23
Allow NodeCollection slicing with list of numpy integers
nicolossus Aug 9, 2023
83220ea
Regression test for issue 2637
nicolossus Aug 9, 2023
f361325
remove non-ps neuron, add another time point to compare
Aug 10, 2023
2124635
Hike minimum required CMake version to 3.19 to support COMMAND_ERROR_…
heplesser Aug 10, 2023
6ee813f
Merge pull request #2873 from janskaar/test_iaf_ps_psp_accuracy_sli2py
heplesser Aug 10, 2023
f09e7fe
test works, flake8 passes
Aug 10, 2023
c9f1f43
remove sli test
Aug 10, 2023
cd1cdcb
Merge pull request #2882 from nicolossus/fix_issue_2637
Helveg Aug 10, 2023
d2d74b2
add nest favicon
jessica-mitchell Aug 10, 2023
9da04a7
add icon for index page
jessica-mitchell Aug 10, 2023
291bdff
Merge pull request #2874 from step-security-bot/stepsecurity_remediat…
terhorstd Aug 11, 2023
bf6e237
set params on creation
Aug 11, 2023
bd9f711
fix broken table
jessica-mitchell Aug 11, 2023
850b5e7
Merge pull request #2886 from jessica-mitchell/add-nest-favicon
terhorstd Aug 14, 2023
f136fe1
Merge pull request #2887 from jessica-mitchell/fix-model-table
terhorstd Aug 14, 2023
ef58695
Merge pull request #2884 from heplesser/hike-cmake-version
heplesser Aug 14, 2023
d3b920d
Merge pull request #2885 from janskaar/test_iaf_ps_psp_poisson_accuracy
heplesser Aug 14, 2023
0bc8967
Merge pull request #2872 from nicolossus/fix_issue_2795
heplesser Aug 15, 2023
6adabca
Port test_spike_recorder from sli-2-py
nicolossus Aug 15, 2023
db0b064
WIP: port test_threaded_spike_recorder [skip ci]
nicolossus Aug 15, 2023
850346a
Improve test logic
nicolossus Aug 15, 2023
0c62345
Port test_threaded_spike_recorder from sli2py
nicolossus Aug 15, 2023
b39563d
Port test_spike_rec_reset from sli2py
nicolossus Aug 15, 2023
73268f2
Remove test_spike_transmission_*
nicolossus Aug 15, 2023
bd89781
Port test_spin_detector from sli2py
nicolossus Aug 15, 2023
f261d65
Merge pull request #2890 from nicolossus/port_test_spike_recorder
heplesser Aug 15, 2023
777997c
Merge pull request #2894 from nicolossus/port_test_spin_detector
heplesser Aug 15, 2023
8796a9a
Merge pull request #2893 from nicolossus/rm_test_spike_transmission_ps
heplesser Aug 15, 2023
56920b4
Merge pull request #2891 from nicolossus/port_test_threaded_spike_rec…
heplesser Aug 15, 2023
b42350a
Remove superfluous asserts
nicolossus Aug 15, 2023
4f8fb07
Port test_step_current_generator from sli2py
nicolossus Aug 15, 2023
35dc04b
Merge pull request #2892 from nicolossus/port_test_spike_rec_reset
heplesser Aug 16, 2023
5aa7192
Fix grammar
nicolossus Aug 16, 2023
ddf5a3f
Improve test docs and logic
nicolossus Aug 16, 2023
ea20f19
Remove NEST verbosity setting
nicolossus Aug 16, 2023
365165f
Merge pull request #1 from nicolossus/improve_port_ticket-80_175_179_…
otcathatsya Aug 16, 2023
c9e7d6d
Rename expectation
nicolossus Aug 17, 2023
19a74be
Change to new fixture name in test argument also
nicolossus Aug 17, 2023
c407166
Merge pull request #2895 from nicolossus/port_test_step_current_gener…
heplesser Aug 17, 2023
01f1d56
WIP: port test_ntree_split (sli2py) [skip ci]
nicolossus Aug 21, 2023
aeafc8a
Merge pull request #2864 from babsey/hh_t_ref
clinssen Aug 21, 2023
45826fc
Restructure test to match original SLI test case
otcathatsya Aug 21, 2023
ce0977e
Adjust setup fixture documentation
otcathatsya Aug 21, 2023
f54b1a9
Fix test method name
otcathatsya Aug 21, 2023
6f83168
Remove module scope to re-run network setup per block
otcathatsya Aug 22, 2023
add5bc1
Merge pull request #2829 from otcathatsya/port_ticket-80_175_179
heplesser Aug 22, 2023
1cb7f27
Port test_ntree_split from sli2py
nicolossus Aug 22, 2023
e5cf307
Simplify positions generation
nicolossus Aug 22, 2023
9f2c8b0
Fix spelling
nicolossus Aug 22, 2023
5fa512e
WIP port test_oversize_mask (sli2py) [skip ci]
nicolossus Aug 22, 2023
599d52b
Port test_oversize_mask from sli2py
nicolossus Aug 23, 2023
6dcfa2e
WIP fix errors due to nest 3 changes
Aug 23, 2023
beafac3
Merge pull request #2904 from nicolossus/port_test_oversize_mask
heplesser Aug 24, 2023
74e8984
model updated to nest3
Aug 24, 2023
453839a
rm modelsmodule.cpp
Aug 24, 2023
4cac475
Merge pull request #2899 from nicolossus/port_test_ntree_split
heplesser Aug 24, 2023
ba45417
Merge remote-tracking branch 'nest/master' into iaf_tsodyks
Aug 24, 2023
1d54190
correct name in modelsets/full
Aug 24, 2023
61ff60d
use models/CMakeLists from nest remote
Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build_dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
on: [push]

permissions:
contents: read

jobs:
trigger_externals:
if: ${{ github.repository_owner == 'nest' && github.ref_name == 'master' }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
schedule:
- cron: '31 8 * * *'

permissions:
contents: read

jobs:
stale:

Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>

# Version range from minimum required (3.12 for macOS OpenMP)
# up to newest version tested, see https://cliutils.gitlab.io/modern-cmake/chapters/basics.html
cmake_minimum_required( VERSION 3.12...3.16 )
cmake_minimum_required( VERSION 3.19 )

# add cmake modules: for all `include(...)` first look here
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
Expand Down
2 changes: 2 additions & 0 deletions doc/htmldoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@
html_additional_pages = {"index": "index.html"}
html_sidebars = {"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]}

html_favicon = "static/img/nest_favicon.ico"

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
Expand Down
Binary file added doc/htmldoc/static/img/nest_favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions doc/htmldoc/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<html class="no-js"> <!--<![endif]-->

<title>NEST documentation index </title>
<link rel="icon" type="image/x-icon" href="_static/img/nest_favicon.ico">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
26 changes: 10 additions & 16 deletions models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>.

set( models_sources
set(models_sources
modelsmodule.h ${PROJECT_BINARY_DIR}/models/modelsmodule.cpp
binary_neuron.h
cm_compartmentcurrents.h cm_compartmentcurrents.cpp
Expand All @@ -28,15 +28,15 @@ set( models_sources
${MODELS_SOURCES_GENERATED}
)

add_library( models STATIC ${models_sources} )
set_target_properties( models
add_library(models STATIC ${models_sources})
set_target_properties(models
PROPERTIES
VERSION ${NEST_VERSION}
SOVERSION 3
POSITION_INDEPENDENT_CODE ON
)
target_link_libraries( models nestutil sli_lib nestkernel )

target_include_directories( models PRIVATE
target_link_libraries(models nestutil sli_lib nestkernel)

target_include_directories(models PRIVATE
${PROJECT_SOURCE_DIR}/thirdparty
${PROJECT_SOURCE_DIR}/libnestutil
${PROJECT_BINARY_DIR}/libnestutil
Expand All @@ -46,12 +46,6 @@ target_include_directories( models PRIVATE
${PROJECT_SOURCE_DIR}/nestkernel
)

install( TARGETS models
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

FILTER_HEADERS( "${models_sources}" install_headers )
install( FILES ${install_headers}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nest )
FILTER_HEADERS("${models_sources}" install_headers)
install(FILES ${install_headers}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nest)
1 change: 1 addition & 0 deletions models/hh_psc_alpha.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The following parameters can be set in the status dictionary.
V_m mV Membrane potential
E_L mV Leak reversal potential
C_m pF Capacity of the membrane
t_ref ms Duration of refractory period
g_L nS Leak conductance
tau_ex ms Rise time of the excitatory synaptic alpha function
tau_in ms Rise time of the inhibitory synaptic alpha function
Expand Down
1 change: 1 addition & 0 deletions models/hh_psc_alpha_clopath.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ u_bar_bar mV Low-pass filtered u_bar_minus
-------------------------------------------------------------------------------
E_L mV Leak reversal potential
C_m pF Capacity of the membrane
t_ref ms Duration of refractory period
g_L nS Leak conductance
tau_ex ms Rise time of the excitatory synaptic alpha function
tau_in ms Rise time of the inhibitory synaptic alpha function
Expand Down
1 change: 1 addition & 0 deletions models/hh_psc_alpha_gap.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ V_m mV Membrane potential
E_L mV Leak reversal potential
g_L nS Leak conductance
C_m pF Capacity of the membrane
t_ref ms Duration of refractory period
tau_syn_ex ms Rise time of the excitatory synaptic alpha function
tau_syn_in ms Rise time of the inhibitory synaptic alpha function
E_Na mV Sodium reversal potential
Expand Down
20 changes: 9 additions & 11 deletions models/iaf_tsodyks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@

// Includes from libnestutil:
#include "dict_util.h"
#include "iaf_propagator.h"
#include "numerics.h"
#include "propagator_stability.h"

// Includes from nestkernel:
#include "exceptions.h"
#include "iaf_propagator.h"
#include "kernel_manager.h"
#include "numerics.h"
#include "ring_buffer_impl.h"
#include "universal_data_logger_impl.h"

Expand Down Expand Up @@ -289,8 +291,8 @@ nest::iaf_tsodyks::pre_run_hook()
V_.P22_ = std::exp( -h / P_.Tau_ );

// these are determined according to a numeric stability criterion
V_.P21ex_ = propagator_32( P_.tau_ex_, P_.Tau_, P_.C_, h );
V_.P21in_ = propagator_32( P_.tau_in_, P_.Tau_, P_.C_, h );
V_.P21ex_ = IAFPropagatorExp( P_.tau_ex_, P_.Tau_, P_.C_ ).evaluate( h );
V_.P21in_ = IAFPropagatorExp( P_.tau_in_, P_.Tau_, P_.C_ ).evaluate( h );

V_.P20_ = P_.Tau_ / P_.C_ * ( 1.0 - V_.P22_ );

Expand Down Expand Up @@ -321,12 +323,8 @@ nest::iaf_tsodyks::pre_run_hook()
void
nest::iaf_tsodyks::update( const Time& origin, const long from, const long to )
{
assert( to >= 0 and ( delay ) from < kernel().connection_manager.get_min_delay() );
assert( from < to );

const double h = Time::get_resolution().get_ms();


// evolve from timestep 'from' to timestep 'to' with steps of h each
for ( long lag = from; lag < to; ++lag )
{
Expand All @@ -349,11 +347,12 @@ nest::iaf_tsodyks::update( const Time& origin, const long from, const long to )
S_.i_syn_ex_ += ( 1. - V_.P11ex_ ) * S_.i_1_;

// get read access to the correct input-buffer slot
const index input_buffer_slot = kernel().event_delivery_manager.get_modulo( lag );
const size_t input_buffer_slot = kernel().event_delivery_manager.get_modulo( lag );
auto& input = B_.input_buffer_.get_values_all_channels( input_buffer_slot );

// the spikes arriving at T+1 have an immediate effect on the state of the
// neuron

V_.weighted_spikes_ex_ = input[ Buffers_::SYN_EX ];
V_.weighted_spikes_in_ = input[ Buffers_::SYN_IN ];

Expand Down Expand Up @@ -412,7 +411,6 @@ nest::iaf_tsodyks::update( const Time& origin, const long from, const long to )
S_.x_ -= delta_y_tsp;
S_.y_ += delta_y_tsp;


// send spike with datafield
SpikeEvent se;
se.set_offset( delta_y_tsp );
Expand All @@ -436,7 +434,7 @@ nest::iaf_tsodyks::handle( SpikeEvent& e )
{
assert( e.get_delay_steps() > 0 );

const index input_buffer_slot = kernel().event_delivery_manager.get_modulo(
const size_t input_buffer_slot = kernel().event_delivery_manager.get_modulo(
e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ) );

// Multiply with datafield from SpikeEvent
Expand All @@ -463,7 +461,7 @@ nest::iaf_tsodyks::handle( CurrentEvent& e )
const double c = e.get_current();
const double w = e.get_weight();

const index input_buffer_slot = kernel().event_delivery_manager.get_modulo(
const size_t input_buffer_slot = kernel().event_delivery_manager.get_modulo(
e.get_rel_delivery_steps( kernel().simulation_manager.get_slice_origin() ) );

if ( 0 == e.get_rport() )
Expand Down
24 changes: 12 additions & 12 deletions models/iaf_tsodyks.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ class iaf_tsodyks : public ArchivingNode
using Node::handle;
using Node::handles_test_event;

port send_test_event( Node&, rport, synindex, bool ) override;
size_t send_test_event( Node&, size_t, synindex, bool ) override;

void handle( SpikeEvent& ) override;
void handle( CurrentEvent& ) override;
void handle( DataLoggingRequest& ) override;

port handles_test_event( SpikeEvent&, rport ) override;
port handles_test_event( CurrentEvent&, rport ) override;
port handles_test_event( DataLoggingRequest&, rport ) override;
size_t handles_test_event( SpikeEvent&, size_t ) override;
size_t handles_test_event( CurrentEvent&, size_t ) override;
size_t handles_test_event( DataLoggingRequest&, size_t ) override;

void get_status( DictionaryDatum& ) const override;
void set_status( const DictionaryDatum& ) override;
Expand Down Expand Up @@ -409,16 +409,16 @@ class iaf_tsodyks : public ArchivingNode
};


inline port
nest::iaf_tsodyks::send_test_event( Node& target, rport receptor_type, synindex, bool )
inline size_t
nest::iaf_tsodyks::send_test_event( Node& target, size_t receptor_type, synindex, bool )
{
SpikeEvent e;
e.set_sender( *this );
return target.handles_test_event( e, receptor_type );
}

inline port
iaf_tsodyks::handles_test_event( SpikeEvent&, rport receptor_type )
inline size_t
iaf_tsodyks::handles_test_event( SpikeEvent&, size_t receptor_type )
{
if ( receptor_type != 0 )
{
Expand All @@ -427,8 +427,8 @@ iaf_tsodyks::handles_test_event( SpikeEvent&, rport receptor_type )
return 0;
}

inline port
iaf_tsodyks::handles_test_event( CurrentEvent&, rport receptor_type )
inline size_t
iaf_tsodyks::handles_test_event( CurrentEvent&, size_t receptor_type )
{
if ( receptor_type == 0 )
{
Expand All @@ -444,8 +444,8 @@ iaf_tsodyks::handles_test_event( CurrentEvent&, rport receptor_type )
}
}

inline port
iaf_tsodyks::handles_test_event( DataLoggingRequest& dlr, rport receptor_type )
inline size_t
iaf_tsodyks::handles_test_event( DataLoggingRequest& dlr, size_t receptor_type )
{
if ( receptor_type != 0 )
{
Expand Down
Empty file removed models/modelsmodule.cpp
Empty file.
2 changes: 1 addition & 1 deletion models/stdp_dopamine_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Parameters
b real Dopaminergic baseline concentration
Wmin real Minimal synaptic weight
Wmax real Maximal synaptic weight
==================== ============= ======================================================
=================== ============== ======================================================

The common properties can only be set by :py:func:`.SetDefaults` and apply
to all instances of the synapse model.
Expand Down
1 change: 1 addition & 0 deletions modelsets/full
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ iaf_psc_exp_htum
iaf_psc_exp_multisynapse
iaf_psc_exp_ps
iaf_psc_exp_ps_lossless
iaf_tsodyks
izhikevich
jonke_synapse
lin_rate
Expand Down
2 changes: 1 addition & 1 deletion nestkernel/modelrange_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ nest::ModelRangeManager::get_status( DictionaryDatum& )
inline bool
nest::ModelRangeManager::is_in_range( size_t node_id ) const
{
return ( node_id <= last_node_id_ and node_id >= first_node_id_ );
return ( node_id > 0 and node_id <= last_node_id_ and node_id >= first_node_id_ );
}

inline std::vector< modelrange >::const_iterator
Expand Down
2 changes: 1 addition & 1 deletion pynest/nest/lib/hl_api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def __getitem__(self, key):
raise IndexError("Bool index array must be the same length as NodeCollection")
np_key = numpy.array(key, dtype=bool)
# Checking that elements are not instances of bool too, because bool inherits from int
elif all(isinstance(x, int) and not isinstance(x, bool) for x in key):
elif all(isinstance(x, (int, numpy.integer)) and not isinstance(x, bool) for x in key):
np_key = numpy.array(key, dtype=numpy.uint64)
if len(numpy.unique(np_key)) != len(np_key):
raise ValueError("All node IDs in a NodeCollection have to be unique")
Expand Down
58 changes: 58 additions & 0 deletions testsuite/pytests/sli2py_recording/test_spike_recorder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
#
# test_spike_recorder.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# NEST is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>.

"""
Test that ``spike_recorder`` behaves as expected.
"""

import nest
import numpy.testing as nptest
import pytest


def simulator(resolution):
"""
Simulate the system with provided time resolution and return spike times.
"""

nest.ResetKernel()
nest.resolution = resolution

spike_times = [0.1, 5.0, 5.3, 5.33, 5.4, 5.9, 6.0]

sgen = nest.Create("spike_generator", params={"spike_times": spike_times, "precise_times": True})
srec = nest.Create("spike_recorder")

nest.Connect(sgen, srec)

nest.Simulate(8.0)

return srec.events["times"], spike_times


@pytest.mark.parametrize("resolution", [1.0, 0.1, 0.02, 0.01, 0.001])
def test_spike_recorder_different_resolutions(resolution):
"""
Test that recorded spike times are independent of resolution.
"""

actual_spikes, expected_spikes = simulator(resolution)
nptest.assert_almost_equal(actual_spikes, expected_spikes)
Loading