Skip to content

Commit

Permalink
Merge pull request #44 from wildlife-dynamics/ECO-47-events-functions…
Browse files Browse the repository at this point in the history
…-improvements

return event types as df and use event_id as index in get_events
  • Loading branch information
ericgitonga authored Sep 25, 2023
2 parents 8ea2a85 + 0d0836d commit 2500f32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ecoscope/io/earthranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ def get_subjectgroup_observations(self, subject_group=None, group_name=None, inc

return self.get_subject_observations(subject_ids, **kwargs)

def get_event_types(self, include_inactive=False, **addl_kwargs):
params = self._clean_kwargs(addl_kwargs, include_inactive=include_inactive)

return pd.DataFrame(self._get("activity/events/eventtypes", **params))

def get_events(
self,
is_collection=None,
Expand Down Expand Up @@ -597,7 +602,7 @@ def get_events(
df.set_crs(4326, inplace=True)

df.sort_values("time", inplace=True)
return df
return df.set_index("id")

def get_patrol_types(self):
df = pd.DataFrame(self._get("activity/patrols/types"))
Expand Down

0 comments on commit 2500f32

Please sign in to comment.