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. |
MaintainerWarning ¶
Bases: UserWarning
Base class for warnings that are almost exclusively relevant for ACL Anthology maintainers, and should be hidden to end users of the library by default.
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: MaintainerWarning
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.json.
This can happen when an <author> or <editor> is used with an ID which was not defined in people.json; when the name used together with this ID was not listed among the possible names in people.json; or when the ORCID used together with this ID does not match the ORCID defined in people.json.
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.
TeXParserWarning ¶
TeXParserWarning(code, message)
Bases: MaintainerWarning
Raised when the TeX parsing routines encounter input they cannot handle.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
The TeX command that raised the problem. We currently use both TexSoup and pylatexenc in different parts of the library, so the type of this object depends on which part raised the warning. |
suppress_maintainer_warnings ¶
suppress_maintainer_warnings(flag_or_names)
Suppress or re-enable MaintainerWarnings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg
|
If True, suppresses all warnings. If False, (re-)enables them. If given a list of warnings, will (re-)enable all except the given ones. |
required |