Skip to content

Commit d854caa

Browse files
committed
Sample notebook update for test automation
1 parent c0adaed commit d854caa

16 files changed

Lines changed: 1810 additions & 99 deletions

samples/04_gis_analysts_data_scientists/automate_building_footprint_extraction_using_instance_segmentation.ipynb

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@
236236
"warnings.filterwarnings(\"ignore\")\n",
237237
"\n",
238238
"import os\n",
239+
"from datetime import datetime\n",
239240
"from pathlib import Path\n",
240-
"from arcgis.learn import MaskRCNN, prepare_data\n",
241-
"from arcgis.gis import GIS"
241+
"from arcgis.learn import MaskRCNN, prepare_data"
242242
]
243243
},
244244
{
@@ -617,6 +617,16 @@
617617
"As we can see, with 10 epochs, we are already seeing reasonable results. Further improvments can be achieved through more sophisticated hyperparameter tuning. Let's save the model, so it can be used for inference, or further training subsequently. By default, it will be saved into your data_path that you specified in the very beginning of this notebook, in the `prepare_data` call."
618618
]
619619
},
620+
{
621+
"cell_type": "code",
622+
"execution_count": 5,
623+
"metadata": {},
624+
"outputs": [],
625+
"source": [
626+
"timestamp = datetime.now().strftime(\"%Y-%m-%d_%H:%M:%S\")\n",
627+
"model_name = \"Building_footprint_10epochs_\" + timestamp"
628+
]
629+
},
620630
{
621631
"cell_type": "code",
622632
"execution_count": 16,
@@ -677,7 +687,7 @@
677687
}
678688
],
679689
"source": [
680-
"model.save('Building_footprint_10epochs', publish=True)"
690+
"model.save(model_name, publish=True)"
681691
]
682692
},
683693
{
@@ -752,9 +762,9 @@
752762
"notebookRuntimeVersion": ""
753763
},
754764
"kernelspec": {
755-
"display_name": "Python [conda env:conda-dl] *",
765+
"display_name": "Python [conda env:dlenv_30_9] *",
756766
"language": "python",
757-
"name": "conda-env-conda-dl-py"
767+
"name": "conda-env-dlenv_30_9-py"
758768
},
759769
"language_info": {
760770
"codemirror_mode": {
@@ -766,7 +776,7 @@
766776
"name": "python",
767777
"nbconvert_exporter": "python",
768778
"pygments_lexer": "ipython3",
769-
"version": "3.11.11"
779+
"version": "3.13.7"
770780
}
771781
},
772782
"nbformat": 4,

samples/04_gis_analysts_data_scientists/automatic_road_extraction_using_deep_learning.ipynb

Lines changed: 879 additions & 1 deletion
Large diffs are not rendered by default.

