ecoscape-utilities 0.0.34__tar.gz → 0.0.36__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecoscape-utilities
3
- Version: 0.0.34
3
+ Version: 0.0.36
4
4
  Summary: A collection of EcoScape utilities.
5
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
6
  Project-URL: Homepage, https://github.com/ecoscape-earth/ecoscape-utilities
@@ -73,7 +73,7 @@ class EbirdObservations(Connection):
73
73
 
74
74
  def get_all_squares(self, state=None,
75
75
  breeding=True, date_range=None,
76
- lat_range=None, lng_range=None, max_dist=2,
76
+ lat_range=None, lng_range=None, max_dist=2, min_time=None,
77
77
  verbose=False):
78
78
  """
79
79
  Gets all squares with bird (any bird) observations, for a certain state,
@@ -85,12 +85,16 @@ class EbirdObservations(Connection):
85
85
  :param lng_range: tuple of 2 floats for the lower and upper bounds for longitude
86
86
  :param max_dist (int): max kilometers traveled for the checklist for any observation we consider
87
87
  (any of further distance will be too noisy, and should be disreguarded)
88
+ :param min_time (int): minimum time in minutes for the checklist for any observation we consider
88
89
  :returns: list of squares which fall within the query parameters
89
90
  """
90
91
  query_string=['select DISTINCT SQUARE from checklist where "ALL SPECIES REPORTED" = 1']
91
92
  query_string.append('and "PROTOCOL TYPE" != "Incidental"')
92
93
  query_string.append('and "EFFORT DISTANCE KM" <= :dist')
93
94
  d = {"dist": max_dist}
95
+ if min_time is not None:
96
+ query_string.append('and "DURATION MINUTES" >= :min_time')
97
+ d["min_time"] = min_time
94
98
  if state is not None:
95
99
  query_string.append('and "STATE CODE" = :state')
96
100
  d['state'] = state
@@ -121,7 +125,7 @@ class EbirdObservations(Connection):
121
125
 
122
126
  def get_square_observations(self, square, bird,
123
127
  breeding=True, date_range=None,
124
- lat_range=None, lng_range=None, max_dist=2,
128
+ lat_range=None, lng_range=None, max_dist=2, min_time=None,
125
129
  verbose=False):
126
130
  """
127
131
  Get the number of checklists, number of checklists with a bird,
@@ -134,6 +138,7 @@ class EbirdObservations(Connection):
134
138
  :param lng_range: tuple of 2 floats for the lower and upper bounds for longitude
135
139
  :param max_dist (int): max kilometers traveled for the checklist for any observation we consider
136
140
  (any of further distance will be too noisy, and should be disreguarded)
141
+ :param min_time (int): minimum time in minutes for the checklist for any observation we consider
137
142
  :returns: num_checklists, num_bird_checklists, num_birds for the given square.
138
143
  """
139
144
  # Gets the number of checklists, the total time, the total distance, and the total number of birds.
@@ -144,6 +149,9 @@ class EbirdObservations(Connection):
144
149
  query_string.append('and "PROTOCOL TYPE" != "Incidental"')
145
150
  query_string.append('and "EFFORT DISTANCE KM" <= :dist')
146
151
  d["dist"] = max_dist
152
+ if min_time is not None:
153
+ query_string.append('and "DURATION MINUTES" >= :min_time')
154
+ d["min_time"] = min_time
147
155
  # Adds breeding portion
148
156
  if breeding:
149
157
  query_string.extend([
@@ -620,7 +628,7 @@ class Validation(object):
620
628
  repop_tile = repop_tif.get_tile_from_coord(repop_pix_coords, tile_scale=tile_scale)
621
629
  hab_tile = hab_tif.get_tile_from_coord(hab_pix_coords, tile_scale=tile_scale)
622
630
  if repop_tile is None or hab_tile is None:
623
- return pd.NA, pd.NA, pd.NA, pd.NA
631
+ return pd.NA, pd.NA, pd.NA, pd.NA, lat, lng
624
632
  avg_repop = np.average(repop_tile.m)
625
633
  avg_hab = np.average(hab_tile.m)
626
634
  max_repop = np.max(repop_tile.m)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecoscape-utilities
3
- Version: 0.0.34
3
+ Version: 0.0.36
4
4
  Summary: A collection of EcoScape utilities.
5
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
6
  Project-URL: Homepage, https://github.com/ecoscape-earth/ecoscape-utilities
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ecoscape-utilities"
7
- version = "0.0.34"
7
+ version = "0.0.36"
8
8
  authors = [
9
9
  {name="Luca de Alfaro", email="luca@ucsc.edu"},
10
10
  {name="Coen Adler", email="ctadler@ucsc.edu"},