Closed spencerkclark closed 2 years ago
Couple things. 1) fv3config.load
should be used instead of yaml.safe_load
although I doubt this is causing your problem. 2) I'll try to reproduce the problem. In the mean time, did you try rm
ing that directory and trying again?
I was able to reproduce with fsspec==2022.5.0 and using write_run_directory
(which uses fv3config.load
under the hood), so that eliminates #1.
Sorry I'm stuck in old ways...I agree though I'm using the default diag_table
which is not a dictionary, so fv3config.load
should be equivalent to yaml.safe_load
.
I did try removing the directory and ended up with the same result. I was also surprised that the location of the cache directory changed -- I normally have it set to a different location using the FV3CONFIG_CACHE_DIR
environment variable.
Ok. I'll look into it. I was just modifying this code. Are you saying that FV3CONFIG_CACHE_DIR
is not being used?
@mcgibbon What do you think about using https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.implementations.cached.SimpleCacheFileSystem instead of rolling our own caching layer? Their solution may be more robust and integrate better with fsspec. Would be a one-liner to use it and then delete all our own caching.
Thanks!
Are you saying that
FV3CONFIG_CACHE_DIR
is not being used?
Yes, that is what it seems like.
ok. that seems like an orthogonal bug. To the original bug, it seems like some of the parent directories are being created as files rather than directories:
$ file /home/noahb/.cache/fv3gfs/fv3config-cache/rel/gs/vcm-fv3config/data/initial_conditions/gfs_c12_example/v1.0
/home/noahb/.cache/fv3gfs/fv3config-cache/rel/gs/vcm-fv3config/data/initial_conditions/gfs_c12_example/v1.0: empty
More debugging: there appear to "assets" without source_name
:
(Pdb) p asset_list[0]
{'source_location': 'gs://vcm-fv3config/data/initial_conditions/gfs_c12_example/v1.0', 'source_name': '', 'target_location': 'INPUT/', 'target_name': '', 'copy_method': 'copy'}
(Pdb) p asset_list[1]
{'source_location': 'gs://vcm-fv3config/data/initial_conditions/gfs_c12_example/v1.0', 'source_name': 'gfs_ctrl.nc', 'target_location': 'INPUT/', 'target_name': 'gfs_ctrl.nc', 'copy_method': 'copy'}
When I try to create a run directory using this config with the development version of fv3config, I get this error message:
In the past, writing a run directory with this config would work.