Skip to content

Releases: capn-freako/PyAMI

IBIS 8.0 [AMI Test Configuration] Support

18 Jun 21:07

Choose a tag to compare

General Description

This minor release adds a new command: check-ami, which exercises any [AMI Test Configuration] keywords found and reports success/failure.

Quick Start

With the appropriate Python virtual environment activated:

  1. pip install --upgrade pyibis-ami
  2. check-ami <path.to.ibis.file>

What's Changed

Full Changelog: v9.0.0...v9.1.0

Brand New Model Testing Infrastructure

25 May 19:48

Choose a tag to compare

General Description

This release provides a complete rewrite of the IBIS-AMI model testing functionality.
The old model testing infrastructure suffered from both poor performance and difficulty in debugging because:

  1. It used a Jupyter notebook to perform the testing and the overhead of that client/server networking interface, although completely local, was huge.
  2. It used the EmPy templating system, which alters line numbers upon template evaluation.
    So, line numbers in back-traces couldn't be trusted, which made manual attempts at source code line identification necessary.
    And these were both time consuming and error prone.

In short, the old testing infrastructure was a classic case of cleverness for cleverness' sake completely gumming up the works.
I lost my way and forgot about KISS ("Keep it simple, stupid!")
I'm very sorry. :(

You'll be happy to know that the new testing infrastructure is fast as all Hell!
(I mean really fast.)
It uses straight Python; no templating and no Jupyter notebooking.
Results are quick and line numbers in back-traces are accurate.
(You shouldn't see many back-traces, as the new infrastructure is also quite a bit more robust than the old.)

The new testing system makes use of the ReportLab package for low level PDF mechanics.
That means we get to focus on high level document layout and construction, undistracted by the pedantic necessities of PDF document creation.
We get nice looking reports and we don't have to think about it too much. :)

Quick Start

To get started using the new IBIS-AMI model testing infrastructure right now, do this from some incantation of a Bash shell:
(Sorry, but it's just too much work to keep creating two copies of these instructions: one for Windoze and one for the rest of the computing World.
If you're stuck on a Windows machine then just bust the move and install Git Bash.
You'll be so glad you did. :) )

  1. Activate the Python virtual environment you use for IBIS-AMI model testing.
    (You are using virtual environments, right?)

    • source <path to your virtual environment>/Scripts/activate (Windows)
    • source <path to your virtual environment>/bin/activate (all others)

    Example (Note that . and ~ are Bash abbreviations for source and <user's home directory>, respectively.):

    [26-05-25 9:46] dbanas@Davids-Air-2:~
    % . ~/.venv/pybert-dev/bin/activate
    
    (pybert-dev)
    [26-05-25 9:47] dbanas@Davids-Air-2:~
    %
    

    Note: The addition of (pybert-dev) to my command prompt string is my indication that virtual environment activation was successful.

  2. Ensure that your Pip in this virtual environment is up-to-date.
    (Each virtual environment maintains its own!)

    • python -m pip install --upgrade pip

    Example:

    (pybert-dev)
    [26-05-25 9:47] dbanas@Davids-Air-2:~
    % python -m pip install --upgrade pip
    Requirement already satisfied: pip in ./.venv/pybert-dev/lib/python3.11/site-packages (25.3)
    Collecting pip
    Downloading pip-26.1.1-py3-none-any.whl.metadata (4.6 kB)
    Downloading pip-26.1.1-py3-none-any.whl (1.8 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 14.5 MB/s  0:00:00
    Installing collected packages: pip
    Attempting uninstall: pip
    	Found existing installation: pip 25.3
    	Uninstalling pip-25.3:
      	Successfully uninstalled pip-25.3
    Successfully installed pip-26.1.1
    
  3. Update your virtual environment's installation of the PyIBIS-AMI package.

    • pip install --upgrade pyibis-ami
  4. Try the new testing infrastructure on your IBIS-AMI model of choice.

    • test-model <path to *.ibs file>

    Assuming this is the first time you've run the new test-model command on this IBIS model file, you should find two new files upon a successful run:

    1. A default simulation parameter sweep control module.

      This is an ordinary Python source file located in: ./<IBIS file name>/<model name>/defaults_template.py.
      It may be used as a template in developing an appropriate suite of parameter sweeps for testing this model.
      The only thing that makes it special is that it contains one or more instances of sub-classes of the new TestSweep class introduced in this update.
      The new test system searches for all such sub-classes contained in any Python modules found in ./<IBIS file name>/<model name>/ and uses them for testing.

      So, you may make as many copies of defaults_template.py as you wish (differently named, of course) and place as many sub-classes of TestSweep as you wish in each new file.
      And all sub-classes thusly defined will be used for model testing.
      The main purpose for this module/sub-class structuring is to give the user some control over the structure of the final PDF testing report.
      The module docstrings are used as H3 level headers, while the sub-class docstrings are used as H4 level headers.
      Thus, the hierarchy you define when creating your test definition modules and sub-classes is reflected in the final PDF report.
      And this fact can be used to group like-purposed parameter sweeps, both structurally in your working directory, as well as visually in the final PDF report.

    2. A model testing report, which used this new sweep control module.

      This is a PDF file created as a peer to (i.e. - in the same directory as) the *.ibs file that was tested.
      And it contains the complete and final testing report for that IBIS model file.

      Note: This difference in the default locations chosen for the two different files was a matter of some debate between the PyIBIS-AMI developers.
      And we are open to (rational) arguments that we may have made the wrong choice. ;-)

Potential API Breakages for Existing Client Code

Alas, this is one of those major updates, which mandated letting go of some poorly designed legacy API features.
As such, it is quite possible that this update may break your existing PyIBIS-AMI client code.
And for that we sincerely apologize. :(

This section of these release notes is intended as a guide to help you quickly fix any such breakages.
Each API change is documented here, including:

  • reason for making the change,

  • explanation of what the change might break, and

    • These are split into two categories: runtime and type checking.
  • suggested work-arounds for affected client code.

    • The suggested work-around for type checking breakages is always the same pair of alternatives:

      • Fix the type error.
      • Add a pragma comment: # type: ignore, at the call site.

      These will not be given redundantly, below.

ami.config.mk_model()

Reason: Needed to fix awkward confusing type signatures in parent module.

Potential Breakage:

Runtime: None (New type is more strict.)

Type Checking: Type checkers may demand that your client code change the types of the ibis_params & ami_params arguments.

Work-arounds: (See above.)

ami.model.get_responses()

Reason: Existing API prompted/allowed the caller to override the Ignore_Bits AMI parameter.

Potential Breakage:

Runtime: Possibly none if your existing value sent in pad_bits is also valid as a maximum run length limiter for your GetWave() function. Otherwise, this value will need to change.

Type Checking: The new return type is more specific. And this may get flagged by some type checkers.

Work-arounds: As above, and note:

  1. A new optional keyword argument has been added to the end of the list: debug.
    This Boolean flag defaults to False.
    If you send True you will get lots of diagnostic output when this function is called.

ami.parser.parse_ami_file_contents()

The return type of this function has changed.
The first element of the returned tuple, which was a simple string, has changed to two lists of string: the first for errors and the second for warnings.

Also, the function now raises a RuntimeError exception if the ami_parse() function fails.

Reason: Determining whether an error had occurred simply by whether or not the returned string had any content was too coarse and very non-standard behavior.

Potential Breakages:

Runtime: The client code must be changed, whether it uses pattern matching or simple indexing, as the number of members in the returned tuple has changed.
Also, it may need to be modified, to deal w/ the new potential of a thrown exception.

Type Checking: Yes.

Work-arounds: (n/a)

ami.parser.make_gui() & ami.parser.make_gui_items()

The return types of both of these functions have changed similarly, as follows:

The simple TraitType has been replaced with: tuple[str, TraitType].
That is, traits are labelled with their associated parameter name.

Reason: This was an error in the type hint and has been fixed.

Potential Breakages:

Runtime: None; this is a type hint only change.

Type Checking: This should actually fix some preexisting breakages.

Work-arounds: (n/a)

ibis.file.IBISModel Class

The is_tx parameter in the initializer for this class has been eliminated.
It never really made sense, since a single *.ibs file may contain several different models, some transmitters and some receivers.

Reason: Original API logic was incorrect.

Potential Breakages:

Runtime: Client code must change to eliminate the is_tx parameter.

Type Checking: Type checkers will complain about a type mismatch, until the client code is fixed.

Work-arounds: None.

New Modules Added

The following new modules have been added in this release:

  • testing: This module contains the new IBIS-AMI model testing infrastructure and replaces tools.
  • util.ami: General purpose utilities for AMI models.
  • util.misc: Various miscellaneous utilities.
  • util.plot: Gene...
Read more

Improved Type Checking for `AmiNode`.

13 Feb 14:07

Choose a tag to compare

General Description

This release improves the type specification of the recursively typed AmiNode class.
This allows for more comprehensive type checking of client code, such as that used in the PyBERT project.

What's Changed

  • Clean-up, as part of attempting a (failed) fix to the AmiNode type … by @capn-freako in #62
  • Bump pillow from 12.1.0 to 12.1.1 by @dependabot[bot] in #63

New Contributors

Full Changelog: v8.0.0...v8.1.0

Simplified, uv-based test/build/dist infrastructure.

25 Jan 14:12

Choose a tag to compare

General Description

This is, primarily, a "developers-only" release.

There is only one user-oriented change:
An obscure AMI parsing bug has been fixed.
Previously, this worked:

(Param (Corner 0 1 2) ...)

while this failed:

(Param (Format Corner 0 1 2) ...)

That has been fixed.

The real change with this release should never be visible to users, nor to typical developers, who are content with the Make driven test/build/dist flow and not interested in underlying infrastructure maintenance/improvement.
That change includes:

  1. moving from pip to uv as our underlying project management tool, and
  2. eliminating Tox as our infrastructural middle-man.

The test/build/dist infrastructure is now a 2-layer architecture, consisting of:

  1. make as the top-layer, user interface (just as before), and
  2. uv as the (new) bottom-layer management engine, which the typical user/developer will never have to interact with.

Quick Update

From within the apropos Python virtual environment:

$ pip install --upgrade pyibis-ami

Documentation & Community

PyIBIS-AMI on ReadTheDocs
PyIBIS-AMI Wiki

What's Changed

  • Fixed broken "(Format Corner ...)" AMI parameter parsing. by @capn-freako in #58
  • Change to 'uv' from 'pip' for project management and eliminate Tox. by @capn-freako in #60

Full Changelog: v7.3.1...v8.0.0

AMI Configurator GUI Layout Clean-up

24 Dec 21:45
615acb5

Choose a tag to compare

General Description

This release fixes a problem with the AMI parameter configuration dialog, wherein it would become wider than the available screen width for some models.
Along the way, we also fixed some obscure parsing bugs, both IBIS and AMI.

API Changes

  1. The ami_params_out attribute of the pyibisami.ami.model.AMIModel class is now returned as a decoded standard Python string and no longer needs to be decode()-ed by the client code.

Quick Update

From within the apropos Python virtual environment:

$ pip install --upgrade pyibis-ami

Documentation & Community

PyIBIS-AMI on ReadTheDocs
PyIBIS-AMI Wiki

What's Changed

  • 53 ami parameter configurator window one line only by @capn-freako in #56

Full Changelog: v7.2.9...v7.3.1

v7.2.7 - Fixed Negative Tap Indices.

18 Oct 13:24

Choose a tag to compare

General Description

The use of negative tap indices in AMI files was broken.
This release fixes that.

Quick Start

From within an appropriate Python virtual environment:

  • pip install --upgrade pyibis-ami

Documentation & Community

Full Changelog: v7.2.5...v7.2.7

Miscellaneous Fixes for PyBERT v9.1.2

23 Jul 22:41

Choose a tag to compare

Miscellaneous fixes accumulated while making release v9.1.2 of PyBERT.

Fixed Format=None bug.

12 Jul 18:22

Choose a tag to compare

General Description

Fixes an obscure corner case bug reported by Vincent Hwang, in which the Format tag of a string parameter gets left as None and causes a crash.

Quick Update Instructions

pip intall --upgrade pyibis-ami

Full Changelog: v7.2.3...v7.2.4

v7.2.3 - Fixed passing of string parameters.

01 May 21:36

Choose a tag to compare

What's Changed

  • Fixed a bug wrt/ passing string parameters to the model.

  • Removed all assertions from code base, except in notebooks. by @capn-freako in #52

Full Changelog: v7.2.2...v7.2.3

Build infrastructure cleanup.

06 Apr 18:55

Choose a tag to compare

This "for developers only" release just contains some minor improvements to the build infrastructure.

There is only one change to functionality:

  • IBIS-AMI model initialization no longer crashes if there were no Info parameters provided.

Full Changelog: v7.2.0...v7.2.2