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

Report 'list' object has no attribute 'tolist' error and failed to write ss_info to SubSpace.db #26

Open
gnpang opened this issue Jan 3, 2016 · 4 comments
Labels

Comments

@gnpang
Copy link

gnpang commented Jan 3, 2016

When I run ss.detex with after ss.SVD(threshold =0.15), it failed to write the ss_info to the SubSpace.db and report error: 'list' object has no attribute 'tolist'. I check the code and it seems that the self.histSubSpace[sta][skey] will return a list not an array.
image
image
image
I run ss.detex before with the whole year continuous data and threshold in SVD is none, it worked well and didn't report this error. This time I run ss.detex just in April which station US.HILD has no continuous data in this month, the error occurred.
Now, I'm running ss.detex in the April data with threshold in SVD equal none and see if this error would occur again.

@d-chambers
Copy link
Owner

I will look into this. It is probably just a mater of explicitly casting the output of the previous function as a list or array, I am not sure at the moment. The ss_info table contains information of the processing (filters, decimation factors, data type etc.) but the detection info should have been written to the database. Can you initiate a SSResults instance on the database even though the ss_info table wasn't written or does that cause an error?

@gnpang
Copy link
Author

gnpang commented Jan 4, 2016

I tried threshold=None in SVD for April data for all five stations, it still reports this error. In these five stations, US.HLID has no continuous data in whole April.
image
Interesting thing is that I run another case just with MB.MOMT and MB.MCMT these two station, this error didn't show. Maybe the data-miss in US.HLID caused this error.
I still can create a SSResults instance but miss the ss_info, sg_info, ss_hist and sg_hist. I'll try running this without US.HLID to see if this error would occur again.
image

@gnpang
Copy link
Author

gnpang commented Jan 6, 2016

After I removed the US.HLID from StationKey, which has no continuous data in April, it worked well. It seems that it will return a list to ss_hist when some stations have no continuous data in the periods input to the detex.

@d-chambers d-chambers added the bug label Jan 6, 2016
@d-chambers
Copy link
Owner

For now I am going to wrap the json.dumps call in a try except until I get to writing automated tests for this part of detex. I will push the current (experimental) version of detex to the develop branch. It should fix many of the issues you were having, but of course there may still be some things to work out.

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

2 participants