spinn_utilities.citation package¶
Module contents¶
- class spinn_utilities.citation.CitationAggregator[source]¶
Bases:
object
Helper class for building a citation file which references all dependencies.
- create_aggregated_citation_file(module_to_start_at: ModuleType, aggregated_citation_file: str) None [source]¶
Entrance method for building the aggregated citation file.
- Parameters:
module_to_start_at – the top level module to figure out its citation file for
aggregated_citation_file – file name of aggregated citation file
- class spinn_utilities.citation.CitationUpdaterAndDoiGenerator[source]¶
Bases:
object
- static convert_month_name_to_number(version_month: int | str) int [source]¶
Convert a python month in text form to a number form.
- Parameters:
version_month – the text form of the month
- Returns:
the month int value
- Raises:
ValueError – when the month name is not recognised
- static convert_text_date_to_date(version_month: int | str, version_year: int | str, version_day: int | str) str [source]¶
Convert the 3 components of a date into a CFF date.
- Parameters:
version_month – version month, in text form
version_year – version year
version_day – version day of month
- Returns:
the string representation for the CFF file
- update_citation_file_and_create_doi(citation_file_path: str, doi_title: str, create_doi: bool, publish_doi: bool, previous_doi: str, zenodo_access_token: str, module_path: str) None [source]¶
Take a CITATION.cff file and updates the version and date-released fields, and rewrites the
CITATION.cff
file.- Parameters:
citation_file_path – File path to the
CITATION.cff
filecreate_doi – Whether to use Zenodo DOI interface to grab a DOI
zenodo_access_token – Access token for Zenodo
publish_doi – Whether to publish the DOI on Zenodo
previous_doi – DOI to append the created DOI to
doi_title – Title for the created DOI
module_path – Path to the module to zip up
update_version – Whether we should update the citation version