glamod / glamod-ingest

Database preparation and ingestion for GLAMOD
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Add more meaningful names to output files returned as query responses #59

Closed agstephens closed 3 years ago

agstephens commented 3 years ago

Add more meaningful names in zip file and contents:

(surface-land|surface-marine)_(monthly|daily|sub-daily)_<start_date>_<end_date>_(global|subset)_csv-obs_<hash8>.csv
(surface-land|surface-marine)_(monthly|daily|sub-daily)_<start_date>_<end_date>_(global|subset)_data-policy_<hash8>.txt

Where: <hash8> is eight random characters that is derived from the process ID. Can use:

f'{os.getpid():05d}' + ''.join([str(random.randint(0, 9)) for _ in range(3)])
agstephens commented 3 years ago

Fixed in: https://github.com/glamod/cdm-lens/commit/9c2d9e5fc920f87363fa09c7e21e14ad2d8c231e