Syntax fixes for relative imports in Python3 #233

Merged
merged 2 commits into from Feb 22, 2016

Conversation

Projects
None yet
3 participants
@hernando
Contributor

hernando commented Feb 18, 2016

No description provided.

@apeyser

This comment has been minimized.

Show comment
Hide comment
@apeyser

apeyser Feb 18, 2016

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

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

@apeyser

This comment has been minimized.

Show comment
Hide comment
@apeyser

apeyser Feb 18, 2016

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@apeyser

apeyser Feb 18, 2016

Contributor

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

Contributor

apeyser commented Feb 18, 2016

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

@hernando

This comment has been minimized.

Show comment
Hide comment
@hernando

hernando Feb 18, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@jougs

jougs Feb 18, 2016

Contributor

@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.

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

This comment has been minimized.

Show comment
Hide comment
@hernando

hernando Feb 19, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@jougs

jougs Feb 22, 2016

Contributor

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

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

Merge pull request #233 from hernando/master
Syntax fixes for relative imports in Python3

@jougs jougs merged commit 54d0017 into nest:master Feb 22, 2016

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