-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
123 changed files
with
9,688 additions
and
4,839 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
punchbowl.data.history | ||
====================== | ||
|
||
.. py:module:: punchbowl.data.history | ||
Attributes | ||
---------- | ||
|
||
.. autoapisummary:: | ||
|
||
punchbowl.data.history.HistoryEntry | ||
|
||
|
||
Classes | ||
------- | ||
|
||
.. autoapisummary:: | ||
|
||
punchbowl.data.history.History | ||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
.. py:data:: HistoryEntry | ||
.. py:class:: History | ||
Representation of the history of edits done to a PUNCHData object. | ||
|
||
|
||
.. py:attribute:: _entries | ||
:type: list[HistoryEntry] | ||
:value: [] | ||
|
||
|
||
|
||
.. py:method:: add_entry(entry: HistoryEntry) -> None | ||
Add an entry to the History log. | ||
|
||
:param entry: A HistoryEntry object to add to the History log | ||
:type entry: HistoryEntry | ||
|
||
:rtype: None | ||
|
||
|
||
|
||
.. py:method:: add_now(source: str, comment: str) -> None | ||
Add a new history entry at the current time. | ||
|
||
:param source: what module of the code the history entry originates from | ||
:type source: str | ||
:param comment: a note of what the history comment means | ||
:type comment: str | ||
|
||
:rtype: None | ||
|
||
|
||
|
||
.. py:method:: clear() -> None | ||
Clear all the history entries so the History is blank. | ||
|
||
:rtype: None | ||
|
||
|
||
|
||
.. py:method:: __getitem__(index: int) -> HistoryEntry | ||
Given an index, return the requested HistoryEntry. | ||
|
||
:param index: numerical index of the history entry, increasing number typically indicates an older entry | ||
:type index: int | ||
|
||
:returns: history at specified `index` | ||
:rtype: HistoryEntry | ||
|
||
|
||
|
||
.. py:method:: most_recent() -> HistoryEntry | ||
Get the most recent HistoryEntry, i.e. the youngest. | ||
|
||
:returns: returns HistoryEntry that is the youngest | ||
:rtype: HistoryEntry | ||
|
||
|
||
|
||
.. py:method:: __len__() -> int | ||
Get length. | ||
|
||
|
||
|
||
.. py:method:: __str__() -> str | ||
Format a string combining all the history entries. | ||
|
||
:returns: a combined record of the history entries | ||
:rtype: str | ||
|
||
|
||
|
||
.. py:method:: __iter__() -> History | ||
Iterate. | ||
|
||
|
||
|
||
.. py:method:: __next__() -> HistoryEntry | ||
Get next. | ||
|
||
|
||
|
||
.. py:method:: __eq__(other: History) -> bool | ||
Check equality of two History objects. | ||
|
||
|
||
|
||
.. py:method:: from_fits_header(head: astropy.io.fits.Header) -> History | ||
:classmethod: | ||
|
||
|
||
Construct a history from a FITS header. | ||
|
||
:param head: a FITS header to read from | ||
:type head: Header | ||
|
||
:returns: the history derived from a given FITS header | ||
:rtype: History | ||
|
||
|
||
|
Oops, something went wrong.