Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_detail_data_frame() fails when passed list of DetailEvent objects #247

Open
johndwest opened this issue Jul 1, 2021 · 0 comments
Open
Labels

Comments

@johndwest
Copy link

Describe the bug
documentation states that get_detail_data_frame() accepts a list of DetailEvent objects
documentation states that DetailEvent objects can be acquired using the get_event_by_id() method
BUT: get_detail_data_frame() fails when passed a list of DetailEvent objects, works when passed a list of SummaryEvent objects

To Reproduce
ThisEvent = 'ak01613v15nv'
try:
detailE = get_event_by_id(eventid=ThisEvent)
DummyList = []
DummyList.append(detailE)
moment_df = get_detail_data_frame(events=DummyList, get_tensors='preferred')
except Exception as ex:
MsgText = "ADEPT script error retrieving moment tensors."
print(MsgText, str(ex) + traceback.format_exc())

Expected behavior
Per the documentation I expect get_detail_data_frame() to return a dataframe containing data for the chosen DetailEvent. It fails.

Environment (please complete the following information):
OS: Ubuntu 20.04.1 LTS
Python Version 3.8
Libcomcat Version 2.0
Numpy Version 1.20.3

Additional context
Source code file dataframes.py, line 348 assumes that the event list passed to get_detail_data_frame() is a list of SummaryEvent objects, contrary to the documentation and the needs of anyone trying to get the moment tensor solution for a single event. I suggest the code in this module should check to see if the passed objects are already DetailEvent objects before trying to convert them to DetailEvents.

As an additional suggestion: it might be nice if the function would accept a single DetailEvent object instead of requiring the user to put the object in a list of one item.

@johndwest johndwest added the bug label Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant