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, aggregated_citation_file)[source]

Entrance method for building the aggregated citation file.

Parameters:
  • module_to_start_at (python module) – the top level module to figure out its citation file for
  • aggregated_citation_file (str) – file name of aggregated citation file
static locate_path_for_c_dependency(true_software_name)[source]
Parameters:true_software_name (str) –
Return type:str or None
class spinn_utilities.citation.CitationUpdaterAndDoiGenerator[source]

Bases: object

static convert_month_name_to_number(version_month)[source]

Convert a python month in text form to a number form.

Parameters:version_month (str or int) – the text form of the month
Returns:the month int value
Return type:int
Raises:Exception when the month name is not recognised
static convert_text_date_to_date(version_month, version_year, version_day)[source]

Convert the 3 components of a date into a CFF date.

Parameters:
  • version_month (str or int) – version month, in text form
  • version_year (int) – version year
  • version_day (int) – version day of month
Returns:

the string representation for the cff file

Return type:

str

update_citation_file_and_create_doi(citation_file_path, doi_title, create_doi, publish_doi, previous_doi, zenodo_access_token, module_path)[source]

Take a CITATION.cff file and updates the version and date-released fields, and rewrites the CITATION.cff file.

Parameters:
  • citation_file_path (str) – File path to the CITATION.cff file
  • create_doi (bool) – Whether to use Zenodo DOI interface to grab a DOI
  • zenodo_access_token (str) – Access token for Zenodo
  • publish_doi (bool) – Whether to publish the DOI on Zenodo
  • previous_doi (str) – DOI to append the created DOI to
  • doi_title (str) – Title for the created DOI
  • module_path (str) – Path to the module to zip up
  • update_version (bool) – Whether we should update the citation version
spinn_utilities.citation.generate_aggregate(arguments=None)[source]

Command-line tool to generate a single citation.cff from others.

Parameters:arguments (list(str)) –

Command line arguments.

  • --output_path: Where to write the aggregate file
  • --top_module: The module to start aggregating the citation.cffs from
  • --doi_title: The title of the DOI
  • --zenodo_access_token: The access token for Zenodo
  • --tools_doi: The DOI of the tools