From b9d5b968dec6c2095a654819d1ab6d2481badf64 Mon Sep 17 00:00:00 2001 From: gfrn Date: Wed, 14 Sep 2022 16:19:41 -0300 Subject: [PATCH] Fixes updating EGU, FAC read_vars --- pyproject.toml | 5 ----- setup.cfg | 15 +++++++++++++++ src/pydrs/base.py | 16 ++++++++-------- 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index a659e97..c0adb39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,11 +19,6 @@ classifiers=[ "Operating System :: OS Independent" ] description="" -dependencies = [ - "matplotlib", - "numpy", - "pyserial==3.5" -] readme="README.md" license = {text = "MIT License"} requires-python=">=3.6" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..0eef2e8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,15 @@ +[metadata] +name = pydrs +version = {attr = "pydrs.__version__"} + +[options] +package_dir= + =src +packages=find: +install_requires= + matplotlib==3.3.4 + numpy + pyserial==3.5 + +[options.packages.find] +where=src \ No newline at end of file diff --git a/src/pydrs/base.py b/src/pydrs/base.py index 514346c..f2d904d 100644 --- a/src/pydrs/base.py +++ b/src/pydrs/base.py @@ -1613,11 +1613,11 @@ def read_vars_common(self, vals: bytes = None) -> dict: or (vars_dict["status"]["model"] == "FAC_2S_ACDC") or (vars_dict["status"]["model"] == "FAC_2P4S_ACDC") ): - vars_dict["ps_setpoint"][-1] = "V" - vars_dict["ps_reference"][-1] = "V" + vars_dict["ps_setpoint"] = vars_dict["ps_setpoint"][:-1] + "V" + vars_dict["ps_reference"] = vars_dict["ps_reference"][:-1] + "V" else: - vars_dict["ps_setpoint"][-1] = "%" - vars_dict["ps_reference"][-1] = "%" + vars_dict["ps_setpoint"] = vars_dict["ps_setpoint"][:-1] + "%" + vars_dict["ps_reference"] = vars_dict["ps_reference"][:-1] + "%" vars_dict["siggen_type"] = common.sig_gen_types[int(vars_dict["siggen_type"])] vars_dict["wfmref_sync_mode"] = common.wfmref_sync_modes[ @@ -1698,7 +1698,7 @@ def _read_vars_generic( 255 + sum([data["size"] for data in template.values()]), ) - # 1 byte for checksum, 246 common variable bytes, 8 header bytes + # 1 byte for checksum, 246 common variable bytes, 8 interlock bytes vars_dict = self.read_vars_common(vals[4:246]) vals = vals[246:-1] @@ -1947,7 +1947,7 @@ def read_vars_fac_2s_dcdc(self, iib=False) -> dict: return vars_dict - def read_vars_fac_2p4s_acdc(self, iib=0): + def read_vars_fac_2p4s_acdc(self, iib=0) -> dict: """Reads FAC 2P4S ACDC power supply variables (alias for `read_vars_fac_2s_acdc`) Parameters @@ -1961,7 +1961,7 @@ def read_vars_fac_2p4s_acdc(self, iib=0): Dictionary with power supply variables """ - self.read_vars_fac_2s_acdc(iib) + return self.read_vars_fac_2s_acdc(iib) def read_vars_fac_2p4s_dcdc(self) -> dict: """Reads FAC 2P4S DCDC power supply variables @@ -1988,7 +1988,7 @@ def read_vars_fac_2p4s_dcdc(self) -> dict: vars_dict[f"iib_alarms_{i}_raw"], fac.list_2p4s_dcdc_iib_alarms ) - return + return vars_dict def read_vars_fap(self, iib=True) -> dict: """Reads FAP power supply variables