ecoscape-utilities 0.0.38__tar.gz → 0.0.39__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.38
3
+ Version: 0.0.39
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
@@ -226,10 +226,13 @@ class EbirdObservations(Connection):
226
226
  # Adds breeding portion
227
227
  if breeding is not None:
228
228
  query_string.extend([
229
- 'and substr("OBSERVATION DATE", 6, 2) >= ":br1"',
230
- 'and substr("OBSERVATION DATE", 6, 2) <= ":br2"',
229
+ 'and substr(checklist."OBSERVATION DATE", 6, 2) >= ":br1"',
230
+ 'and substr(checklist."OBSERVATION DATE", 6, 2) <= ":br2"',
231
231
  ])
232
232
  d['br1'], d['br2'] = breeding
233
+ if min_time is not None:
234
+ query_string.append('and "checklist.DURATION MINUTES" >= :min_time')
235
+ d["min_time"] = min_time
233
236
  if date_range is not None:
234
237
  query_string.append('and checklist."OBSERVATION DATE" >= :min_date')
235
238
  query_string.append('and checklist."OBSERVATION DATE" <= :max_date')
@@ -267,7 +270,7 @@ class EbirdObservations(Connection):
267
270
  )
268
271
 
269
272
  def get_square_individual_checklists(self, square, bird,
270
- breeding=None, date_range=None,
273
+ breeding=None, date_range=None, min_time=None,
271
274
  lat_range=None, lng_range=None, max_dist=2,
272
275
  verbose=False):
273
276
  """
@@ -300,6 +303,9 @@ class EbirdObservations(Connection):
300
303
  'and substr("OBSERVATION DATE", 6, 2) <= ":br2"',
301
304
  ])
302
305
  d['br1'], d['br2'] = breeding
306
+ if min_time is not None:
307
+ query_string.append('and "DURATION MINUTES" >= :min_time')
308
+ d["min_time"] = min_time
303
309
  if date_range is not None:
304
310
  query_string.append('and "OBSERVATION DATE" >= :min_date')
305
311
  query_string.append('and "OBSERVATION DATE" <= :max_date')
@@ -331,14 +337,17 @@ class EbirdObservations(Connection):
331
337
  # Adds breeding portion
332
338
  if breeding is not None:
333
339
  query_string.extend([
334
- 'and substr("OBSERVATION DATE", 6, 2) >= ":br1"',
335
- 'and substr("OBSERVATION DATE", 6, 2) <= ":br2"',
340
+ 'and substr(checklist."OBSERVATION DATE", 6, 2) >= ":br1"',
341
+ 'and substr(checklist."OBSERVATION DATE", 6, 2) <= ":br2"',
336
342
  ])
337
343
  d['br1'], d['br2'] = breeding
338
344
  if date_range is not None:
339
345
  query_string.append('and checklist."OBSERVATION DATE" >= :min_date')
340
346
  query_string.append('and checklist."OBSERVATION DATE" <= :max_date')
341
347
  d["min_date"], d["max_date"] = date_range
348
+ if min_time is not None:
349
+ query_string.append('and checklist."DURATION MINUTES" >= :min_time')
350
+ d["min_time"] = min_time
342
351
  if lat_range is not None:
343
352
  query_string.append('and checklist."LATITUDE" >= :min_lat')
344
353
  query_string.append('and checklist."LATITUDE" <= :max_lat')
@@ -362,7 +371,7 @@ class EbirdObservations(Connection):
362
371
  checklists_df["Count"] = checklists_df.apply(lambda row : counts[row["SAMPLING EVENT IDENTIFIER"]], axis=1)
363
372
  return checklists_df
364
373
 
365
- def get_squares_with_bird(self, bird, max_dist=1, breeding=None,
374
+ def get_squares_with_bird(self, bird, max_dist=1, breeding=None, min_time=None,
366
375
  date_range=None, lat_range=None, lng_range=None,
367
376
  state=None, verbose=False):
368
377
  """Gets all the squares where a bird has been sighted. This is used
@@ -395,6 +404,9 @@ class EbirdObservations(Connection):
395
404
  'and substr("OBSERVATION DATE", 6, 2) <= ":br2"',
396
405
  ])
397
406
  d['br1'], d['br2'] = breeding
407
+ if min_time is not None:
408
+ query_string.append('and "DURATION MINUTES" >= :min_time')
409
+ d["min_time"] = min_time
398
410
  if date_range is not None:
399
411
  query_string.append('and checklist."OBSERVATION DATE" >= :min_date')
400
412
  query_string.append('and checklist."OBSERVATION DATE" <= :max_date')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecoscape-utilities
3
- Version: 0.0.38
3
+ Version: 0.0.39
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.38"
7
+ version = "0.0.39"
8
8
  authors = [
9
9
  {name="Luca de Alfaro", email="luca@ucsc.edu"},
10
10
  {name="Coen Adler", email="ctadler@ucsc.edu"},