Skip to content

Commit

Permalink
Add remaining class docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Sep 26, 2023
1 parent 2a6ef48 commit 8d6c9fa
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tivars/models/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@


class OsVersions(parse.OsVersions):
"""
Namespace containing useful OS versions
The maximal elements `OsVersions.INITIAL` and `OsVersions.LATEST` can be accessed via this namespace.
"""

MATHPRINT = TI_84P.OS("2.53")

ASMPRGM_DISABLED = TI_84PCE.OS("5.3.1")
Expand Down
6 changes: 6 additions & 0 deletions tivars/tokenizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def encode(string: str, trie: TokenTrie) -> tuple[bytes, OsVersion]:


class TokenizedString(String):
"""
Converter for data sections best interpreted as strings of tokens
Tokenization uses the TI-84+CE token sheet, which is backwards compatible for all var name tokens.
"""

_T = str

@classmethod
Expand Down
39 changes: 39 additions & 0 deletions tivars/types/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ class TIGraphedEquation(TIEquation):
min_data_length = 3

class Raw(TIEntry.Raw):
"""
Raw bytes container for `TIGraphedEquation`
The ``Raw`` container adds ``style`` and ``color`` fields for convenient manipulation of graphed equations.
These fields are stored in the container but do not contribute to the equation data section of a GDB.
"""

__slots__ = "meta_length", "type_id", "name", "version", "archived", "style", "color", "calc_data"

def __init__(self, init=None, *,
Expand Down Expand Up @@ -786,6 +793,10 @@ def coerce(self):


class TIMonoFuncGDB(TIMonoGDB):
"""
Parser for function GDBs
"""

mode_byte = 0x10

min_data_length = 110
Expand Down Expand Up @@ -902,6 +913,10 @@ def dict(self) -> dict:


class TIFuncGDB(TIGDB, TIMonoFuncGDB):
"""
Parser for function color GDBs
"""

min_data_length = 128

@Section()
Expand Down Expand Up @@ -932,6 +947,10 @@ def dict(self) -> dict:


class TIMonoParamGDB(TIMonoGDB):
"""
Parser for parametric GDBs
"""

mode_byte = 0x40

min_data_length = 130
Expand Down Expand Up @@ -1076,6 +1095,10 @@ def dict(self) -> dict:


class TIParamGDB(TIGDB, TIMonoParamGDB):
"""
Parser for parametric color GDBs
"""

min_data_length = 144

@Section()
Expand Down Expand Up @@ -1106,6 +1129,10 @@ def dict(self) -> dict:


class TIMonoPolarGDB(TIMonoGDB):
"""
Parser for polar GDBs
"""

mode_byte = 0x20

min_data_length = 112
Expand Down Expand Up @@ -1204,6 +1231,10 @@ def dict(self) -> dict:


class TIPolarGDB(TIGDB, TIMonoPolarGDB):
"""
Parser for polar color GDBs
"""

min_data_length = 126

@Section()
Expand Down Expand Up @@ -1234,6 +1265,10 @@ def dict(self) -> dict:


class TIMonoSeqGDB(TIMonoGDB):
"""
Parser for sequential GDBs
"""

mode_byte = 0x80

min_data_length = 163
Expand Down Expand Up @@ -1443,6 +1478,10 @@ def dict(self) -> dict:


class TISeqGDB(TIGDB, TIMonoSeqGDB):
"""
Parser for sequential color GDBs
"""

min_data_length = 174

@Section()
Expand Down
6 changes: 6 additions & 0 deletions tivars/types/picture.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ def array(self) -> list[list[pixel_type]]:

# Workaround until the token sheets are updated
class ImageName(TokenizedString):
"""
Converter for the name section of images
Image names can be ``Image1`` - ``Image0``, but are stored using a font offset rather than tokens.
"""

_T = str

@classmethod
Expand Down

0 comments on commit 8d6c9fa

Please sign in to comment.