The keyword expansion API (or lack of it) came about as a result of adding new expansions one by one as required. Let’s change that to a pattern where adding a new expansion means defining it as an instance of an expansion class and adding it to the list of desired expansions.
Addition of a <> to many keywords, used as escape characters to recognise expansion candidates
Addition of the ExpansionIndex dataclass and the expand_schema method to provide an API that defines a collection of valid expansions and performs them
Modification of existing unit tests and new tests for the expansion API
Removal of old methods that supported the expansion of FITS keywords
The new expansion API can handle single or multi character index definitions, zero-padded expansion into a size that is different from the index, and multiple expansions within a single keyword.
It also ensures that the resulting keywords are 8 characters or less (by FITS convention) and that there cannot be an expansion that takes up more characters than the given size.
The keyword expansion API (or lack of it) came about as a result of adding new expansions one by one as required. Let’s change that to a pattern where adding a new expansion means defining it as an instance of an expansion class and adding it to the list of desired expansions.
Addition of a
<>
to many keywords, used as escape characters to recognise expansion candidatesAddition of the
ExpansionIndex
dataclass and theexpand_schema
method to provide an API that defines a collection of valid expansions and performs themModification of existing unit tests and new tests for the expansion API
Removal of old methods that supported the expansion of FITS keywords
The new expansion API can handle single or multi character
index
definitions, zero-padded expansion into asize
that is different from theindex
, and multiple expansions within a single keyword.It also ensures that the resulting keywords are 8 characters or less (by FITS convention) and that there cannot be an expansion that takes up more characters than the given
size
.