-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into am/classifier_labels
- Loading branch information
Showing
29 changed files
with
334 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
}, | ||
"outputs": [], | ||
"source": [ | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
@@ -614,7 +614,11 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"patrol_df = er_io.get_patrols()\n", | ||
"patrol_df = er_io.get_patrols(\n", | ||
" since=pd.Timestamp(\"2017-01-01\").isoformat(),\n", | ||
" until=pd.Timestamp(\"2017-04-01\").isoformat(),\n", | ||
")\n", | ||
"\n", | ||
"\n", | ||
"relocs = er_io.get_patrol_observations(\n", | ||
" patrol_df,\n", | ||
|
@@ -709,8 +713,8 @@ | |
")\n", | ||
"\n", | ||
"if not elephants.empty:\n", | ||
" for i, value in elephants.iterrows():\n", | ||
" er_io.delete_observation(observation_id=elephants.loc[i, \"extra__id\"])" | ||
" for observation_id in elephants[\"extra__id\"].unique():\n", | ||
" er_io.delete_observation(observation_id)" | ||
] | ||
}, | ||
{ | ||
|
@@ -863,11 +867,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"relocs.drop(\n", | ||
" columns=relocs.columns[relocs.applymap(lambda x: isinstance(x, list)).any()],\n", | ||
" errors=\"ignore\",\n", | ||
" inplace=True,\n", | ||
")\n", | ||
"relocs = relocs.select_dtypes(exclude=[list])\n", | ||
"\n", | ||
"relocs.to_file(os.path.join(output_dir, \"observations.gpkg\"), layer=\"observations\")" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
@@ -38,7 +38,6 @@ | |
"source": [ | ||
"import os\n", | ||
"import sys\n", | ||
"import zipfile\n", | ||
"\n", | ||
"import shapely\n", | ||
"\n", | ||
|
@@ -208,26 +207,9 @@ | |
"ecoscope.io.utils.download_file(\n", | ||
" url=img.getDownloadUrl(download_config),\n", | ||
" path=img_zip_file,\n", | ||
" unzip=True,\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Unzip" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"with zipfile.ZipFile(img_zip_file) as z:\n", | ||
" for name in z.namelist():\n", | ||
" z.extract(name, output_dir)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
@@ -40,7 +40,6 @@ | |
"source": [ | ||
"import os\n", | ||
"import sys\n", | ||
"import zipfile\n", | ||
"\n", | ||
"import geopandas as gpd\n", | ||
"\n", | ||
|
@@ -90,25 +89,10 @@ | |
" url=\"https://maraelephant.maps.arcgis.com/sharing/rest/content/items/162e299f0c7d472b8e36211e946bb273/data\",\n", | ||
" path=output_dir,\n", | ||
" overwrite_existing=False,\n", | ||
" unzip=True,\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Extract ZIP" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"zipfile.ZipFile(os.path.join(output_dir, \"active_public_uncategorized_shpfiles.zip\")).extractall(path=output_dir)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
@@ -252,7 +252,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"relocs[[\"groupby_col\", \"fixtime\", \"geometry\"]].explore()" | ||
"relocs[[\"groupby_col\", \"geometry\"]].explore()" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
@@ -152,7 +152,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"traj.explore()" | ||
"traj[\"geometry\"].explore()" | ||
] | ||
}, | ||
{ | ||
|
@@ -546,7 +546,7 @@ | |
" individual=\"1d22ff96-44d4-45c4-adc3-db1513acbe7d\",\n", | ||
" interpolation=\"dofjojfs\",\n", | ||
" )\n", | ||
"except NotImplemented as e:\n", | ||
"except NotImplementedError as e:\n", | ||
" print(e)" | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"%pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
@@ -98,7 +98,6 @@ | |
"ecoscope.io.download_file(\n", | ||
" f\"{ECOSCOPE_RAW}/tests/sample_data/vector/er_relocs.csv.zip\",\n", | ||
" os.path.join(output_dir, \"er_relocs.csv.zip\"),\n", | ||
" unzip=False,\n", | ||
")\n", | ||
"\n", | ||
"data = pd.read_csv(os.path.join(output_dir, \"er_relocs.csv.zip\"), header=0, index_col=0)\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
"source": [ | ||
"ECOSCOPE_RAW = \"https://raw.githubusercontent.com/wildlife-dynamics/ecoscope/master\"\n", | ||
"\n", | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].3' &> /dev/null" | ||
"!pip install 'ecoscope[analysis,mapping,plotting] @ git+https://github.com/wildlife-dynamics/[email protected].5' &> /dev/null" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.