spacetelescope / jwebbinar_prep

56 stars 82 forks source link

FileExistsError #19

Open cslocum opened 3 years ago

cslocum commented 3 years ago

I'm getting this error while running jwebbinar_prep/pipeline_products_session/jwst-data-products-part1-solutions.ipynb

---------------------------------------------------------------------------
FileExistsError                           Traceback (most recent call last)
<ipython-input-5-5dd118496b0b> in <module>
     11 # Create local links to the cached copy - this is not necessary - you can use the `demo_file`/`demo_ex_file`
     12 # names directly.  But this is a convenient to see what you've downloaded and remind yourself laiter
---> 13 os.symlink(demo_file, uncal_obs)
     14 os.symlink(demo_ex_file, exercise_obs)

FileExistsError: [Errno 17] File exists: '/home/jovyan/.astropy/cache/download/url/97f84d7cd7e7d94a04d4b6526e51b301/contents' -> 'example_nircam_imaging_uncal.fits'

Maybe you can check to see if those symlinks already exist?

cslocum commented 3 years ago

image

cslocum commented 3 years ago

Also, note the typo (highlighted with cursor) in the screenshot above.

cslocum commented 3 years ago

I ran into a similar error with the jwebbinar_prep/pipeline_products_session/jwst-data-products-part2-solutions.ipynb notebook:

image

cslocum commented 3 years ago

And, another similar error in jwebbinar_prep/pipeline_products_session/jwst-data-products-part3-solutions.ipynb:

image

camipacifici commented 3 years ago

@eteq can you have a look at this one when you have a chance please?

bhilbert4 commented 3 years ago

@camipacifici @eteq I wrapped the download_file function in a function of my own that checks for the existence of the file before downloading. Maybe we just need to add something like this to these notebooks? https://github.com/bhilbert4/jwebbinar_prep/blob/imaging-mode/imaging_mode/imaging_mode_stage_1.ipynb

cslocum commented 3 years ago

Would it be worth adding a checksum check to make sure the files are actually the same?