exceptions¶
AnthologyDuplicateIDError ¶
AnthologyDuplicateIDError(value, message)
Bases: AnthologyException, ValueError
Raised when trying to set an ID or create an item with an ID that already exists.
Attributes:
| Name | Type | Description |
|---|---|---|
value |
The value that raised the error. Can be any unique identifier, e.g. an Anthology ID, or a bibkey. |
AnthologyException ¶
AnthologyException(msg)
AnthologyInvalidIDError ¶
AnthologyInvalidIDError(value, message)
Bases: AnthologyException, ValueError
Raised when a function gets an ID that is not a valid Anthology ID, or not valid in the given context (e.g. a full ID where only a paper ID was expected).
Attributes:
| Name | Type | Description |
|---|---|---|
value |
The value that raised the error. |
AnthologyXMLError ¶
AnthologyXMLError(parent, tag, message)
Bases: AnthologyException, ValueError
Raised when an unsupported tag is encountered while parsing an Anthology XML file.
Attributes:
| Name | Type | Description |
|---|---|---|
parent |
AnthologyIDTuple
|
The Anthology ID of the parent object in which the error occurred. |
tag |
str
|
The name of the unsupported tag. |
ChecksumMismatchWarning ¶
ChecksumMismatchWarning(file)
Bases: UserWarning
Raised when a file's checksum doesn't match the checksum in the Anthology data files.
Attributes:
| Name | Type | Description |
|---|---|---|
file |
FileReference
|
The file reference that caused the mismatch. |
NameSpecResolutionError ¶
NameSpecResolutionError(name_spec, message)
Bases: AnthologyException
Raised when a NameSpecification cannot be resolved to a person.
This can happen when a NameSpecification would be resolved to the same person as another NameSpecification on the same item. It might also happen if a NameSpecification is manually created (and e.g. uses an ID that is not defined).
Attributes:
| Name | Type | Description |
|---|---|---|
name_spec |
NameSpecification
|
The name specification that raised the error. |
NameSpecResolutionWarning ¶
NameSpecResolutionWarning(name_spec, message)
Bases: UserWarning
Same as NameSpecResolutionError, but for less critical issues that shouldn't be blockers.
This can happen when a NameSpecification would be resolved to the same person as another NameSpecification on the same item, but the person is implicit (unverified).
Attributes:
| Name | Type | Description |
|---|---|---|
name_spec |
NameSpecification
|
The name specification that raised the error. |
PersonDefinitionError ¶
PersonDefinitionError(name_spec, message)
Bases: NameSpecResolutionError
Raised when a NameSpecification defines an ID, but either the ID or one of its fields is not compatible with the definition in people.yaml.
This can happen when an <author> or <editor> is used with an ID which was not defined in people.yaml; when the name used together with this ID was not listed among the possible names in people.yaml; or when the ORCID used together with this ID does not match the ORCID defined in people.yaml.
Attributes:
| Name | Type | Description |
|---|---|---|
name_spec |
NameSpecification
|
The name specification that raised the error. |
SchemaMismatchWarning ¶
SchemaMismatchWarning()
Bases: UserWarning
Raised when the data directory contains a different XML schema as this library.
This typically means that either:
- The data directory is outdated, and needs to be synced with the official Anthology data.
- This library needs to be updated.