ai2cm / fv3config

Manipulate FV3GFS run directories
Apache License 2.0
1 stars 0 forks source link

Add local caching to get_file operation #45

Closed mcgibbon closed 4 years ago

mcgibbon commented 4 years ago

This PR modifies get_file so that it caches remote files in the fv3config cache directory. Presently this is done with all files, and there isn't an API to disable it. Adding such an API would be fairly easy, but we'd need to come up with the design (easiest would be some kind of cache_downloads(True/False) routine).

Other small changes:

Tests have been added to check the location chosen to cache a file. The caching itself is untested because it requires remote url access, and might not be necessary because the function itself is quite simple (three lines).