pychopmarg.<misc.>

Miscellaneous modules in the PyChOpMarg package.

utility

General purpose utilities for PyChOpMarg.

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

Original date: March 3, 2024 (Copied from pybert.utility.)

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

pychopmarg.utility.import_s32p(filename: str, vic_chnl: int = 1) list[tuple[Network, str]][source]

Read in a 32-port Touchstone file, and return an equivalent list of 8 2-port differential networks: a single victim through channel and 7 crosstalk aggressors, according to the VITA 68.2 convention.

Parameters:

filename – Name of Touchstone file to read in.

Keyword Arguments:

vic_chnl – Victim channel number (from 1). Default = 1

Returns:

  • a 2-port network representing a differential channel, and

  • the type of that channel, one of: ‘THRU’, ‘NEXT’, or ‘FEXT.

    (First element is the victim and the only one of type ‘THRU’.)

Return type:

List of 8 pairs, each consisting of

Raises:

ValueError – If Touchstone file is not 32-port.

Notes

  1. Input Touchstone file is assumed single-ended.

  2. The differential through and xtalk channels are returned.

  3. Port 2 of all returned channels correspond to the same physical circuit node,

    typically, the Rx input node.

pychopmarg.utility.sdd_21(ntwk: Network, norm: float = 0.5, renumber: bool = False) Network[source]

Given a 4-port single-ended network, return its differential throughput as a 2-port network.

Parameters:

ntwk – 4-port single ended network.

Keyword Arguments:
  • norm – Normalization factor. (Default = 0.5)

  • renumber – Automatically detect correct through path when True. Default: False

Returns:

Sdd (2-port).

Notes

  1. A “1->2/3->4” port ordering convention is assumed when renumber is False.

  2. Automatic renumbering should not be used unless a solid d.c. thru path exists.

pychopmarg.utility.se2mm(ntwk: Network, norm: float = 0.5, renumber: bool = False) Network[source]

Given a 4-port single-ended network, return its mixed mode equivalent.

Parameters:

ntwk – 4-port single ended network.

Keyword Arguments:
  • norm – Normalization factor. (Default = 0.5)

  • renumber – Automatically detect correct through path when True. Default: False

Returns:

Sdd11 Sdd12 Sdc11 Sdc12 Sdd21 Sdd22 Sdc21 Sdc22 Scd11 Scd12 Scc11 Scc12 Scd21 Scd22 Scc21 Scc22

Return type:

Mixed mode equivalent network, in the following format

Notes

  1. A “1->2/3->4” port ordering convention is assumed when renumber is False.

  2. Automatic renumbering should not be used unless a solid d.c. thru path exists.

cli

Main Entry Point for PyChOpMarg when using the CLI.

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

Original date: March 25, 2024

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

view

Default view definition for PyChOpMarg.COM class.

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

Original date: March 26, 2024

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

class pychopmarg.view.MyHandler(*args: Any, **kwargs: Any)[source]

Bases: Handler

This handler is instantiated by the View and handles user button clicks.

do_calc_com(info)[source]

Run the COM calculation.

pychopmarg.view.to_GHz(f: float) str[source]

Return formatted frequency in GHz.

pychopmarg.view.to_MHz(f: float) str[source]

Return formatted frequency in MHz.

pychopmarg.view.to_mV(v: float) str[source]

Return formatted voltage in mV.

pychopmarg.view.to_nH(L: float) str[source]

Return formatted inductance in nH.

pychopmarg.view.to_ns(t: float) str[source]

Return formatted time in nanoseconds.

pychopmarg.view.to_pF(c: float) str[source]

Return formatted capacitance in pF.

common

Definitions common to all PyChOpMarg modules.

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

Original date: March 3, 2024 (Copied from pybert.utility.)

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