Modules in PyBERT Package

Top Level Modules (pybert)

pybert.common - Common miscellaneous definitions and aliases.

Definitions common to all PyBERT modules.

Original author: David Banas <capn.freako@gmail.com>

Original date: May 13, 2024

Copyright (c) 2024 David Banas; all rights reserved World wide.

class pybert.common.Real

Real scalar

alias of TypeVar(‘Real’, numpy.float64, numpy.float64)

class pybert.common.Comp

Complex scalar

alias of TypeVar(‘Comp’, numpy.complex64, numpy.complex128)

pybert.common.Rvec: TypeAlias

Real valued vector

pybert.common.Cvec: TypeAlias

Complex valued vector

pybert.common.Rmat: TypeAlias

Real valued matrix

pybert.common.Cmat: TypeAlias

Complex valued matrix

pybert.common.PI = 3.14159

Value of Pi

pybert.common.TWOPI = 6.28318

2 * Pi

pybert.configuration - Data structure for saving PyBERT configuration.

Simulation configuration data encapsulation, for PyBERT.

Original Author: David Banas <capn.freako@gmail.com>

Original Date: 5 May 2017

This Python script provides a data structure for encapsulating the simulation configuration data of a PyBERT instance. It was first created, as a way to facilitate easier pickling, so that a particular configuration could be saved and later restored.

Copyright (c) 2017 by David Banas; All rights reserved World wide.

exception pybert.configuration.InvalidFileType[source]

Bases: Exception

Raised when a filetype that isn’t supported is used when trying to load or save files..

class pybert.configuration.PyBertCfg(the_PyBERT, date_created: str, version: str)[source]

Bases: object

PyBERT simulation configuration data encapsulation class.

This class is used to encapsulate that subset of the configuration data for a PyBERT instance, which is to be saved when the user clicks the “Save Config.” button.

Copy just that subset of the supplied PyBERT instance’s __dict__, which should be saved.

static load_from_file(filepath: str | Path, pybert)[source]

Apply all of the configuration settings to the pybert instance.

Confirms that the file actually exists, is the correct extension and attempts to set the values back in pybert.

Parameters:
  • filepath – The full filepath including the extension to save too.

  • pybert – instance of the main app

save(filepath: str | Path)[source]

Save out pybert’s current configuration to a file.

The extension must match a yaml file extension or it will still raise an invalid file type. Additional filetypes can be added/supported by just adding another if statement and adding to CONFIG_FILEDIALOG_WILDCARD.

Parameters:

filepath – The full filepath including the extension to save too.

pybert.configuration.CONFIG_LOAD_WILDCARD = 'Yaml Config (*.yaml;*.yml)|*.yaml;*.yml|Pickle Config (*.pybert_cfg)|*.pybert_cfg|All files (*)|*'

This sets the supported file types in the GUI’s loading dialog.

pybert.configuration.CONFIG_SAVE_WILDCARD = 'Yaml Config (*.yaml;*.yml)|*.yaml;*.yml|All files (*)|*'

This sets the supported file types in the GUI’s save-as dialog.

pybert.results - Data structure for saving PyBERT results.

Simulation results data encapsulation, for PyBERT.

Original Author: David Banas <capn.freako@gmail.com>

Original Date: 9 May 2017

This Python script provides a data structure for encapsulating the simulation results data of a PyBERT instance. It was first created, as a way to facilitate easier pickling, so that a particular result could be saved and later restored, as a reference waveform.

Copyright (c) 2017 by David Banas; All rights reserved World wide.

class pybert.results.PyBertData(the_PyBERT, date_created: str, version: str)[source]

Bases: object

PyBERT simulation results data encapsulation class.

This class is used to encapsulate that subset of the results data for a PyBERT instance, which is to be saved when the user clicks the “Save Results” button.

Copy just that subset of the supplied PyBERT instance’s ‘plotdata’ attribute, which should be saved during pickling.

static load_from_file(filepath: str | Path, pybert)[source]

Recall all the results from a file and load them as reference plots.

Confirms that the file actually exists and attempts to load back the graphs as reference plots in pybert.

Parameters:
  • filepath – The full filepath including the extension to save too.

  • pybert – instance of the main app

save(filepath: Path)[source]

Save all of the plot data out to a file.

Parameters:

filepath – The full filepath including the extension to save too.

pybert.results.RESULTS_FILEDIALOG_WILDCARD = '*.pybert_data'

This sets the supported file types in the GUI’s save-as or loading dialog.

pybert.cli - Command line interface.

Models (pybert.models)

Main subcomponent models.

GUI Elements (pybert.gui)

Parsers (pybert.parsers)

Various parsers needed by PyBERT.

Threads (pybert.threads)

Various types of Python thread definitions used by PyBERT.

A separate thread is used for optimization, in order to preserve GUI responsiveness to user input while optimizing. And all custom threads used in PyBERT are derived from StoppableThread, so that any optimization may be aborted by the user.

Utility (pybert.utility)

General purpose utilities for PyBERT.

Original author: David Banas <capn.freako@gmail.com> Original date: June 16, 2024

Copyright (c) 2024 David Banas; all rights reserved World wide.

Historical lineage:

pybert/pybert_cntrl.py => pybert/utility.py => pybert/utility/__init__.py

A refactoring of the pybert.utility module, as per Issue #147.