LSSTDESC / rail

Top level "umbrella" package for RAIL
MIT License
5 stars 3 forks source link

Saving output to a separate path in dsps demo notebook #145

Open hangqianjun opened 1 month ago

hangqianjun commented 1 month ago

Bug report

This bug occurs when we try to run dsps notebook on nersc environment desc-python-bleed. The output data is trying to write into the conda installation area even if a global outdir is given. Below is a copy of the error report:

OSError                                   Traceback (most recent call last)
Cell In[3], line 16
     13 stellar_metallicity = np.full(n_galaxies, gal_lgmet)
     14 stellar_metallicity_scatter = np.full(n_galaxies, gal_lgmet_scatter)
---> 16 with h5py.File(trainFile, 'w') as h5table:
     17     h5table.create_dataset(name='redshifts', data=redshift)
     18     h5table.create_dataset(name='cosmic_time_grid', data=cosmic_time_grid)

File /opt/desc/py/lib/python3.10/site-packages/h5py/_hl/files.py:562, in File.__init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, fs_page_size, page_buf_size, min_meta_keep, min_raw_keep, locking, alignment_threshold, alignment_interval, meta_block_size, **kwds)
    553     fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0,
    554                      locking, page_buf_size, min_meta_keep, min_raw_keep,
    555                      alignment_threshold=alignment_threshold,
    556                      alignment_interval=alignment_interval,
    557                      meta_block_size=meta_block_size,
    558                      **kwds)
    559     fcpl = make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
    560                      fs_persist=fs_persist, fs_threshold=fs_threshold,
    561                      fs_page_size=fs_page_size)
--> 562     fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
    564 if isinstance(libver, tuple):
    565     self._libver = libver

File /opt/desc/py/lib/python3.10/site-packages/h5py/_hl/files.py:241, in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
    239     fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl)
    240 elif mode == 'w':
--> 241     fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
    242 elif mode == 'a':
    243     # Open in append mode (read/write).
    244     # If that fails, create a new file only if it won't clobber an
    245     # existing one (ACC_EXCL)
    246     try:

File h5py/_objects.pyx:54, in h5py._objects.with_phil.wrapper()

File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()

File h5py/h5f.pyx:122, in h5py.h5f.create()

OSError: [Errno 30] Unable to synchronously create file (unable to open file: name = '/opt/desc/py/lib/python3.10/sitepackages/rail/examples_data/creation_data/data/dsps_default_data/input_galaxy_properties_dsps.hdf5',

Before submitting Please check the following: