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

Syntax fixes for relative imports in Python3 #233

Merged
merged 2 commits into from Feb 22, 2016
Merged

Syntax fixes for relative imports in Python3 #233

merged 2 commits into from Feb 22, 2016

Conversation

@hernando
Copy link
Contributor

hernando commented Feb 18, 2016

No description provided.

@apeyser

This comment has been minimized.

Copy link

apeyser commented on pynest/nest/__init__.py in da016a6 Feb 18, 2016

I wonder why we're doing this in the init, rather than the build and inserting the modules in all ?

@apeyser
Copy link
Contributor

apeyser commented Feb 18, 2016

Looks correct to me. See #204 -- is this a follow up on that, or independent? It looks like there were issues also with tests.

@apeyser
Copy link
Contributor

apeyser commented Feb 18, 2016

@jougs, @tammoippen : anyone see a problem here?

@hernando
Copy link
Contributor Author

hernando commented Feb 18, 2016

This is independent of #204 (which I wasn't aware of). After building master with Python 3.4 I tried to import nest and it failed due to these broken imports.

@jougs
Copy link
Contributor

jougs commented Feb 18, 2016

@apeyser: this is a minimal version of #204.

I solved it exactly the same in https://github.com/jougs/nest-simulator/tree/split_pynest_hlapi earlier this week (see comment in #204). However, I also had to fix an additional problem with the message function of NESTError to get it fully working in Python 3.4.

@hernando isn't that a problem for you? Did you try running python -c "import nest; nest.test()" with your patch?

As we got no reply from @prcastro yet and people are obviously hitting this regularly, I suggest, we either merge this (or my version if the problem with NESTError persists) rather soon.

@hernando
Copy link
Contributor Author

hernando commented Feb 19, 2016

nest.test() failed, but not with an import error. The relevant output was:

======================================================================
ERROR: test_not_implemented_rules (nest.tests.test_sp.test_conn_builder.TestSPBuilder)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gpfs/bbp.cscs.ch/home/hernando/local/modules/nest/2.10.0/lib/python3.4/site-packages/nest/tests/test_sp/test_conn_builder.py", line 78, in test_not_implemented_rules
    nest.Connect(neurons, neurons, conn_dict, syn_dict)
  File "/gpfs/bbp.cscs.ch/home/hernando/local/modules/nest/2.10.0/lib/python3.4/site-packages/nest/lib/hl_api_helper.py", line 142, in stack_checker_func
    result = f(*args, **kwargs)
  File "/gpfs/bbp.cscs.ch/home/hernando/local/modules/nest/2.10.0/lib/python3.4/site-packages    /nest/lib/hl_api_connections.py", line 478, in Connect
    sr('Connect')
  File "/gpfs/bbp.cscs.ch/home/hernando/local/modules/nest/2.10.0/lib/python3.4/site-packages/nest/__init__.py", line 85, in catching_sli_run
    raise _kernel.NESTError("{0} in {1}{2}".format(errorname, commandname, message))
pynestkernel.NESTError: NotImplemented in Connect_g_g_D_D: This connection rule is not implemented for structural plasticity

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gpfs/bbp.cscs.ch/home/hernando/local/modules/nest/2.10.0/lib/python3.4/site-packages/nest/tests/test_sp/test_conn_builder.py", line 80, in test_not_implemented_rules
    self.assertRegexpMatches(e.message, 'This connection rule is not implemented for structural plasticity')
AttributeError: 'NESTError' object has no attribute 'message'

Commit 79405ce is the same. From #204 I think that the change in pynest/nest/tests/test_sp/test_conn_builder.py:80 is also required. I wouldn't merge the changes in #204 that convert relative imports into absolute ones.

@jougs
Copy link
Contributor

jougs commented Feb 22, 2016

NEST Core decided to accept this PR and merge immediately and close #204.

jougs added a commit that referenced this pull request Feb 22, 2016
Syntax fixes for relative imports in Python3
@jougs jougs merged commit 54d0017 into nest:master Feb 22, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.