Skip to content

Commit

Permalink
Add more class docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Sep 24, 2023
1 parent f0fd5de commit 61165a7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
42 changes: 42 additions & 0 deletions tivars/types/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@


class GraphMode(Flags):
"""
Flags for GDB graph modes
"""

Dot = {0: 1}
Connected = {0: 0}
Simul = {1: 1}
Expand Down Expand Up @@ -42,6 +46,10 @@ class GraphMode(Flags):


class SeqMode(Flags):
"""
Flags for sequential GDB plot modes
"""

Time = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0}
Web = {0: 1, 1: 0, 2: 0, 3: 0, 4: 0}
VertWeb = {0: 0, 1: 1, 2: 0, 3: 0, 4: 0}
Expand All @@ -51,6 +59,10 @@ class SeqMode(Flags):


class GraphStyle(Enum):
"""
Enum of GDB graph styles
"""

SolidLine = b'\x00'
ThickLine = b'\x01'
ShadeAbove = b'\x02'
Expand All @@ -64,6 +76,10 @@ class GraphStyle(Enum):


class GraphColor(Enum):
"""
Enum of GDB graph colors
"""

Mono = b'\x00'
Blue = b'\x01'
Red = b'\x02'
Expand All @@ -87,6 +103,10 @@ class GraphColor(Enum):


class GlobalLineStyle(Enum):
"""
Enum of global GDB line styles
"""

Thick = b'\x00'
DotThick = b'\x01'
Thin = b'\x02'
Expand All @@ -97,6 +117,10 @@ class GlobalLineStyle(Enum):


class BorderColor(Enum):
"""
Enum of GDB graph border colors
"""

LtGray = b'\x01'
Teal = b'\x02'
LtBlue = b'\x03'
Expand All @@ -107,6 +131,10 @@ class BorderColor(Enum):


class EquationFlags(Flags):
"""
Flags for equations stored in GDBs
"""

Selected = {5: 1}
Deselected = {5: 0}
UsedForGraph = {6: 1}
Expand All @@ -116,6 +144,13 @@ class EquationFlags(Flags):


class TIGraphedEquation(TIEquation):
"""
Parser for equations stored in GDBs
A `TIGraphedEquation` is a `TIEquation` with an extra leading flag byte.
The equation's style and color in its GDB is bundled for convenience.
"""

min_data_length = 3

class Raw(TIEntry.Raw):
Expand Down Expand Up @@ -642,6 +677,13 @@ def coerce(self):


class TIGDB(TIMonoGDB):
"""
Base class for all color GDB entries
A GDB is a collection of equations and graph settings representing the state of one of the equation plotters.
A GDB can correspond to one of the Function, Parametric, Polar, or Sequence plotting modes.
"""

min_data_length = 66
has_color = True

Expand Down
8 changes: 8 additions & 0 deletions tivars/types/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def string(self) -> str:


class TIRealList(ListEntry, register=True):
"""
Parser for lists of real numbers
"""

_E = RealEntry

extensions = {
Expand All @@ -207,6 +211,10 @@ class TIRealList(ListEntry, register=True):


class TIComplexList(ListEntry, register=True):
"""
Parser for lists of complex numbers
"""

_E = ComplexEntry

extensions = {
Expand Down
2 changes: 1 addition & 1 deletion tivars/types/tokenized.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class TINewEquation(TIEquation, register=True):
"""
Parser for internal equations
A `TINewEquation` is simply a `TIEquation` with certain internal uses
A `TINewEquation` is simply a `TIEquation` with certain internal uses.
"""

_type_id = 0x0B
Expand Down

0 comments on commit 61165a7

Please sign in to comment.