astropy 5.0

ParametersRaises
check_download_cache(pkgname='astropy')
note

Since v5.0, this function no longer returns anything.

Because the cache is shared by all versions of astropy in all virtualenvs run by your user, possibly concurrently, it could accumulate problems. This could lead to hard-to-debug problems or wasted space. This function detects a number of incorrect conditions, including nonexistent files that are indexed, files that are indexed but in the wrong place, and, if you request it, files whose content does not match the hash that is indexed.

This function also returns a list of non-indexed files. A few will be associated with the shelve object; their exact names depend on the backend used but will probably be based on urlmap . The presence of other files probably indicates that something has gone wrong and inaccessible files have accumulated in the cache. These can be removed with clear_download_cache , either passing the filename returned here, or with no arguments to empty the entire cache and return it to a reasonable, if empty, state.

Parameters

pkgname : str, optional

The package name to use to locate the download cache, i.e., for pkgname='astropy' the default cache location is ~/.astropy/cache .

Raises

`~astropy.utils.data.CacheDamaged`

To indicate a problem with the cache contents; the exception contains a .bad_files attribute containing a set of filenames to allow the user to use clear_download_cache to remove the offending items.

OSError, RuntimeError

To indicate some problem with the cache structure. This may need a full clear_download_cache to resolve, or may indicate some kind of misconfiguration.

Do a consistency check on the cache.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /astropy/utils/data.py#1762
type: <class 'function'>
Commit: