desihub / desisurvey

Code for desi survey planning and implementation
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

survey simulations tutorial fails with AttributeError: 'Configuration' object has no attribute 'tiles_nogray' #148

Open forero opened 2 years ago

forero commented 2 years ago

While testing the survey_simulations notebook in the tutorials with kernel 22.2

https://github.com/desihub/tutorials/blob/ddd19ef4dae83c906d6c11659989f82f55e046ff/survey-simulations.ipynb

the following error arises

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_22331/2401195871.py in <module>
----> 1 tiles = desisurvey.tiles.get_tiles(tiles_file=tiles_file)

/global/common/software/desi/cori/desiconda/20211217-2.0.0/code/desisurvey/0.18.0/lib/python3.9/site-packages/desisurvey/tiles.py in get_tiles(tiles_file, use_cache, write_cache)
    429         log.debug('Using cached tiles for "{}".'.format(tiles_file))
    430     else:
--> 431         tiles = Tiles(tiles_file)
    432         log.info('Initialized tiles from "{}".'.format(tiles_file))
    433         for pname in tiles.programs:

/global/common/software/desi/cori/desiconda/20211217-2.0.0/code/desisurvey/0.18.0/lib/python3.9/site-packages/desisurvey/tiles.py in __init__(self, tiles_file)
     50     def __init__(self, tiles_file=None):
     51         config = desisurvey.config.Configuration()
---> 52         self.nogray = config.tiles_nogray()
     53         bright_allowed_in_dark = getattr(
     54             config, 'bright_allowed_in_dark', None)

AttributeError: 'Configuration' object has no attribute 'tiles_nogray'

what would be the correct fix to that?

schlafly commented 2 years ago

The issue is that the tutorial is using files from a surveysim run from 2018, and the format has changed somewhat since then. I've put a new run here: /global/cfs/cdirs/desi/survey/planning/surveysim-tutorial which may be more likely to work.

Sorry to be dense, but is the recommended way to test this to clone the tutorials repo, load it up in a NERSC juypyter session, and run the commands? I'm not sure I've ever actually used a tutorial before.