From a9e901b47d100fe34ff69e197d903edbd27bbee4 Mon Sep 17 00:00:00 2001 From: David Banas Date: Sun, 18 Jan 2026 08:00:11 -0500 Subject: [PATCH] Fixed broken "(Format Corner ...)" AMI parameter parsing. Fixes #57 --- proj_ver | 2 +- pyproject.toml | 2 +- src/pyibisami/ami/parser.py | 2 ++ tests/ami/test_parser.py | 8 +++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/proj_ver b/proj_ver index 433e7b5..bee0031 100644 --- a/proj_ver +++ b/proj_ver @@ -1,2 +1,2 @@ export PROJ_NAME=pyibis_ami -export PROJ_VER=7.2.10 +export PROJ_VER=7.3.2 diff --git a/pyproject.toml b/pyproject.toml index 84b811a..3b6426e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyibis-ami" description = "Facilitates working directly with IBIS-AMI DLLs from the Python command prompt." -version = "7.3.1" +version = "7.3.2" authors = [ {name = "David Banas", email = "capn.freako@gmail.com"} ] readme = "README.md" diff --git a/src/pyibisami/ami/parser.py b/src/pyibisami/ami/parser.py index 8f1d5cd..55da260 100644 --- a/src/pyibisami/ami/parser.py +++ b/src/pyibisami/ami/parser.py @@ -696,6 +696,8 @@ def make_gui_items( # pylint: disable=too-many-locals,too-many-branches else: val = default if default else param.pvalue[0] the_trait = Enum([val] + param.pvalue) + case "Corner": + the_trait = Trait(param.pvalue[0]) # Using `Typ` value, for now. case _: raise ValueError(f"Unrecognized AMI parameter format: {pformat}, for parameter `{pname}` of type `{param.ptype}` and usage `{param.pusage}`!") if the_trait.metadata: diff --git a/tests/ami/test_parser.py b/tests/ami/test_parser.py index e236e8f..795f2da 100644 --- a/tests/ami/test_parser.py +++ b/tests/ami/test_parser.py @@ -54,6 +54,12 @@ def test_ami_config(): (Range 0 0 10 ) (Description "Second post-tap." ) ) + (corner_test + (Usage In ) + (Type Integer ) + (Format Corner 1 0 2 ) + (Description "Dummy parameter, using `Corner` formatting." ) + ) ) ) @@ -78,7 +84,7 @@ def test_AMIParamConfigurator_without_GUI(self, test_ami_config): ami = ami_parser.AMIParamConfigurator(test_ami_config) assert ami._root_name == "example_tx" assert ami._ami_parsing_errors == "" - test_keys = ("tx_tap_units", "tx_tap_np1", "tx_tap_nm1", "tx_tap_nm2") + test_keys = ("tx_tap_units", "tx_tap_np1", "tx_tap_nm1", "tx_tap_nm2", "corner_test") assert all(key in ami.ami_param_defs["Model_Specific"] for key in test_keys) assert ami.ami_param_defs["Model_Specific"]["tx_tap_units"].pvalue == 27 assert ami.ami_param_defs["Reserved_Parameters"]["AMI_Version"].pvalue == "5.1"