- sherpa.citation(version='current', filename=None, clobber=False)[source] [edit on github]
Return citatation information for Sherpa.
The citation information is taken from Zenodo 1, using the Sherpa “latest release” identifier 2, and so requires an internet connection. The message is displayed on screen, using pagination, or can be written to a file.
version (str, optional) – The version to retrieve the citation for. The supported values are limited to ‘current’, to return the citation for the installed version of Sherpa, ‘latest’ which will return the latest release, and the current set of releases available on Zenodo (this goes back to ‘4.8.0’).
filename (str or StringIO or None, optional) – If not None, write the output to the given file or filelike object.
clobber (bool, optional) – If filename is a string, then - when clobber is set - refuse to overwrite the file if it already exists.
If there is no internet connection, or there was a problem in downloading the data, or the Zenodo API has started to return different informatioon than expected, then the code will return information on why the call failed and other citation options.
Zenodo only lets you perform a limited number of calls in a set time span, so if you call this routine too many times then it may start to fail.
If a specific version is given then a hard-coded list of versions is checked, and if it matches then this information is used, rather than requiring a call to Zenodo.
Display the citation information for the current release on Zenodo. The information is paged to the display:
>>> import sherpa >>> sherpa.citation()
Write out the citation information for Sherpa 4.12.1 to the file
>>> sherpa.citation('4.12.1', outfile='cite.txt')
Display the information for the latest release: