Skip to content

Add way to have utils.data functions w/ cache have their cache expire #1162

@eteq

Description

@eteq

Right now, the various functions in utils.data that have a cache option hold onto their cached copy of a download until the file is deleted. There are some use cases that require the cache expire after a certain time, and get re-downloaded (e.g. #1145).

So these functions (which all depend on download_file I believe), should allow cache to give a specific timeframe after which the file should be re-downloaded. This is pretty straightforward, but there is a question how best to define the expiration time. My instinct is to use stdlib datetime.datetime and datetime.timedelta objects, but an alternative might be astropy.time.Time and astropy.time.DeltaTime.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions