astropy 5.0

ParametersReturnsBackRef
compute_hash(localfn)

The hash for a data file is used for looking up data files in a unique fashion. This is of particular use for tests; a test may require a particular version of a particular file, in which case it can be accessed via hash to get the appropriate version.

Typically, if you wish to write a test that requires a particular data file, you will want to submit that file to the astropy data servers, and use e.g. get_pkg_data_filename('hash/34c33b3eb0d56eb9462003af249eff28') , but with the hash for your file in place of the hash in the example.

Parameters

localfn : str

The path to the file for which the hash should be generated.

Returns

hash : str

The hex digest of the cryptographic hash for the contents of the localfn file.

Computes the MD5 hash for a file.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

astropy.utils.data.get_pkg_data_contents

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#858
type: <class 'function'>
Commit: