Ticket #31 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

nest module from NEST2 conflicts with pyNN.nest in Python 2.4

Reported by: apdavison Assigned to: apdavison
Priority: major Milestone: 0.4.0
Component: nest2 Version: trunk
Keywords: Cc:

Description

What was pynest in NEST v1 is nest in NEST v2. The problem is that import nest within nest2.py imports pyNN.nest rather than nest, since the import mechanism looks within the package first.

Two possible solutions:

  1. Require Python 2.5. Versions >= 2.5 support absolute imports (from __future__ import absolute_import).
  2. Rename pyNN.nest to pyNN.nest1 or something similar.

I don't really like either solution, but overall I prefer (1). Comments?

Change History

07/19/07 13:01:54 changed by apdavison

As a temporary fix, in nest2.py:

import imp
mod_search = imp.find_module('nest', ['/usr/lib/python/site-packages'])
nest = imp.load_module('nest', *mod_search)

You will of course have to change the path if nest is not installed in /usr/lib/python/site-packages.

(in reply to: ↑ description ) 07/19/07 13:40:02 changed by apdavison

Jens wrote:

What is the problem with renaming nest to nest1? It would give consistent names, nest1, nest2, neuron etc. And NEST1 will be not used in close future anyway, or not?? At least I will not use it as soon as my network can use NEST2. I would not go for the python 2.5 requirement as already now it is sometimes hard to meet all python requirements when you are on a cluster where you don't have root rights.

07/19/07 13:51:30 changed by eppler

I completely agree with Jens' comment. Rename nest to nest1. This should not lead to too much trouble, as long as most users of pyNN.nest are still personally known to us ;-)

07/19/07 14:33:16 changed by Pierre

For me, changing the name of nest to nest1 is also ok, since the idea is that in a (soon) futur, nest1 should not be used anymore. So let's do like with neuron.py/oldneuron.py, and keep it for a while till nest2.py will be fully operational. Then it will become nest.py !

10/05/07 16:24:20 changed by apdavison

  • status changed from new to closed.
  • resolution set to fixed.

OK, renamed nest to nest1 and removed the temporary fix in nest2 (see r143)