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

Fix compatibility issues with Python 2 #1004

Merged
merged 4 commits into from Aug 17, 2018

Conversation

Projects
None yet
3 participants
@hakonsbm
Contributor

hakonsbm commented Aug 14, 2018

This PR contains some fixes for compatibility issues when using Python 2 when running examples and model_details scripts.

Python 2 doesn't handle complex numbers as elegantly as Python 3, which led to an error when running HillTononiModels.ipynb using Python 2. The problematic variable is now explicitly converted to a complex number if needed. There were also some minor issues in the PyNEST examples.

@hakonsbm hakonsbm changed the title from Fix issue with complex numbers when running HillTononiModels.ipynb with Python 2 to Fix compatibility issues with Python 2 Aug 14, 2018

@heplesser heplesser requested a review from stinebuu Aug 14, 2018

@@ -64,6 +64,7 @@
'''
from __future__ import print_function

This comment has been minimized.

@heplesser

heplesser Aug 14, 2018

Contributor

Why do we need this future import?

@heplesser

heplesser Aug 14, 2018

Contributor

Why do we need this future import?

This comment has been minimized.

@hakonsbm

hakonsbm Aug 14, 2018

Contributor

Because of the end=' ' here:

print('Statistics after optimization:', end=' ')

@hakonsbm

hakonsbm Aug 14, 2018

Contributor

Because of the end=' ' here:

print('Statistics after optimization:', end=' ')

This comment has been minimized.

@heplesser

heplesser Aug 14, 2018

Contributor

OK.

@heplesser

heplesser Aug 14, 2018

Contributor

OK.

Show outdated Hide outdated doc/model_details/HillTononiModels.ipynb

heplesser and others added some commits Aug 16, 2018

Merge pull request #23 from heplesser/hakon_fix_complex_python2
Corrected implementation in pure-python version of I_DK
@stinebuu

I approve!

@heplesser heplesser merged commit ef46f5e into nest:master Aug 17, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@hakonsbm hakonsbm deleted the hakonsbm:fix_complex_python2 branch Aug 17, 2018

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