samples/04_gis_analysts_data_scientists/building_reconstruction_using_mask_rcnn.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,9 @@
826826
"notebookRuntimeVersion": ""
827827
},
828828
"kernelspec": {
829-
"display_name": "Python 3 (ipykernel)",
829+
"display_name": "Python [conda env:dlenv_30_9] *",
830830
"language": "python",
831-
"name": "python3"
831+
"name": "conda-env-dlenv_30_9-py"
832832
},
833833
"language_info": {
834834
"codemirror_mode": {
@@ -840,7 +840,7 @@
840840
"name": "python",
841841
"nbconvert_exporter": "python",
842842
"pygments_lexer": "ipython3",
843-
"version": "3.11.0"
843+
"version": "3.13.7"
844844
},
845845
"toc": {
846846
"base_numbering": 1,

samples/04_gis_analysts_data_scientists/change_detection_of_buildings_from_satellite_imagery.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,9 +1719,9 @@
17191719
"notebookRuntimeVersion": ""
17201720
},
17211721
"kernelspec": {
1722-
"display_name": "Python 3",
1722+
"display_name": "Python [conda env:dlenv_30_9] *",
17231723
"language": "python",
1724-
"name": "python3"
1724+
"name": "conda-env-dlenv_30_9-py"
17251725
},
17261726
"language_info": {
17271727
"codemirror_mode": {
@@ -1733,7 +1733,7 @@
17331733
"name": "python",
17341734
"nbconvert_exporter": "python",
17351735
"pygments_lexer": "ipython3",
1736-
"version": "3.7.9"
1736+
"version": "3.13.7"
17371737
}
17381738
},
17391739
"nbformat": 4,

samples/04_gis_analysts_data_scientists/classifying_human_activity_using_tabPFN_classifier.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,12 @@
5858
"metadata": {},
5959
"outputs": [],
6060
"source": [
61-
"%matplotlib inline\n",
6261
"import matplotlib.pyplot as plt\n",
6362
"\n",
6463
"import pandas as pd\n",
6564
"from sklearn.discriminant_analysis import LinearDiscriminantAnalysis\n",
6665
"from sklearn.preprocessing import StandardScaler\n",
6766
"from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, classification_report\n",
68-
"\n",
69-
"from arcgis.gis import GIS\n",
7067
"from arcgis.learn import MLModel, prepare_tabulardata"
7168
]
7269
},
@@ -97,6 +94,7 @@
9794
"metadata": {},
9895
"outputs": [],
9996
"source": [
97+
"from arcgis.gis import GIS\n",
10098
"gis = GIS(\"home\")"
10199
]
102100
},
@@ -2178,9 +2176,9 @@
21782176
],
21792177
"metadata": {
21802178
"kernelspec": {
2181-
"display_name": "pro3.6_certify2.4.2_24Sep2025 [conda env:conda-pro3.6_certify2.4.2_24Sep2025] *",
2179+
"display_name": "Python [conda env:dlenv_30_9] *",
21822180
"language": "python",
2183-
"name": "conda-env-conda-pro3.6_certify2.4.2_24Sep2025-pro3.6_certify2.4.2_24sep2025"
2181+
"name": "conda-env-dlenv_30_9-py"
21842182
},
21852183
"language_info": {
21862184
"codemirror_mode": {

samples/04_gis_analysts_data_scientists/coastline_classification_using_feature_classifier.ipynb

Lines changed: 842 additions & 1 deletion
Large diffs are not rendered by default.

samples/04_gis_analysts_data_scientists/covid_case_forecasting_for_alabama_state_using_timeseriesmodel_from_arcgis_learn.ipynb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,13 @@
6262
"metadata": {},
6363
"outputs": [],
6464
"source": [
65-
"%matplotlib inline\n",
66-
"\n",
6765
"import numpy as np\n",
6866
"import pandas as pd\n",
6967
"import matplotlib.pyplot as plt\n",
7068
"\n",
7169
"from sklearn.model_selection import train_test_split\n",
7270
"from sklearn.metrics import r2_score\n",
7371
"import sklearn.metrics as metrics\n",
74-
"\n",
75-
"from arcgis.gis import GIS\n",
7672
"from arcgis.learn import TimeSeriesModel, prepare_tabulardata"
7773
]
7874
},
@@ -91,6 +87,7 @@
9187
"metadata": {},
9288
"outputs": [],
9389
"source": [
90+
"from arcgis.gis import GIS\n",
9491
"gis = GIS(\"home\")"
9592
]
9693
},
@@ -1903,9 +1900,9 @@
19031900
],
19041901
"metadata": {
19051902
"kernelspec": {
1906-
"display_name": "Python 3 (ipykernel)",
1903+
"display_name": "Python [conda env:dlenv_30_9] *",
19071904
"language": "python",
1908-
"name": "python3"
1905+
"name": "conda-env-dlenv_30_9-py"
19091906
},
19101907
"language_info": {
19111908
"codemirror_mode": {
@@ -1917,7 +1914,7 @@
19171914
"name": "python",
19181915
"nbconvert_exporter": "python",
19191916
"pygments_lexer": "ipython3",
1920-
"version": "3.11.0"
1917+
"version": "3.13.7"
19211918
}
19221919
},
19231920
"nbformat": 4,

samples/04_gis_analysts_data_scientists/detecting_mussel_farms_using_deep_learning.ipynb

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@
111111
"## Export training data"
112112
]
113113
},
114-
{
115-
"cell_type": "code",
116-
"execution_count": 1,
117-
"id": "ad42be61",
118-
"metadata": {},
119-
"outputs": [],
120-
"source": [
121-
"from arcgis.gis import GIS"
122-
]
123-
},
124114
{
125115
"cell_type": "code",
126116
"execution_count": 2,
@@ -129,6 +119,7 @@
129119
"outputs": [],
130120
"source": [
131121
"# Connect to GIS\n",
122+
"from arcgis.gis import GIS\n",
132123
"gis = GIS('home')"
133124
]
134125
},
@@ -1134,9 +1125,9 @@
11341125
],
11351126
"metadata": {
11361127
"kernelspec": {
1137-
"display_name": "Python 3 (ipykernel)",
1128+
"display_name": "Python [conda env:dlenv_30_9] *",
11381129
"language": "python",
1139-
"name": "python3"
1130+
"name": "conda-env-dlenv_30_9-py"
11401131
},
11411132
"language_info": {
11421133
"codemirror_mode": {
@@ -1148,7 +1139,7 @@
11481139
"name": "python",
11491140
"nbconvert_exporter": "python",
11501141
"pygments_lexer": "ipython3",
1151-
"version": "3.11.0"
1142+
"version": "3.13.7"
11521143
}
11531144
},
11541145
"nbformat": 4,

samples/04_gis_analysts_data_scientists/detecting_palm_trees_using_deep_learning.ipynb

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"import os\n",
240240
"import zipfile\n",
241241
"from pathlib import Path\n",
242+
"from datetime import datetime\n",
242243
"from arcgis.learn import prepare_data, DETReg"
243244
]
244245
},
@@ -439,9 +440,7 @@
439440
"cell_type": "code",
440441
"execution_count": 4,
441442
"id": "f41c1a79",
442-
"metadata": {
443-
"scrolled": false
444-
},
443+
"metadata": {},
445444
"outputs": [],
446445
"source": [
447446
"detreg_model = DETReg(data)"
@@ -451,9 +450,7 @@
451450
"cell_type": "code",
452451
"execution_count": 6,
453452
"id": "ef1115d7",
454-
"metadata": {
455-
"scrolled": false
456-
},
453+
"metadata": {},
457454
"outputs": [
458455
{
459456
"data": {
@@ -1216,9 +1213,7 @@
12161213
"cell_type": "code",
12171214
"execution_count": 27,
12181215
"id": "64810d9b",
1219-
"metadata": {
1220-
"scrolled": false
1221-
},
1216+
"metadata": {},
12221217
"outputs": [
12231218
{
12241219
"data": {
@@ -1282,6 +1277,17 @@
12821277
"We will use the `save()` method to save the trained model. By default, it will be saved to the 'models' sub-folder within our training data folder."
12831278
]
12841279
},
1280+
{
1281+
"cell_type": "code",
1282+
"execution_count": null,
1283+
"id": "e5f19663-d37a-44af-8031-1e0ec0f5da52",
1284+
"metadata": {},
1285+
"outputs": [],
1286+
"source": [
1287+
"timestamp = datetime.now().strftime(\"%Y-%m-%d_%H:%M:%S\")\n",
1288+
"model_name = \"palm_e100_\" + timestamp"
1289+
]
1290+
},
12851291
{
12861292
"cell_type": "code",
12871293
"execution_count": 24,
@@ -1308,7 +1314,7 @@
13081314
}
13091315
],
13101316
"source": [
1311-
"detreg_model.save('palm_e100', publish=True)"
1317+
"detreg_model.save(model_name, publish=True)"
13121318
]
13131319
},
13141320
{
@@ -1402,9 +1408,9 @@
14021408
],
14031409
"metadata": {
14041410
"kernelspec": {
1405-
"display_name": "Python 3",
1411+
"display_name": "Python [conda env:dlenv_30_9] *",
14061412
"language": "python",
1407-
"name": "python3"
1413+
"name": "conda-env-dlenv_30_9-py"
14081414
},
14091415
"language_info": {
14101416
"codemirror_mode": {
@@ -1416,7 +1422,7 @@
14161422
"name": "python",
14171423
"nbconvert_exporter": "python",
14181424
"pygments_lexer": "ipython3",
1419-
"version": "3.9.11"
1425+
"version": "3.13.7"
14201426
}
14211427
},
14221428
"nbformat": 4,

samples/04_gis_analysts_data_scientists/forecasting_daily_power_consumption_using_deep_learning_timeseries.ipynb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"metadata": {},
5858
"outputs": [],
5959
"source": [
60-
"%matplotlib inline\n",
6160
"import matplotlib.pyplot as plt\n",
6261
"\n",
6362
"import numpy as np\n",
@@ -77,7 +76,6 @@
7776
"from sklearn.metrics import r2_score\n",
7877
"import sklearn.metrics as metrics\n",
7978
"\n",
80-
"from arcgis.gis import GIS\n",
8179
"from arcgis.learn import TimeSeriesModel, prepare_tabulardata\n",
8280
"from arcgis.features import FeatureLayer, FeatureLayerCollection"
8381
]
@@ -95,6 +93,7 @@
9593
"metadata": {},
9694
"outputs": [],
9795
"source": [
96+
"from arcgis.gis import GIS\n",
9897
"gis = GIS(\"home\")"
9998
]
10099
},
@@ -4079,9 +4078,9 @@
40794078
],
40804079
"metadata": {
40814080
"kernelspec": {
4082-
"display_name": "condapac_18March2024",
4081+
"display_name": "Python [conda env:dlenv_30_9] *",
40834082
"language": "python",
4084-
"name": "condapac_18march2024"
4083+
"name": "conda-env-dlenv_30_9-py"
40854084
},
40864085
"language_info": {
40874086
"codemirror_mode": {
@@ -4093,7 +4092,7 @@
40934092
"name": "python",
40944093
"nbconvert_exporter": "python",
40954094
"pygments_lexer": "ipython3",
4096-
"version": "3.11.8"
4095+
"version": "3.13.7"
40974096
}
40984097
},
40994098
"nbformat": 4,

0 commit comments

Comments
 (0)