From 54076420bfb51bfaf076c0190ecc49fc0a9afe60 Mon Sep 17 00:00:00 2001 From: Fabian Diet Date: Sun, 2 Jun 2024 10:37:54 +0200 Subject: [PATCH] Add more autodoc --- docs/alarms.rst | 30 +++++++ docs/algorithms.rst | 61 ++++++++++++++ docs/ancillary.rst | 15 ++++ docs/calibrators.rst | 22 +++++ docs/commands.rst | 104 ++++++++++++++++++++++++ docs/conf.py | 4 +- docs/containers.rst | 19 +++++ docs/datatypes.rst | 156 ++++++++++++++++++++++++++++++++++++ docs/encodings.rst | 151 ++++++++++++++++++++++++++-------- docs/exceptions.rst | 8 ++ docs/expressions.rst | 28 +++++++ docs/index.rst | 8 +- docs/parameters.rst | 37 +++------ docs/reference/index.rst | 11 --- docs/systems.rst | 12 +++ docs/verifiers.rst | 93 +++++++++++++++++++++ examples/ccsds.xml | 10 ++- src/yamcs/pymdb/commands.py | 4 +- 18 files changed, 697 insertions(+), 76 deletions(-) create mode 100644 docs/alarms.rst create mode 100644 docs/ancillary.rst create mode 100644 docs/calibrators.rst create mode 100644 docs/datatypes.rst create mode 100644 docs/exceptions.rst create mode 100644 docs/expressions.rst delete mode 100644 docs/reference/index.rst create mode 100644 docs/verifiers.rst diff --git a/docs/alarms.rst b/docs/alarms.rst new file mode 100644 index 0000000..35a29de --- /dev/null +++ b/docs/alarms.rst @@ -0,0 +1,30 @@ +Alarms +====== + +AlarmLevel +---------- + +.. autoclass:: yamcs.pymdb.AlarmLevel + :members: + :member-order: bysource + + +Alarm +----- + +.. autoclass:: yamcs.pymdb.Alarm + :members: + + +EnumerationAlarm +---------------- + +.. autoclass:: yamcs.pymdb.EnumerationAlarm + :members: + + +ThresholdAlarm +-------------- + +.. autoclass:: yamcs.pymdb.ThresholdAlarm + :members: diff --git a/docs/algorithms.rst b/docs/algorithms.rst index 9a30c22..e460f81 100644 --- a/docs/algorithms.rst +++ b/docs/algorithms.rst @@ -1,3 +1,64 @@ Algorithms ========== +Algorithm +--------- + +.. autoclass:: yamcs.pymdb.Algorithm + :members: + + +InputParameter +-------------- + +.. autoclass:: yamcs.pymdb.InputParameter + :members: + + +OutputParameter +--------------- + +.. autoclass:: yamcs.pymdb.OutputParameter + :members: + + +Trigger +------- + +.. autoclass:: yamcs.pymdb.Trigger + :members: + + +ParameterTrigger +---------------- + +.. autoclass:: yamcs.pymdb.ParameterTrigger + :members: + + +ContainerTrigger +---------------- + +.. autoclass:: yamcs.pymdb.ContainerTrigger + :members: + + +UnnamedAlgorithm +---------------- + +.. autoclass:: yamcs.pymdb.UnnamedAlgorithm + :members: + + +UnnamedJavaAlgorithm +-------------------- + +.. autoclass:: yamcs.pymdb.UnnamedJavaAlgorithm + :members: + + +UnnamedJavaScriptAlgorithm +-------------------------- + +.. autoclass:: yamcs.pymdb.UnnamedJavaScriptAlgorithm + :members: diff --git a/docs/ancillary.rst b/docs/ancillary.rst new file mode 100644 index 0000000..e765e11 --- /dev/null +++ b/docs/ancillary.rst @@ -0,0 +1,15 @@ +Ancillary +========= + +AncillaryData +------------- + +.. autoclass:: yamcs.pymdb.AncillaryData + :members: + + +AncillaryDataItem +----------------- + +.. autoclass:: yamcs.pymdb.AncillaryDataItem + :members: diff --git a/docs/calibrators.rst b/docs/calibrators.rst new file mode 100644 index 0000000..0174901 --- /dev/null +++ b/docs/calibrators.rst @@ -0,0 +1,22 @@ +Calibrators +=========== + +Calibrator +---------- + +.. autoclass:: yamcs.pymdb.Calibrator + :members: + + +Polynomial +---------- + +.. autoclass:: yamcs.pymdb.Polynomial + :members: + + +Interpolate +----------- + +.. autoclass:: yamcs.pymdb.Interpolate + :members: diff --git a/docs/commands.rst b/docs/commands.rst index c96b6fe..7895847 100644 --- a/docs/commands.rst +++ b/docs/commands.rst @@ -1,3 +1,107 @@ Commands ======== +Command +------- + +.. autoclass:: yamcs.pymdb.Command + :members: + + +CommandLevel +------------ + +.. autoclass:: yamcs.pymdb.CommandLevel + :members: + :member-order: bysource + + +Argument +-------- + +.. autoclass:: yamcs.pymdb.Argument + :members: + + +AbsoluteTimeArgument +-------------------- + +.. autoclass:: yamcs.pymdb.AbsoluteTimeArgument + :members: + + +AggregateArgument +----------------- + +.. autoclass:: yamcs.pymdb.AggregateArgument + :members: + + +ArrayArgument +------------- + +.. autoclass:: yamcs.pymdb.ArrayArgument + :members: + + +BinartyArgument +--------------- + +.. autoclass:: yamcs.pymdb.BinaryArgument + :members: + + +BooleanArgument +--------------- + +.. autoclass:: yamcs.pymdb.BooleanArgument + :members: + + +EnumeratedArgument +------------------ + +.. autoclass:: yamcs.pymdb.EnumeratedArgument + :members: + + +FloatArgument +------------- + +.. autoclass:: yamcs.pymdb.FloatArgument + :members: + + +IntegerArgument +------------------ + +.. autoclass:: yamcs.pymdb.IntegerArgument + :members: + + +StringArgument +-------------- + +.. autoclass:: yamcs.pymdb.StringArgument + :members: + + +ArgumentEntry +------------- + +.. autoclass:: yamcs.pymdb.ArgumentEntry + :members: + + +FixedValueEntry +--------------- + +.. autoclass:: yamcs.pymdb.FixedValueEntry + :members: + + +TransmissionConstraint +---------------------- + +.. autoclass:: yamcs.pymdb.TransmissionConstraint + :members: diff --git a/docs/conf.py b/docs/conf.py index fa501cc..99845f9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ latex_documents = [ ( master_doc, - "pymdb.tex", + f"python-yamcs-pymdb-{release}.tex", "Yamcs PyMDB", "Space Applications Services", "manual", @@ -56,6 +56,8 @@ autoclass_content = "both" autodoc_class_signature = "separated" +autodoc_typehints_format = "short" +python_use_unqualified_type_names = True autodoc_default_options = { # "member-order": "bysource", "undoc-members": True, diff --git a/docs/containers.rst b/docs/containers.rst index c488f59..8d425cb 100644 --- a/docs/containers.rst +++ b/docs/containers.rst @@ -1,3 +1,22 @@ Containers ========== +Container +--------- + +.. autoclass:: yamcs.pymdb.Container + :members: + + +ParameterEntry +-------------- + +.. autoclass:: yamcs.pymdb.ParameterEntry + :members: + + +ContainerEntry +-------------- + +.. autoclass:: yamcs.pymdb.ContainerEntry + :members: diff --git a/docs/datatypes.rst b/docs/datatypes.rst new file mode 100644 index 0000000..042cdb2 --- /dev/null +++ b/docs/datatypes.rst @@ -0,0 +1,156 @@ +Data Types +========== + +Epoch +----- + +.. autoclass:: yamcs.pymdb.Epoch + :members: + :member-order: bysource + + +DynamicInteger +-------------- + +.. autoclass:: yamcs.pymdb.DynamicInteger + :members: + + +DataType +-------- + +.. autoclass:: yamcs.pymdb.DataType + :members: + + +AbsoluteTimeDataType +-------------------- + +.. autoclass:: yamcs.pymdb.AbsoluteTimeDataType + :members: + + +AggregateDataType +----------------- + +.. autoclass:: yamcs.pymdb.AggregateDataType + :members: + + +ArrayDataType +------------- + +.. autoclass:: yamcs.pymdb.ArrayDataType + :members: + + +BinaryDataType +-------------- + +.. autoclass:: yamcs.pymdb.BinaryDataType + :members: + + +BooleanDataType +--------------- + +.. autoclass:: yamcs.pymdb.BooleanDataType + :members: + + +EnumeratedDataType +------------------ + +.. autoclass:: yamcs.pymdb.EnumeratedDataType + :members: + + +FloatDataType +------------- + +.. autoclass:: yamcs.pymdb.FloatDataType + :members: + + +IntegerDataType +--------------- + +.. autoclass:: yamcs.pymdb.IntegerDataType + :members: + + +StringDataType +-------------- + +.. autoclass:: yamcs.pymdb.StringDataType + :members: + + +Member +------ + +.. autoclass:: yamcs.pymdb.Member + :members: + + +AbsoluteTimeMember +------------------ + +.. autoclass:: yamcs.pymdb.AbsoluteTimeMember + :members: + + +AggregateMember +--------------- + +.. autoclass:: yamcs.pymdb.AggregateMember + :members: + + +ArrayMember +----------- + +.. autoclass:: yamcs.pymdb.ArrayMember + :members: + + +BinaryMember +------------ + +.. autoclass:: yamcs.pymdb.BinaryMember + :members: + + +BooleanMember +------------- + +.. autoclass:: yamcs.pymdb.BooleanMember + :members: + + +EnumeratedMember +---------------- + +.. autoclass:: yamcs.pymdb.EnumeratedMember + :members: + + +FloatMember +----------- + +.. autoclass:: yamcs.pymdb.FloatMember + :members: + + +IntegerMember +------------- + +.. autoclass:: yamcs.pymdb.IntegerMember + :members: + + +StringMember +------------ + +.. autoclass:: yamcs.pymdb.StringMember + :members: diff --git a/docs/encodings.rst b/docs/encodings.rst index 9276999..ba59fdb 100644 --- a/docs/encodings.rst +++ b/docs/encodings.rst @@ -1,110 +1,193 @@ Encodings ========= +Charset +------- + +.. autoclass:: yamcs.pymdb.Charset + :members: + :member-order: bysource + + +FloatEncodingScheme +------------------- + +.. autoclass:: yamcs.pymdb.FloatEncodingScheme + :members: + :member-order: bysource + + +IntegerEncodingScheme +--------------------- + +.. autoclass:: yamcs.pymdb.IntegerEncodingScheme + :members: + :member-order: bysource + + +Encoding +-------- + +.. autoclass:: yamcs.pymdb.Encoding + :members: + + +BinaryEncoding +-------------- + +.. autoclass:: yamcs.pymdb.BinaryEncoding + :members: + + +IntegerEncoding +--------------- + +.. autoclass:: yamcs.pymdb.IntegerEncoding + :members: + + +FloatEncoding +------------- + +.. autoclass:: yamcs.pymdb.FloatEncoding + :members: + + +FloatTimeEncoding +----------------- + +.. autoclass:: yamcs.pymdb.FloatTimeEncoding + :members: + + +IntegerTimeEncoding +------------------- + +.. autoclass:: yamcs.pymdb.IntegerTimeEncoding + :members: + + +StringEncoding +-------------- + +.. autoclass:: yamcs.pymdb.StringEncoding + :members: + + +Common encodings +---------------- + The ``encodings`` module contains reusable data encodings. These are optional to use as you can create entirely custom data encodings. Unsigned integers ------------------ +~~~~~~~~~~~~~~~~~ -.. autoattribute:: yamcs.pymdb.encodings.uint1_t +.. autoattribute:: yamcs.pymdb.uint1_t :annotation: unsigned 1-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint2_t +.. autoattribute:: yamcs.pymdb.uint2_t :annotation: unsigned 2-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint3_t +.. autoattribute:: yamcs.pymdb.uint3_t :annotation: unsigned 3-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint4_t +.. autoattribute:: yamcs.pymdb.uint4_t :annotation: unsigned 4-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint5_t +.. autoattribute:: yamcs.pymdb.uint5_t :annotation: unsigned 5-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint6_t +.. autoattribute:: yamcs.pymdb.uint6_t :annotation: unsigned 6-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint7_t +.. autoattribute:: yamcs.pymdb.uint7_t :annotation: unsigned 7-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint8_t +.. autoattribute:: yamcs.pymdb.uint8_t :annotation: unsigned 8-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint9_t +.. autoattribute:: yamcs.pymdb.uint9_t :annotation: unsigned 9-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint10_t +.. autoattribute:: yamcs.pymdb.uint10_t :annotation: unsigned 10-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint11_t +.. autoattribute:: yamcs.pymdb.uint11_t :annotation: unsigned 11-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint12_t +.. autoattribute:: yamcs.pymdb.uint12_t :annotation: unsigned 12-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint13_t +.. autoattribute:: yamcs.pymdb.uint13_t :annotation: unsigned 13-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint14_t +.. autoattribute:: yamcs.pymdb.uint14_t :annotation: unsigned 14-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint15_t +.. autoattribute:: yamcs.pymdb.uint15_t :annotation: unsigned 15-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint16_t +.. autoattribute:: yamcs.pymdb.uint16_t :annotation: unsigned 16-bit integer -.. autoattribute:: yamcs.pymdb.encodings.uint32_t +.. autoattribute:: yamcs.pymdb.uint24_t + :annotation: unsigned 24-bit integer + +.. autoattribute:: yamcs.pymdb.uint32_t :annotation: unsigned 32-bit integer Signed integers ---------------- +~~~~~~~~~~~~~~~ -.. autoattribute:: yamcs.pymdb.encodings.int8_t +.. autoattribute:: yamcs.pymdb.int8_t :annotation: signed 8-bit integer (big endian) -.. autoattribute:: yamcs.pymdb.encodings.int16_t +.. autoattribute:: yamcs.pymdb.int16_t :annotation: signed 16-bit integer (big endian) -.. autoattribute:: yamcs.pymdb.encodings.int32_t +.. autoattribute:: yamcs.pymdb.int24_t + :annotation: signed 24-bit integer (big endian) + +.. autoattribute:: yamcs.pymdb.int32_t :annotation: signed 32-bit integer (big endian) Boolean integer ---------------- +~~~~~~~~~~~~~~~ -.. autoattribute:: yamcs.pymdb.encodings.bool_t +.. autoattribute:: yamcs.pymdb.bool_t :annotation: Same as uint8_t. 0=False, 1=True + Floats ------- +~~~~~~ -.. autoattribute:: yamcs.pymdb.encodings.float32_t +.. autoattribute:: yamcs.pymdb.float32_t :annotation: 32-bit float in IEEE754-1985 encoding (big endian) -.. autoattribute:: yamcs.pymdb.encodings.float64_t +.. autoattribute:: yamcs.pymdb.float64_t :annotation: 64-bit float in IEEE754-1985 encoding (big endian) Little endian variants ----------------------- +~~~~~~~~~~~~~~~~~~~~~~ -.. autoattribute:: yamcs.pymdb.encodings.uint16le_t +.. autoattribute:: yamcs.pymdb.uint16le_t :annotation: unsigned 16-bit integer (little endian) -.. autoattribute:: yamcs.pymdb.encodings.int16le_t +.. autoattribute:: yamcs.pymdb.int16le_t :annotation: signed 16-bit integer in two's complement notation (little endian) -.. autoattribute:: yamcs.pymdb.encodings.uint32le_t +.. autoattribute:: yamcs.pymdb.uint32le_t :annotation: unsigned 32-bit integer (little endian) -.. autoattribute:: yamcs.pymdb.encodings.int32le_t +.. autoattribute:: yamcs.pymdb.int32le_t :annotation: signed 32-bit integer in two's complement notation (little endian) -.. autoattribute:: yamcs.pymdb.encodings.float32le_t +.. autoattribute:: yamcs.pymdb.float32le_t :annotation: 32-bit float in IEEE754-1985 encoding (little endian) -.. autoattribute:: yamcs.pymdb.encodings.float64le_t +.. autoattribute:: yamcs.pymdb.float64le_t :annotation: 64-bit float in IEEE754-1985 encoding (little endian) diff --git a/docs/exceptions.rst b/docs/exceptions.rst new file mode 100644 index 0000000..4807406 --- /dev/null +++ b/docs/exceptions.rst @@ -0,0 +1,8 @@ +Exceptions +========== + +ExportError +----------- + +.. autoclass:: yamcs.pymdb.ExportError + :members: diff --git a/docs/expressions.rst b/docs/expressions.rst new file mode 100644 index 0000000..564461c --- /dev/null +++ b/docs/expressions.rst @@ -0,0 +1,28 @@ +Expressions +=========== + +ParameterMember +--------------- + +.. autoclass:: yamcs.pymdb.ParameterMember + :members: + + +Methods +------- + +.. automethod:: yamcs.pymdb.eq + +.. automethod:: yamcs.pymdb.ne + +.. automethod:: yamcs.pymdb.lt + +.. automethod:: yamcs.pymdb.lte + +.. automethod:: yamcs.pymdb.gt + +.. automethod:: yamcs.pymdb.gte + +.. automethod:: yamcs.pymdb.all_of + +.. automethod:: yamcs.pymdb.any_of diff --git a/docs/index.rst b/docs/index.rst index 2992eeb..b2edd59 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -103,4 +103,10 @@ Table of Contents algorithms commands encodings - reference/index + calibrators + alarms + ancillary + datatypes + exceptions + expressions + verifiers diff --git a/docs/parameters.rst b/docs/parameters.rst index d511931..0d2b53c 100644 --- a/docs/parameters.rst +++ b/docs/parameters.rst @@ -1,52 +1,37 @@ Parameters ========== -AlarmLevel ----------- - -.. autoclass:: yamcs.pymdb.parameters.AlarmLevel - :members: - :member-order: bysource - - DataSource ---------- -.. autoclass:: yamcs.pymdb.parameters.DataSource +.. autoclass:: yamcs.pymdb.DataSource :members: :member-order: bysource -EnumerationAlarm ----------------- - -.. autoclass:: yamcs.pymdb.parameters.EnumerationAlarm - :members: - - Parameter --------- -.. autoclass:: yamcs.pymdb.parameters.Parameter +.. autoclass:: yamcs.pymdb.Parameter :members: Basic parameters ---------------- -.. autoclass:: yamcs.pymdb.parameters.AbsoluteTimeParameter +.. autoclass:: yamcs.pymdb.AbsoluteTimeParameter :members: -.. autoclass:: yamcs.pymdb.parameters.BinaryParameter +.. autoclass:: yamcs.pymdb.BinaryParameter :members: -.. autoclass:: yamcs.pymdb.parameters.FloatParameter +.. autoclass:: yamcs.pymdb.FloatParameter :members: -.. autoclass:: yamcs.pymdb.parameters.IntegerParameter +.. autoclass:: yamcs.pymdb.IntegerParameter :members: -.. autoclass:: yamcs.pymdb.parameters.StringParameter +.. autoclass:: yamcs.pymdb.StringParameter :members: @@ -56,18 +41,18 @@ Enumerated parameters Enumerated parameters can only represent discrete values. Booleans are a special kind of enumerated parameter that only knows two states. -.. autoclass:: yamcs.pymdb.parameters.BooleanParameter +.. autoclass:: yamcs.pymdb.BooleanParameter :members: -.. autoclass:: yamcs.pymdb.parameters.EnumeratedParameter +.. autoclass:: yamcs.pymdb.EnumeratedParameter :members: Complex parameters ------------------ -.. autoclass:: yamcs.pymdb.parameters.AggregateParameter +.. autoclass:: yamcs.pymdb.AggregateParameter :members: -.. autoclass:: yamcs.pymdb.parameters.ArrayParameter +.. autoclass:: yamcs.pymdb.ArrayParameter :members: diff --git a/docs/reference/index.rst b/docs/reference/index.rst deleted file mode 100644 index ec82d51..0000000 --- a/docs/reference/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -Reference -========= - -Systems -------- - -.. autoclass:: yamcs.pymdb.systems.System - :members: - -.. autoclass:: yamcs.pymdb.systems.Subsystem - :members: diff --git a/docs/systems.rst b/docs/systems.rst index a098a2f..d2b5eba 100644 --- a/docs/systems.rst +++ b/docs/systems.rst @@ -1,3 +1,15 @@ Systems ======= +System +------ + +.. autoclass:: yamcs.pymdb.System + :members: + + +Subsystem +--------- + +.. autoclass:: yamcs.pymdb.Subsystem + :members: diff --git a/docs/verifiers.rst b/docs/verifiers.rst new file mode 100644 index 0000000..63a4a86 --- /dev/null +++ b/docs/verifiers.rst @@ -0,0 +1,93 @@ +Verifiers +========= + +Verifier +-------- + +.. autoclass:: yamcs.pymdb.Verifier + :members: + + +TransferredToRangeVerifier +-------------------------- + +.. autoclass:: yamcs.pymdb.TransferredToRangeVerifier + :members: + + +SentFromRangeVerifier +--------------------- + +.. autoclass:: yamcs.pymdb.SentFromRangeVerifier + :members: + + +ReceivedVerifier +---------------- + +.. autoclass:: yamcs.pymdb.ReceivedVerifier + :members: + + +AcceptedVerifier +---------------- + +.. autoclass:: yamcs.pymdb.AcceptedVerifier + :members: + + +QueuedVerifier +-------------- + +.. autoclass:: yamcs.pymdb.QueuedVerifier + :members: + + +ExecutionVerifier +----------------- + +.. autoclass:: yamcs.pymdb.ExecutionVerifier + :members: + + +CompleteVerifier +---------------- + +.. autoclass:: yamcs.pymdb.CompleteVerifier + :members: + + +FailedVerifier +-------------- + +.. autoclass:: yamcs.pymdb.FailedVerifier + :members: + + +TerminationAction +----------------- + +.. autoclass:: yamcs.pymdb.TerminationAction + :members: + :member-order: bysource + + +AlgorithmCheck +-------------- + +.. autoclass:: yamcs.pymdb.AlgorithmCheck + :members: + + +ContainerCheck +-------------- + +.. autoclass:: yamcs.pymdb.ContainerCheck + :members: + + +ExpressionCheck +--------------- + +.. autoclass:: yamcs.pymdb.ExpressionCheck + :members: diff --git a/examples/ccsds.xml b/examples/ccsds.xml index 0b90090..0f45ed1 100644 --- a/examples/ccsds.xml +++ b/examples/ccsds.xml @@ -9,7 +9,15 @@ See https://github.com/yamcs/pymdb - + + +Used to distinguish telemetry (or reporting) packets from +telecommand (or requesting) packets. + +Note that some systems, notably the International Space System, +use a different convention where 0=core and 1=payload. + + diff --git a/src/yamcs/pymdb/commands.py b/src/yamcs/pymdb/commands.py index 02d0de7..1128fca 100644 --- a/src/yamcs/pymdb/commands.py +++ b/src/yamcs/pymdb/commands.py @@ -444,8 +444,8 @@ def __init__( The value may be provided in any of these ways: - * Bytes: :python:`b\xDE\xAD\xBE\xEF` - * Hex string: :python:`"DEADBEEF"` + * Bytes: :code:`b\\xDE\\xAD\\xBE\\xEF` + * Hex string: :code:`"DEADBEEF"` """ if isinstance(binary, str): self.binary = bytes.fromhex(binary)