Closed allenos-usgs closed 1 year ago
thanks @allenos-usgs. I'll look into this next week and see what the issue is loading historical catalogs.
@allenos-usgs can you upload the catalog that you are having this problem with. @pabloitu tested this out inline and the epoch times just returned negative numbers. this was done in-line, so it might have something to do with the reader. in the mean time I will create a test catalog and try and reproduce.
Sure thing, here's the catalog. csep_test_cat2.csv
Hi @allenos-usgs Sorry for the delay. I've checked the issue and can't reproduce the error in the latest version or the pycsep conda version.
The issue has to do with windows handling datetimes different than osx or unix (e.g. https://github.com/python/cpython/issues/82414) , which does not support negative timestamps.
We need to set up a bypass in our csep time functions for windows users. Thank you for catching this error!
p.s. In the meantime, I'm attaching your catalog in JSON version csep_test_cat2.zip, which has the timestamps instead of datetimes. It can be loaded as
import csep
catalog = csep.core.catalogs.CSEPCatalog.load_json('csep_test_cat2.json')
Hi @pabloitu , thanks for looking into it. I tried to work with the JSON version of the catalog that you sent, but I seem to be having a similar sort of problem when I try to load the catalog. Here's the traceback:
Perhaps the same sort of windows issue?
yes, was the same bug :(! but fixed it in #230 , we need a short review and try to commit to main as quick as possible.
This should now be fixed, with latest merge of #230 into the main branch.
I've been having problems loading in a csv catalog that goes back to the year 1700.
I've been loading it in like so:
Then I get the following traceback:
I think I've traced the issue to this function in time_utils.py, which seems to have a baseline of 1970:
Because if I trim my test catalog so that it starts in 1970 instead of 1700, then it's able to be loaded in no problem. And if I go back to using the entire catalog, but in the function I change 1970 to 1700, then I get the following:
It loads in the entire catalog, but now it seems to think it starts in 1970 and ends ~270 years in the future. Any help with getting it to read in the entire catalog with the correct years would be much appreciated!
Thanks, Andrea