Skip to content

Conversation

@heplesser
Copy link
Contributor

@heplesser heplesser commented Jul 10, 2025

A detailed description will follow. I create the PR now to allow references to it.

Review sections

@akorgor akorgor self-requested a review December 3, 2025 18:44
Copy link
Contributor

@jessica-mitchell jessica-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor fixes

@github-project-automation github-project-automation bot moved this from In progress to PRs pending approval in Kernel Dec 4, 2025
@@ -27,14 +27,12 @@
#include <limits>
#include <vector>

#include <boost/any.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this NEST depends on boost.

Copy link
Contributor

@babsey babsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing pyNEST folder (except examples subfolder) -> LGTM!

Please see several code suggestions inline.

@@ -362,7 +301,7 @@ def get_help_fname(obj):
File name of the help text for obj
"""

docdir = sli_func("statusdict/prgdocdir ::")
docdir = nestkernel.ll_api_get_kernel_status()["docdir"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
docdir = nestkernel.ll_api_get_kernel_status()["docdir"]
docdir = nestkernel.llapi_get_kernel_status()["docdir"]

@@ -80,7 +57,7 @@ def helpdesk():

"""

docdir = sli_func("statusdict/prgdocdir ::")
docdir = nestkernel.ll_api_get_kernel_status()["docdir"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
docdir = nestkernel.ll_api_get_kernel_status()["docdir"]
docdir = nestkernel.llapi_get_kernel_status()["docdir"]

@@ -574,9 +569,10 @@ def __bool__(self):
"""Converts the NodeCollection to a bool. False if it is empty, True otherwise."""
return len(self) > 0

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copy argument of numpy.array is a boolean.

Suggested change
def __array__(self, dtype=None, copy=None):
def __array__(self, dtype=None, copy=False):

@@ -942,21 +931,26 @@ def set(self, params=None, **kwargs):
return

if isinstance(params, (list, tuple)) and self.__len__() != len(params):
raise TypeError("status dict must be a dict, or a list of dicts of length {}".format(self.__len__()))
raise TypeError(f"status dict must be a dict, or a list of dicts of length {self.__len__()}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise TypeError(f"status dict must be a dict, or a list of dicts of length {self.__len__()}")
raise TypeError(f"Status dict must be a dict, or a list of dicts of length {self.__len__()}")

raise TypeError("expected parameter datum")
if not isinstance(datum, nestkernel.ParameterObject):
raise TypeError(
"expected low-level parameter object; use the 'CreateParameter()' function to create a 'Parameter'."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"expected low-level parameter object; use the 'CreateParameter()' function to create a 'Parameter'."
"Expected low-level parameter object; use the 'CreateParameter()' function to create a 'Parameter'."

Comment on lines +114 to +115
msg = f"`{self._name}` is a read only kernel attribute."
raise AttributeError(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg = f"`{self._name}` is a read only kernel attribute."
raise AttributeError(msg)
raise AttributeError(f"`{self._name}` is a read only kernel attribute.")

@@ -80,7 +57,7 @@ def helpdesk():

"""

docdir = sli_func("statusdict/prgdocdir ::")
docdir = nestkernel.ll_api_get_kernel_status()["docdir"]
help_fname = os.path.join(docdir, "html", "index.html")

if not os.path.isfile(help_fname):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better consistence, please include msg content into FileNotFoundError.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find it at line 64. Sorry for this comment, it was out of reach.

Copy link
Contributor

@pnbabu pnbabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in the models directory look good to me overall. I have a few minor comments.

@@ -261,12 +261,12 @@ class amat2_psc_exp : public ArchivingNode

Parameters_(); //!< Sets default parameter values

void get( DictionaryDatum& ) const; //!< Store current values in dictionary
void get( Dictionary& ) const; //!< Store current values in dictionary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use Dictionary instead of dictionary in the comments here? I saw this in other models, but not here.

void get( DictionaryDatum& ) const; //!< Store current values in dictionary
void set( const DictionaryDatum&, Node* node ); //!< Set values from dicitonary
void get( Dictionary& ) const; //!< Store current values in Dictionary
void set( const Dictionary&, Node* node ); //!< Set values from dicitonary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void set( const Dictionary&, Node* node ); //!< Set values from dicitonary
void set( const Dictionary&, Node* node ); //!< Set values from Dictionary

@@ -34,8 +34,7 @@ nest::Na::Na( double v_comp )
// some default initialization
init_statevars( v_comp );
}

nest::Na::Na( double v_comp, const DictionaryDatum& channel_params )
nest::Na::Na( double v_comp, const Dictionary& channel_params )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nest::Na::Na( double v_comp, const Dictionary& channel_params )
nest::Na::Na( double v_comp, const Dictionary& channel_params )

@@ -326,15 +352,15 @@ correlation_detector::handles_test_event( SpikeEvent&, size_t receptor_type )
}

inline void
correlation_detector::get_status( DictionaryDatum& d ) const
nest::correlation_detector::get_status( Dictionary& d ) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need the nest namespace here when it's already in the namespace?

{
device_.get_status( d );
P_.get( d );
S_.get( d );
}

inline void
correlation_detector::set_status( const DictionaryDatum& d )
nest::correlation_detector::set_status( const Dictionary& d )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Comment on lines +603 to +604
// We must pass here if called by SetDefaults. In that case, the user will get and error
// message because the parameters for the synapse-specific optimizer have not been accessed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// We must pass here if called by SetDefaults. In that case, the user will get and error
// message because the parameters for the synapse-specific optimizer have not been accessed.
// We must pass here if called by SetDefaults. In that case, the user will get an error
// message because the parameters for the synapse-specific optimizer have not been accessed.

* Compartment name list
* ---------------------------------------------------------------- */

/* Harold Gutch reported some static destruction problems on OSX 10.4.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this comment?

Comment on lines +114 to 118
std::vector< std::string > ad;
for ( size_t j = 0; j < record_from_.size(); ++j )
{
ad.push_back( LiteralDatum( record_from_[ j ] ) );
ad.push_back( record_from_[ j ] );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we copy this to a new vector?

Comment on lines +102 to +108
/// std::vector< std::string > record_from;
///
/// for ( size_t j = 0; j < record_from_.size(); ++j )
/// {
/// record_from.push_back( record_from_[ j ] );
/// }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment.

{
if ( d->known( names::senders ) )
auto get_or_create_nc = [ &d ]( NodeCollectionPTR& nc, const std::string& key )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be called just get_nc instead of get_or_create_nc, as an empty NC sis already created in the constructor?

Copy link
Contributor

@jessica-mitchell jessica-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I will finalize the What's new page during the release process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

focus Issue/PR is part of the focused group of items in an ongoing coordinated effort. I: Internal API Changes were introduced in basic internal workings of the simulator that developers need to know S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation.

Projects

Status: PRs pending approval
Status: In progress

Development

Successfully merging this pull request may close these issues.

Extreme memory usage when setting a non-existent synapse property Refactoring the startup.

9 participants