Skip to content

Commit

Permalink
return event types as df and use event_id as index in get_events
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgitonga committed Sep 2, 2023
1 parent bfc92c9 commit 3043e72
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, include_schema=False, **addl_kwargs):
params = self._clean_kwargs(addl_kwargs, include_inactive=include_inactive, include_schema=include_schema)

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):
return pd.DataFrame(self._get("activity/patrols/types"))
Expand Down

0 comments on commit 3043e72

Please sign in to comment.