Skip to content

get_detail_data_frame() fails for a single event #245

@johndwest

Description

@johndwest

Describe the bug
get_detail_data_frame() fails when passed a DetailEvent object for a single event

To Reproduce
Using get_event_by_id(evenitid='usp0009kkb') , retrieve a single DetailEvent object (here, single_event)
Call get_detail_data_frame(single_event)

This causes the following error:
Traceback (most recent call last):
File "", line 1, in
File "/home/jdw/anaconda3/envs/comcat/lib/python3.8/site-packages/libcomcat/dataframes.py", line 406, in get_detail_data_frame
inc = min(100, np.power(10, np.floor(np.log10(len(events))) - 1))
TypeError: object of type 'DetailEvent' has no len()

Expected behavior
I expect this to return a single-row detail data frame

Environment

  • OS: Ubuntu 20.04.1 LTS
  • Python Version 3.8
  • Libcomcat Version 2.0
  • Numpy Version 1.20.3

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions