LSSTDESC / RESSPECT

The RESSPECT project is a result from an inter-collaboration agreement established between the Cosmostatistics Initiative (COIN) and the LSST Dark Energy Science Collaboration (DESC) with the goal of developing a recommendation system for telescope resource allocation able to optimize photometric supernova cosmology anaylsis.
MIT License
1 stars 0 forks source link

fetch_example_data will fail with error when using RESSPECT installed from PyPI #33

Closed drewoldag closed 1 month ago

drewoldag commented 2 months ago

To reproduce:

  1. Create new environment
  2. pip install resspect
  3. Run fetch_example_data
  4. See error

Data unpacked into directory: /Users/drew/Library/Caches/resspect/SIMGEN_PUBLIC_DES Traceback (most recent call last): File "/Users/drew/opt/miniconda3/envs/scratch/bin/fetch_example_data", line 8, in sys.exit(fetch_example_data()) File "/Users/drew/opt/miniconda3/envs/scratch/lib/python3.10/site-packages/resspect/scripts/fetch_example_data.py", line 36, in fetch_example_data os.symlink(original_directory, target_dir, target_is_directory=True) FileNotFoundError: [Errno 2] No such file or directory: '/Users/drew/Library/Caches/resspect/SIMGEN_PUBLIC_DES' -> '/Users/drew/opt/miniconda3/envs/scratch/lib/python3.10/data/SIMGEN_PUBLIC_DES'

drewoldag commented 2 months ago

I believe that I would advocate for the fix where we update the various locations that are hard coded to look for .../data/SIMGEN_PUBLIC_DES and replace those with the dynamically generated <user_cache>/resspect/SIMGEN_PUBLIC_DES.

And if that programmatically defined directory is not found, then prompt the user to run fetch_example_data.

drewoldag commented 1 month ago

It seems like most of the places where we're looking for the hardcoded directory is in the documentation actually. There is one place in build_cannondical_snpcc.py that defines data_dir = '~/data/...', so we would need to update that as well.