Explorar o código

Make loading of local packages independent of working directory

Julia Sprenger %!s(int64=3) %!d(string=hai) anos
pai
achega
81abe17f25
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      code/load_local_neo_odml_elephant.py

+ 4 - 3
code/load_local_neo_odml_elephant.py

@@ -1,10 +1,11 @@
 import sys
+from os.path import realpath, join, dirname
 
 # This loads the Neo and odML libraries shipped with this code. For production
 # use, please use the newest releases of odML and Neo.
-sys.path.insert(0, 'python-neo')
-sys.path.insert(0, 'python-odml')
+sys.path.insert(0, realpath(join(dirname(__file__), 'python-neo')))
+sys.path.insert(0, realpath(join(dirname(__file__), 'python-odml')))
 
 # This loads the Elephant analysis libraries shipped with this code. It
 # is used to generate the offline filtered LFP in example.py.
-sys.path.insert(0, 'elephant')
+sys.path.insert(0, realpath(join(dirname(__file__), 'elephant')))