Maintainer tools
A detailed walk-through for maintainers can be found in the maintainer user guide.
Tools and routines for maintaining the PGD database.
append_reference_json(excel_file, sheet_name='References', ref_json=None, quiet=False)
Create/append to references.json from the Excel file.
References that are not assigned a PGD ID (and are thus empty) are ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
excel_file
|
Path
|
Path to the Excel file. |
required |
sheet_name
|
str
|
Name of the tab to use (default: References). |
'References'
|
ref_json
|
Path
|
Path to the |
None
|
quiet
|
bool
|
If True, just overwrite existing keys. If False, warn if a key already exists and ask user if it should be overwritten or not. |
False
|
Source code in pgdtools/maintainer/excel_tools.py
append_techniques_json(excel_file, sheet_name='Techniques', tech_json=None, quiet=False)
Create/append to techniques.json from the Excel file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
excel_file
|
Path
|
Path to the Excel file. |
required |
sheet_name
|
str
|
Name of the tab to use (default: Techniques). |
'Techniques'
|
tech_json
|
Path
|
Path to the |
None
|
quiet
|
bool
|
If True, just overwrite existing keys. If False, warn if a key already exists and ask user if it should be overwritten or not. |
False
|
Source code in pgdtools/maintainer/excel_tools.py
append_to_db_json(excel_file, doi, db_json=None, url=None, zenodo_record=None, db_name=None, sheet_name='VersionHistory')
Take the information from a given Excel database and adds it to db.json.
Information is read from the VersionHistory tab. From here the Date,
Grains, Change, and Known issues are read.
Currently, only releases on Zenodo are supported for SiC and Graphite grains.
If the DOI does not contain the word zenodo, it refers likely to another archive
(Astromat - IEDA) and the zenodo_record number is required.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
excel_file
|
Path
|
Path to the Excel file. |
required |
doi
|
str
|
DOI of the database. |
required |
db_json
|
Path
|
Path to the |
None
|
url
|
str
|
URL of the database. If not given, the default release location URL
is constructed by assuming that the filename is identical to Excel filename
but with the extension |
None
|
zenodo_record
|
str
|
Zenodo record number. This is required if the DOI is not a Zenodo DOI. Hover over the download link for the zenodo_record to get the record number. |
None
|
db_name
|
Name of the database. If not given, it is extracted from the filename. |
None
|
|
sheet_name
|
str
|
Name of the tab to use (default: VersionHistory). |
'VersionHistory'
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
(1) If the database is not a SiC or graphite database. (2) If the database is not released on Zenodo. |
FileNotFoundError
|
If the |
Source code in pgdtools/maintainer/excel_tools.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |