Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly use nest namespace to avoid compiler confusion #2253

Merged
merged 2 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions nestkernel/nestmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ NestModule::Apply_P_DFunction::execute( SLIInterpreter* i ) const
auto positions = getValue< DictionaryDatum >( i->OStack.pick( 0 ) );
auto param = getValue< ParameterDatum >( i->OStack.pick( 1 ) );

auto result = apply( param, positions );
auto result = nest::apply( param, positions ); // Using nest namespace explicitly to avoid confusion with std in C++17

i->OStack.pop( 2 );
i->OStack.push( result );
Expand All @@ -2011,7 +2011,7 @@ NestModule::Apply_P_gFunction::execute( SLIInterpreter* i ) const
NodeCollectionDatum nc = getValue< NodeCollectionDatum >( i->OStack.pick( 0 ) );
ParameterDatum param = getValue< ParameterDatum >( i->OStack.pick( 1 ) );

auto result = apply( param, nc );
auto result = nest::apply( param, nc ); // Using nest namespace explicitly to avoid confusion with std in C++17

i->OStack.pop( 2 );
i->OStack.push( result );
Expand Down
4 changes: 2 additions & 2 deletions testsuite/pytests/test_nodeParametrization.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,13 @@ def test_cos_parameter(self):
"""Test cosine of a parameter"""
for value in np.linspace(-5.0, 5.0, 15):
p = nest.CreateParameter('constant', {'value': value})
self.assertEqual(nest.math.cos(p).GetValue(), np.cos(value))
self.assertAlmostEqual(nest.math.cos(p).GetValue(), np.cos(value))

def test_sin_parameter(self):
"""Test sine of a parameter"""
for value in np.linspace(-5.0, 5.0, 15):
p = nest.CreateParameter('constant', {'value': value})
self.assertEqual(nest.math.sin(p).GetValue(), np.sin(value))
self.assertAlmostEqual(nest.math.sin(p).GetValue(), np.sin(value))

def test_power_parameter(self):
"""Test parameter raised to the power of an exponent"""
Expand Down