ecoscape-utilities 0.0.31__tar.gz → 0.0.33__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ecoscape-utilities might be problematic. Click here for more details.
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/LICENSE.md +1 -1
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/PKG-INFO +13 -1
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/README.md +9 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities/ebird_db.py +14 -37
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/PKG-INFO +13 -1
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/pyproject.toml +14 -2
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities/__init__.py +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities/bird_runs.py +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/SOURCES.txt +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/dependency_links.txt +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/requires.txt +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/top_level.txt +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/requirements.txt +0 -0
- {ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/setup.cfg +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ecoscape-utilities
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.33
|
|
4
4
|
Summary: A collection of EcoScape utilities.
|
|
5
|
+
Author-email: Luca de Alfaro <luca@ucsc.edu>, Coen Adler <ctadler@ucsc.edu>, Artie Nazarov <anazarov@ucsc.edu>, Natalia Ocampo-Peñuela <nocampop@ucsc.edu>, Jasmine Tai <cjtai@ucsc.edu>, Natalie Valett <nvalett@ucsc.edu>
|
|
6
|
+
Project-URL: Homepage, https://github.com/ecoscape-earth/ecoscape-utilities
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/ecoscape-earth/ecoscape-utilities/issues
|
|
5
8
|
Classifier: Programming Language :: Python :: 3
|
|
6
9
|
Classifier: License :: OSI Approved :: BSD License
|
|
7
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -22,3 +25,12 @@ These are not packages distributed with pip. To install on Colab, simply do:
|
|
|
22
25
|
|
|
23
26
|
!pip install git+https://github.com/ecoscape-earth/ecoscape-utilities.git
|
|
24
27
|
|
|
28
|
+
## Authors
|
|
29
|
+
|
|
30
|
+
* Luca de Alfaro (luca@ucsc.edu)
|
|
31
|
+
* Natalia Ocampo-Peñuela (nocampop@ucsc.edu)
|
|
32
|
+
* Coen Adler (ctadler@ucsc.edu)
|
|
33
|
+
* Artie Nazarov (anazarov@ucsc.edu)
|
|
34
|
+
* Natalie Valett (nvalett@ucsc.edu)
|
|
35
|
+
* Jasmine Tai (cjtai@ucsc.edu)
|
|
36
|
+
|
|
@@ -6,3 +6,12 @@ These are not packages distributed with pip. To install on Colab, simply do:
|
|
|
6
6
|
|
|
7
7
|
!pip install git+https://github.com/ecoscape-earth/ecoscape-utilities.git
|
|
8
8
|
|
|
9
|
+
## Authors
|
|
10
|
+
|
|
11
|
+
* Luca de Alfaro (luca@ucsc.edu)
|
|
12
|
+
* Natalia Ocampo-Peñuela (nocampop@ucsc.edu)
|
|
13
|
+
* Coen Adler (ctadler@ucsc.edu)
|
|
14
|
+
* Artie Nazarov (anazarov@ucsc.edu)
|
|
15
|
+
* Natalie Valett (nvalett@ucsc.edu)
|
|
16
|
+
* Jasmine Tai (cjtai@ucsc.edu)
|
|
17
|
+
|
|
@@ -486,42 +486,12 @@ A module for common functionality in the validaiton process using ebird data
|
|
|
486
486
|
"""
|
|
487
487
|
class Validation(object):
|
|
488
488
|
|
|
489
|
-
def __init__(self, obs_fn
|
|
489
|
+
def __init__(self, obs_fn):
|
|
490
490
|
"""
|
|
491
491
|
Generates a class for validation.
|
|
492
|
-
It first tries to read the cached version of obs_fn for the specified geotiff_fn.
|
|
493
|
-
If the cached version is not found, it is created.
|
|
494
|
-
The cached version contains pre-translated coordinates to pixel values.
|
|
495
492
|
:param obs_fn: Observations filename.
|
|
496
|
-
:param geotiff_fn: name of a geotiff (habitat is preferred) used
|
|
497
|
-
for translating coordinates to pixel coordinates.
|
|
498
493
|
"""
|
|
499
494
|
self.obs_fn = obs_fn
|
|
500
|
-
self.geotiff_fn = geotiff_fn
|
|
501
|
-
h = hashlib.sha1(obs_fn.encode('utf-8'))
|
|
502
|
-
h.update(geotiff_fn.encode('utf-8'))
|
|
503
|
-
cached_fn = obs_fn + "." + h.hexdigest() + ".csv"
|
|
504
|
-
if not os.path.exists(cached_fn):
|
|
505
|
-
self._create_cached_observations(cached_fn)
|
|
506
|
-
self.observations = pd.read_csv(cached_fn)
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
def _create_cached_observations(self, cached_fn):
|
|
510
|
-
"""Creates a cached version of the observations that also contains
|
|
511
|
-
pixel coordinates."""
|
|
512
|
-
geotiff = GeoTiff.from_file(self.geotiff_fn)
|
|
513
|
-
def f(row):
|
|
514
|
-
square = row["Square"]
|
|
515
|
-
if (isinstance(square, str)):
|
|
516
|
-
coords = format_coords(square)
|
|
517
|
-
else:
|
|
518
|
-
coords = square
|
|
519
|
-
lat, lng = coords
|
|
520
|
-
pix_x, pix_y = transform_coords(geotiff, coords)
|
|
521
|
-
return lat, lng, pix_x, pix_y
|
|
522
|
-
df = pd.read_csv(self.obs_fn)
|
|
523
|
-
df["lat"], df["lng"], df["pix_x"], df["pix_y"] = zip(*df.apply(f, axis=1))
|
|
524
|
-
df.to_csv(cached_fn)
|
|
525
495
|
|
|
526
496
|
|
|
527
497
|
def filter_CA_rectangle(self, observation_ratios, bigsquare=False):
|
|
@@ -602,9 +572,10 @@ class Validation(object):
|
|
|
602
572
|
else:
|
|
603
573
|
coords = square
|
|
604
574
|
lat, lng = coords
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
575
|
+
repop_pix_coords = transform_coords(repop_tif, coords)
|
|
576
|
+
hab_pix_coords = transform_coords(hab, coords)
|
|
577
|
+
repop_tile = repop_tif.get_tile_from_coord(repop_pix_coords, tile_scale=tile_scale)
|
|
578
|
+
hab_tile = hab.get_tile_from_coord(hab_pix_coords, tile_scale=tile_scale)
|
|
608
579
|
if repop_tile is None or hab_tile is None:
|
|
609
580
|
continue
|
|
610
581
|
x, y = repop_tif.get_pixel_from_coord(coords)
|
|
@@ -638,9 +609,15 @@ class Validation(object):
|
|
|
638
609
|
"""
|
|
639
610
|
df = self.observations.copy()
|
|
640
611
|
def f(row):
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
612
|
+
square = row["Square"]
|
|
613
|
+
if (isinstance(square, str)):
|
|
614
|
+
coords = format_coords(square)
|
|
615
|
+
else:
|
|
616
|
+
coords = square
|
|
617
|
+
repop_pix_coords = transform_coords(repop_tif, coords)
|
|
618
|
+
hab_pix_coords = transform_coords(hab_tif, coords)
|
|
619
|
+
repop_tile = repop_tif.get_tile_from_coord(repop_pix_coords, tile_scale=tile_scale)
|
|
620
|
+
hab_tile = hab_tif.get_tile_from_coord(hab_pix_coords, tile_scale=tile_scale)
|
|
644
621
|
if repop_tile is None or hab_tile is None:
|
|
645
622
|
return pd.NA, pd.NA, pd.NA, pd.NA
|
|
646
623
|
avg_repop = np.average(repop_tile.m)
|
{ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/PKG-INFO
RENAMED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ecoscape-utilities
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.33
|
|
4
4
|
Summary: A collection of EcoScape utilities.
|
|
5
|
+
Author-email: Luca de Alfaro <luca@ucsc.edu>, Coen Adler <ctadler@ucsc.edu>, Artie Nazarov <anazarov@ucsc.edu>, Natalia Ocampo-Peñuela <nocampop@ucsc.edu>, Jasmine Tai <cjtai@ucsc.edu>, Natalie Valett <nvalett@ucsc.edu>
|
|
6
|
+
Project-URL: Homepage, https://github.com/ecoscape-earth/ecoscape-utilities
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/ecoscape-earth/ecoscape-utilities/issues
|
|
5
8
|
Classifier: Programming Language :: Python :: 3
|
|
6
9
|
Classifier: License :: OSI Approved :: BSD License
|
|
7
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -22,3 +25,12 @@ These are not packages distributed with pip. To install on Colab, simply do:
|
|
|
22
25
|
|
|
23
26
|
!pip install git+https://github.com/ecoscape-earth/ecoscape-utilities.git
|
|
24
27
|
|
|
28
|
+
## Authors
|
|
29
|
+
|
|
30
|
+
* Luca de Alfaro (luca@ucsc.edu)
|
|
31
|
+
* Natalia Ocampo-Peñuela (nocampop@ucsc.edu)
|
|
32
|
+
* Coen Adler (ctadler@ucsc.edu)
|
|
33
|
+
* Artie Nazarov (anazarov@ucsc.edu)
|
|
34
|
+
* Natalie Valett (nvalett@ucsc.edu)
|
|
35
|
+
* Jasmine Tai (cjtai@ucsc.edu)
|
|
36
|
+
|
|
@@ -4,8 +4,15 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ecoscape-utilities"
|
|
7
|
-
version = "0.0.
|
|
8
|
-
authors = [
|
|
7
|
+
version = "0.0.33"
|
|
8
|
+
authors = [
|
|
9
|
+
{name="Luca de Alfaro", email="luca@ucsc.edu"},
|
|
10
|
+
{name="Coen Adler", email="ctadler@ucsc.edu"},
|
|
11
|
+
{name="Artie Nazarov", email="anazarov@ucsc.edu"},
|
|
12
|
+
{name="Natalia Ocampo-Peñuela", email="nocampop@ucsc.edu"},
|
|
13
|
+
{name="Jasmine Tai", email="cjtai@ucsc.edu"},
|
|
14
|
+
{name="Natalie Valett", email="nvalett@ucsc.edu"}
|
|
15
|
+
]
|
|
9
16
|
description = "A collection of EcoScape utilities."
|
|
10
17
|
readme = "README.md"
|
|
11
18
|
requires-python = ">=3.7"
|
|
@@ -21,3 +28,8 @@ dependencies = {file = ["requirements.txt"]}
|
|
|
21
28
|
|
|
22
29
|
[tool.setuptools]
|
|
23
30
|
packages = ["ecoscape_utilities"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
"Homepage" = "https://github.com/ecoscape-earth/ecoscape-utilities"
|
|
35
|
+
"Bug Tracker" = "https://github.com/ecoscape-earth/ecoscape-utilities/issues"
|
|
File without changes
|
|
File without changes
|
{ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/requires.txt
RENAMED
|
File without changes
|
{ecoscape_utilities-0.0.31 → ecoscape_utilities-0.0.33}/ecoscape_utilities.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|