punchbowl.data.history#

Attributes#

Classes#

History

Representation of the history of edits done to a PUNCHData object.

Module Contents#

punchbowl.data.history.HistoryEntry#
class punchbowl.data.history.History#

Representation of the history of edits done to a PUNCHData object.

_entries: list[HistoryEntry] = []#
add_entry(entry: HistoryEntry) None#

Add an entry to the History log.

Parameters:

entry (HistoryEntry) – A HistoryEntry object to add to the History log

Return type:

None

add_now(source: str, comment: str) None#

Add a new history entry at the current time.

Parameters:
  • source (str) – what module of the code the history entry originates from

  • comment (str) – a note of what the history comment means

Return type:

None

clear() None#

Clear all the history entries so the History is blank.

Return type:

None

__getitem__(index: int) HistoryEntry#

Given an index, return the requested HistoryEntry.

Parameters:

index (int) – numerical index of the history entry, increasing number typically indicates an older entry

Returns:

history at specified index

Return type:

HistoryEntry

most_recent() HistoryEntry#

Get the most recent HistoryEntry, i.e. the youngest.

Returns:

returns HistoryEntry that is the youngest

Return type:

HistoryEntry

__len__() int#

Get length.

__str__() str#

Format a string combining all the history entries.

Returns:

a combined record of the history entries

Return type:

str

__iter__() History#

Iterate.

__next__() HistoryEntry#

Get next.

__eq__(other: History) bool#

Check equality of two History objects.

classmethod from_fits_header(head: astropy.io.fits.Header) History#

Construct a history from a FITS header.

Parameters:

head (Header) – a FITS header to read from

Returns:

the history derived from a given FITS header

Return type:

History