hpc4cmb / toast

Time Ordered Astrophysics Scalable Tools
Other
44 stars 39 forks source link

Missing import in schedule.py #623

Closed mhasself closed 1 year ago

mhasself commented 1 year ago

On version '3.0.0a9', schedule.py imports dateutil but not dateutil.parser.

import toast.schedule
schedule = toast.schedule.GroundSchedule()
schedule.read('jupiter.txt')

fails with AttributeError: module 'dateutil' has no attribute 'parser'

But this works great:

import dateutil.parser
import toast.schedule
schedule = toast.schedule.GroundSchedule()
schedule.read('jupiter.txt')
tskisner commented 1 year ago

Hi @mhasself , just confirming that this is using the wheel of 3.0.0a9? I don't see a problem locally with toast installed with conda compilers:

$ python
Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:26:04) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import toast.schedule
>>> 

And I see that import in schedule.py. I will test if there is problem with the wheel.

mhasself commented 1 year ago

Yes it's the wheel. The error occurs on schedule.read(), not on the import.

In schedule.py, you need import dateutil.parser, not just import dateutil. I don't see that in a7140ee3, the current HEAD of toast3 branch.

tskisner commented 1 year ago

Got it- yes it looks like somehow that import got removed between master and toast3 branches. I'm not sure why we haven't seen that problem until now, but I'll fix it.

tskisner commented 1 year ago

Hopefully fixed in trivial PR #624.

tskisner commented 1 year ago

I'll leave this open until the next tag and wheel confirms the fix.

mhasself commented 1 year ago

Thanks!

keskitalo commented 1 year ago

Closing a resolved issue.