-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjupyter_imports.py
31 lines (27 loc) · 920 Bytes
/
jupyter_imports.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%load_ext autoreload
%autoreload 2
from pynwb import NWBHDF5IO
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import correlate
from scipy.io import loadmat, savemat
from math import floor, ceil
# Script to add the entire project directory structure to the python path
import sys, os
# Find the root directory of the nse project
parent_path, current_dir = os.path.split(os.path.abspath('.'))
while current_dir not in ['analysis', 'nse']:
parent_path, current_dir = os.path.split(parent_path)
p = os.path.join(parent_path, current_dir)
# Add analysis
if p not in sys.path:
sys.path.append(p)
# And standard list of subdirectories
for d in ["linear", "prelim", "utils", "kerasmodels"]:
if 'p\\%s' % d not in sys.path:
sys.path.append('p\\%s' % d)
# Now import all the other stuff:
from utils import preprocess
from utils import process
from utils import misc
from linear import linear_models