Skip to content

Commit e4364f4

Browse files
author
Edward Boyda
committed
clean up explicit sys.path manipulations / import everything relative to repo base dir
1 parent 6698bb6 commit e4364f4

10 files changed

+11
-26
lines changed

notebooks/create_patch_dataset.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@
3535
"import os\n",
3636
"import pandas as pd\n",
3737
"import pickle\n",
38-
"import sys\n",
3938
"from tqdm.notebook import tqdm\n",
4039
"\n",
41-
"sys.path.append('../')\n",
4240
"from scripts.dl_utils import download_patch, rect_from_point, pad_patch\n",
4341
"from scripts.viz_tools import normalize"
4442
]
@@ -194,7 +192,7 @@
194192
"name": "python",
195193
"nbconvert_exporter": "python",
196194
"pygments_lexer": "ipython3",
197-
"version": "3.6.5"
195+
"version": "3.7.4"
198196
}
199197
},
200198
"nbformat": 4,

notebooks/create_pixel_dataset.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@
4646
"import pickle\n",
4747
"import pandas as pd\n",
4848
"import seaborn as sns\n",
49-
"import sys\n",
5049
"from tqdm.notebook import tqdm\n",
5150
"\n",
52-
"sys.path.append('../')\n",
5351
"from scripts.viz_tools import normalize, band_descriptions, plot_image_grid\n",
5452
"from scripts.dl_utils import download_patch, rect_from_point"
5553
]
@@ -202,7 +200,7 @@
202200
"name": "python",
203201
"nbconvert_exporter": "python",
204202
"pygments_lexer": "ipython3",
205-
"version": "3.6.5"
203+
"version": "3.7.4"
206204
}
207205
},
208206
"nbformat": 4,

notebooks/generate_contours.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"import datetime\n",
1717
"import json\n",
1818
"import os\n",
19-
"import sys\n",
2019
"\n",
2120
"import cv2\n",
2221
"import geojson\n",
@@ -29,7 +28,6 @@
2928
"from tensorflow import keras\n",
3029
"from tqdm import tqdm\n",
3130
"\n",
32-
"sys.path.append('../')\n",
3331
"from scripts.get_s2_data_ee import get_history, get_history_polygon, get_pixel_vectors, band_descriptions\n",
3432
"from scripts.viz_tools import stretch_histogram, create_img_stack, normalize\n",
3533
"\n",
@@ -557,7 +555,7 @@
557555
"name": "python",
558556
"nbconvert_exporter": "python",
559557
"pygments_lexer": "ipython3",
560-
"version": "3.6.5"
558+
"version": "3.7.4"
561559
}
562560
},
563561
"nbformat": 4,

notebooks/run_patch_classifier.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929
"import numpy as np\n",
3030
"import os\n",
3131
"import pandas as pd\n",
32-
"import sys\n",
3332
"from tensorflow import keras\n",
3433
"from tqdm.notebook import tqdm\n",
3534
"\n",
36-
"sys.path.append('../')\n",
3735
"from scripts.viz_tools import normalize, plot_image_grid\n",
3836
"from scripts.dl_utils import download_patch, rect_from_point, pad_patch"
3937
]
@@ -360,7 +358,7 @@
360358
"name": "python",
361359
"nbconvert_exporter": "python",
362360
"pygments_lexer": "ipython3",
363-
"version": "3.6.5"
361+
"version": "3.7.4"
364362
}
365363
},
366364
"nbformat": 4,

notebooks/run_pixel_classifier.ipynb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@
2828
"source": [
2929
"import os\n",
3030
"import pickle\n",
31-
"import sys\n",
3231
"\n",
3332
"import matplotlib.pyplot as plt\n",
3433
"import numpy as np\n",
3534
"from tensorflow import keras\n",
3635
"\n",
37-
"sys.path.append('../')\n",
38-
"sys.path.append('../scripts')\n",
3936
"from scripts.dl_utils import download_patch, rect_from_point\n",
4037
"from scripts.nn_predict import make_predictions, visualize_predictions"
4138
]
@@ -129,7 +126,7 @@
129126
"name": "python",
130127
"nbconvert_exporter": "python",
131128
"pygments_lexer": "ipython3",
132-
"version": "3.6.5"
129+
"version": "3.7.4"
133130
}
134131
},
135132
"nbformat": 4,

notebooks/train_patch_classifier.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"import json\n",
2828
"import os\n",
2929
"import pickle\n",
30-
"import sys\n",
3130
"\n",
3231
"import cv2\n",
3332
"import matplotlib.pyplot as plt\n",
@@ -40,7 +39,6 @@
4039
"from tensorflow.keras.preprocessing.image import ImageDataGenerator\n",
4140
"from tqdm import tqdm\n",
4241
"\n",
43-
"sys.path.append('../')\n",
4442
"from scripts.get_s2_data_ee import get_history, get_history_polygon, get_pixel_vectors\n",
4543
"from scripts.viz_tools import stretch_histogram, create_img_stack, normalize, band_descriptions"
4644
]
@@ -327,7 +325,7 @@
327325
"name": "python",
328326
"nbconvert_exporter": "python",
329327
"pygments_lexer": "ipython3",
330-
"version": "3.6.5"
328+
"version": "3.7.4"
331329
}
332330
},
333331
"nbformat": 4,

notebooks/train_pixel_classifier.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
"from tensorflow.keras import layers\n",
3939
"from tqdm.notebook import tqdm\n",
4040
"\n",
41-
"sys.path.append('../')\n",
42-
"sys.path.append('../scripts')\n",
4341
"from scripts.dl_utils import download_patch, rect_from_point\n",
4442
"from scripts.nn_predict import make_predictions, visualize_predictions\n",
4543
"from scripts.get_s2_data_ee import band_descriptions\n",
@@ -611,7 +609,7 @@
611609
"name": "python",
612610
"nbconvert_exporter": "python",
613611
"pygments_lexer": "ipython3",
614-
"version": "3.6.5"
612+
"version": "3.7.4"
615613
}
616614
},
617615
"nbformat": 4,

scripts/batch_process_firms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from tqdm import tqdm
44

5-
from nn_predict import main
5+
from scripts.nn_predict import main
66

77
lats = [-8.685, -8.7362, -8.7808, -8.8033, -8.7759, -8.8261, -8.8432, -8.8287, -8.8155, -8.8224, -8.7923, -8.6471, -8.626, -8.6186, -8.5573, -8.3447, -8.2721, -8.2424, -8.1594, -8.1584, -8.1537, -8.1542, -8.155, -8.1714, -8.1993, -8.1883, -8.2292, -8.1618, -8.1194, -8.1095, -8.0907, -8.0888, -8.0905, -8.0775, -8.2293, -8.3062, -8.3283, -8.3469, -8.5575, -8.5852, -8.5989, -8.5452]
88

scripts/nn_predict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import numpy as np
55
import os
66

7-
from dl_utils import download_patch, rect_from_point
8-
from viz_tools import normalize
7+
from scripts.dl_utils import download_patch, rect_from_point
8+
from scripts.viz_tools import normalize
99

1010
def make_predictions(patches, model):
1111
pred_stack = []

scripts/nn_predict_gee.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from tensorflow.keras import layers
99
from tqdm import tqdm
1010

11-
from get_s2_data_ee import get_history, get_pixel_vectors
11+
from scripts.get_s2_data_ee import get_history, get_pixel_vectors
1212

1313
def normalize(x):
1414
return (np.array(x) - 0) / (3000 - 0)

0 commit comments

Comments
 (0)