From 4eb470c72447fb90f74ee33681d1e9e75c932d0f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 23 Feb 2023 15:13:35 +0100 Subject: [PATCH] prep v2.15.0 --- .flake8 | 17 ++++++++++++ CHANGELOG.md | 18 +++++++++++++ eive_tmtc/__init__.py | 4 +-- eive_tmtc/tmtc/acs/gyros.py | 43 ++++++++++++++++++++++------- eive_tmtc/tmtc/com/subsystem.py | 4 +-- pyproject.toml | 48 +++++++++++++++++++++++++++++++++ setup.cfg | 16 ----------- 7 files changed, 119 insertions(+), 31 deletions(-) create mode 100644 .flake8 create mode 100644 pyproject.toml diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..9dca1e5 --- /dev/null +++ b/.flake8 @@ -0,0 +1,17 @@ +[flake8] +max-line-length = 100 +ignore = D203, W503 +per-file-ignores = + */__init__.py: F401 +exclude = + .git, + __pycache__, + docs/conf.py, + old, + build, + dist, + venv +max-complexity = 10 +extend-ignore = + # See https://github.com/PyCQA/pycodestyle/issues/373 + E203, diff --git a/CHANGELOG.md b/CHANGELOG.md index aa7457f..5f658f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,24 @@ list yields a list of all related PRs for each release. # [unreleased] +# [v2.15.0] 2023-02-23 + +tmtccmd version v4.1.1 + +## Changed + +- Moved to `pyproject.toml` package file + +## Fixed + +- Correction in `tmtccmd` dependency, added missing function + +# [v2.14.0] 2023-02-22 + +## Changed + +- Generated CSV files for PDEC handler + # [v2.13.0] 2023-02-21 tmtccmd version 4.0.0 diff --git a/eive_tmtc/__init__.py b/eive_tmtc/__init__.py index b6e6626..eb854bc 100644 --- a/eive_tmtc/__init__.py +++ b/eive_tmtc/__init__.py @@ -1,11 +1,11 @@ -__version__ = "2.14.0" +__version__ = "2.15.0" import logging from pathlib import Path SW_NAME = "eive-tmtc" VERSION_MAJOR = 2 -VERSION_MINOR = 14 +VERSION_MINOR = 15 VERSION_REVISION = 0 EIVE_TMTC_ROOT = Path(__file__).parent diff --git a/eive_tmtc/tmtc/acs/gyros.py b/eive_tmtc/tmtc/acs/gyros.py index 66215f6..9ac60e0 100644 --- a/eive_tmtc/tmtc/acs/gyros.py +++ b/eive_tmtc/tmtc/acs/gyros.py @@ -6,8 +6,17 @@ from tmtccmd.tc import DefaultPusQueueHelper import eive_tmtc.config.object_ids as obj_ids from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid -from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry, TmtcDefinitionWrapper -from eive_tmtc.config.object_ids import GYRO_0_ADIS_HANDLER_ID, GYRO_1_L3G_HANDLER_ID, GYRO_2_ADIS_HANDLER_ID, GYRO_3_L3G_HANDLER_ID +from tmtccmd.config.tmtc import ( + tmtc_definitions_provider, + OpCodeEntry, + TmtcDefinitionWrapper, +) +from eive_tmtc.config.object_ids import ( + GYRO_0_ADIS_HANDLER_ID, + GYRO_1_L3G_HANDLER_ID, + GYRO_2_ADIS_HANDLER_ID, + GYRO_3_L3G_HANDLER_ID, +) from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.pus_tm.defs import PrintWrapper @@ -64,9 +73,13 @@ def handle_gyr_cmd(q: DefaultPusQueueHelper, op_code: str): if not is_adis: raise ValueError("No config HK for L3 device") q.add_log_cmd(f"Gyro {gyr_info[0]} CFG HK") - q.add_pus_tc(create_request_one_hk_command(make_sid(gyr_obj_id, AdisGyroSetId.CFG_HK))) + q.add_pus_tc( + create_request_one_hk_command(make_sid(gyr_obj_id, AdisGyroSetId.CFG_HK)) + ) else: - logging.getLogger(__name__).warning(f"invalid op code {op_code} for gyro command") + logging.getLogger(__name__).warning( + f"invalid op code {op_code} for gyro command" + ) def handle_gyros_hk_data( @@ -95,9 +108,15 @@ def handle_adis_gyro_hk( pw = PrintWrapper(printer) fmt_str = "!ddddddf" inc_len = struct.calcsize(fmt_str) - (ang_veloc_x, ang_veloc_y, ang_veloc_z, accel_x, accel_y, accel_z, temp) = struct.unpack( - fmt_str, hk_data[0 : 0 + inc_len] - ) + ( + ang_veloc_x, + ang_veloc_y, + ang_veloc_z, + accel_x, + accel_y, + accel_z, + temp, + ) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len]) pw.dlog(f"Received ADIS1650X Gyro HK data from object {object_id}") pw.dlog( f"Angular Velocities (degrees per second): X {ang_veloc_x} | " @@ -110,9 +129,13 @@ def handle_adis_gyro_hk( fmt_str = "!HBHHH" inc_len = struct.calcsize(fmt_str) print(len(hk_data)) - (diag_stat_reg, filter_setting, range_mdl, msc_ctrl_reg, dec_rate_reg) = struct.unpack( - fmt_str, hk_data[0 : 0 + inc_len] - ) + ( + diag_stat_reg, + filter_setting, + range_mdl, + msc_ctrl_reg, + dec_rate_reg, + ) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len]) pw.dlog(f"Diagnostic Status Register {diag_stat_reg:#018b}") pw.dlog(f"Range MDL {range_mdl}") pw.dlog(f"Filter Settings {filter_setting:#010b}") diff --git a/eive_tmtc/tmtc/com/subsystem.py b/eive_tmtc/tmtc/com/subsystem.py index d73a6e3..6bd6c14 100644 --- a/eive_tmtc/tmtc/com/subsystem.py +++ b/eive_tmtc/tmtc/com/subsystem.py @@ -21,9 +21,7 @@ from tmtccmd.tc.pus_20_fsfw_param import ( pack_scalar_u8_parameter_app_data, ) -from tmtccmd.pus.s20_fsfw_param_defs import ( - create_scalar_u32_parameter -) +from tmtccmd.pus.s20_fsfw_param import create_scalar_u32_parameter class ParameterId(enum.IntEnum): diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..56dc51c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "eive-tmtc" +description = "TMTC Commander EIVE" +readme = "README.md" +dynamic = ["version"] +requires-python = ">=3.10" +license = {text = "Apache-2.0"} +authors = [ + {name = "Robin Mueller", email = "muellerr@irs.uni-stuttgart.de"}, + {name = "Jakob Meier", email = "meierj@irs.uni-stuttgart.de"}, +] +keywords = ["eive", "space", "communication", "commanding"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: Apache Software License", + "Natural Language :: English", + "Operating System :: POSIX", + "Operating System :: Microsoft :: Windows", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Communications", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering" +] +dependencies = [ + "tmtccmd ~= 4.0", + "python-dateutil ~= 2.8", + # tmtccmd @ git+https://github.com/robamu-org/tmtccmd@#egg=tmtccmd +] + +[project.urls] +"Homepage" = "https://egit.irs.uni-stuttgart.de/eive/eive-tmtc" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {attr = "eive_tmtc.__version__"} + +# Auto-Discovery is problematic for some reason, so use custom-discovery +[tool.setuptools.packages] +find = {} diff --git a/setup.cfg b/setup.cfg index 4f754fe..ccf8625 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,19 +36,3 @@ include_package_data = True [options.extras_require] mib = - -[flake8] -max-line-length = 100 -ignore = D203, W503 -exclude = - .git, - __pycache__, - docs/conf.py, - old, - build, - dist, - venv -max-complexity = 10 -extend-ignore = - # See https://github.com/PyCQA/pycodestyle/issues/373 - E203,