The analyses: tools that work on the same board as a run but are not
S-parameter solvers (the crosstalk between traces, a rail's DC drop and
impedance, a converter's near field, a circuit on the board's copper, the
board's temperature). Each is an Analysis subclass, listed in ANALYSES by its
module and class: the crosstalk (kicad2ems.core.si), the line parameters
(kicad2ems.core.rlgc), pcbqs's five (kicad2ems.pcbqs.analyses: with the
conducted emission), the Elmer and Palace tools (kicad2ems.fem.analyses).
A front end lists what the registry holds, builds each one's settings from its
options, starts it as the command it gives and shows what its result folder
holds.
from kicad2ems.core.analyses import registry, analysis_of
[a.label for a in registry().values()]
analysis_of('out/board_pdn_3V3_20261111_120000')
# ('pdn', False): whose result, and whether a preview
An analysis declares (class attributes)
name, label, tool 'pdn', 'Power integrity', 'kicad2ems.pcbqs.pdn' (what
runs it, as lists show it); name is also its config
table [analysis.pdn] and the tag of its run folders
about one line: what it gives
order its place in lists and in a run of several: lowest
first, then by name
previewed True: it has a preview (the model and its mesh, no
solve)
needs the analyses it cannot run without the results of (a
front end runs those first)
uses the analyses whose latest result it can start from,
when there is one (the temperature from a circuit's
losses): not required, as `needs` are
result, preview_result the file a finished run (a preview) leaves in its
folder ('pdn.json'): owns' default
paths the options whose values are paths: relative to the
config file they are read from
page False: its settings and its results are all a front
end needs to show; True: it has an editor of its own
in the GUI (the circuit's schematic)
provides the questions it answers (kicad2ems.core.study:
QUESTIONS: 'dc', 'pdn', 'thermal' ...), from one run:
(); then it is one question of its own name
engine the program's name as a list shows it beside a
question ('pcbqs', 'Elmer'); '': its label
questions study.Question objects of its own, for what kicad2ems
has no question for
several what a study may hold several settings of it by, each
a run of its own, as a front end names them ('rail':
a board's rails; a config's [[analysis.<name>]]
tables, read_sets); '': one. A run's tag(values)
tells them apart
several_keys the options that differ from one of them to the next
(a rail's net, its voltage, its loads): a front end
shows them as a table, a row a run, the others shared
fields the bool option that makes it write field dumps too
('fields'); '': none
env environment variables its command runs with (a thread
cap), or {}
variants its engines, when it is several to choose from beside
a question: ((suffix, label, {option: value}), ...),
each an engine of the name <name>_<suffix> (suffix
'': <name>) that runs it with those settings (the
crosstalk's line model alone, or with a full-wave
solver: crosstalk_gfdtd); the settings it fixes are
not in its options. (): one engine, itself
and implements
check() (usable, one line): its version and origin, or what is
missing and how to get it
options() its settings, [Option] (kicad2ems.core.options), as
the solvers' are: its kind one of KINDS, 'bool' a
switch, 'list' repeatable; its level 'basic': one of
the few a run is set up with; its pick: what it names
on the board, for a front end to pick there
(kicad2ems.core.layout): 'net', 'part', or 'nets',
'parts' where it takes several (None: typed)
tag(values) a short name for a run of these settings (the rail,
the converter): its folder's
command(values, board, out, preview=False, results=None)
the command line that runs it, [program, argument
...], writing into folder `out`; values: {option key:
text, bool or list}; board: the study's board file or
None; results: {analysis: the folder of its latest
result on this board}, for an analysis that can start
from another's (the temperature from a circuit's
losses). ValueError says what is missing ("name the
rail")
missing(values, board, results=None)
what a run still needs, [dict(text, key)]: the default
is what command() raises
for_questions(values, asked)
its settings for a run that is asked only some of its
questions (the rail's drop without its impedance): the
values, changed where that matters
answers(values) the questions a run of these settings answers (one
started with none asked, from its settings alone);
the default is all it provides
status(line) the progress a line of its output states, or None
(most lines)
finds, discover(values, board), choices(text) what the board can propose
settings for ('converters': a front end's "Find
converters"), the command that lists them ([program,
argument ...]) and its output as [(label, {option key:
value})] to pick from; finds '': none
owns(folder, preview) whether the folder holds its result (its preview): by
default, that its result file is there. An engine
whose file another engine also writes looks inside
it. Asked of a folder whose mark does not say how
its run ended (made before marks kept that)
report(folder) what a result holds, to read: dict(title, summary,
sections=[dict(title, text, table= dict(columns=[...],
rows=[[...]], formats=[...]), notes=[...])], notes,
images, footer), or None; a cell is a number or a
string, formats give a number's format per column
('.3g'; None: '.4g'). It may say where a viewer
starts: show=dict(field, run) (the dump of that field,
and run, with the largest values) and mesh (the plan's
mesh)
curves(folder) what a result holds, to plot: [dict(title, xlabel,
ylabel, logx, logy, info, curves= [dict(name, x, y,
role='data' | 'reference' | 'limit', unit)])], or []
figures(folder) the figures of its answer by name, [dict(name, value,
unit)], for a table of engines against figures: two
engines that answer one question give the same
quantity the same name (the question says which:
study.Question.figures), and may add their own
suggest(folder) settings a result proposes for other analyses:
[dict(to, label, values, note, need)] (a converter's
input rail, for the power-integrity analysis; the
converter as a model, for the circuit's), or []; need:
the options it could not give a value, to set before a
run. A front end offers each on the result, and asks
the other's questions with it
examples() the examples it ships: [dict(name, config, group,
title, files)] (kicad2ems.examples)
The fields of a result (the maps a Viewer turns and cuts) need nothing here: an
analysis writes them as field dumps (kicad2ems.core.fields.dumps: Dump,
write_info, write_npz) under <out>/<name>/exc_<what>/ with its board as
<out>/<name>_board.json, and every front end that shows a run's dumps shows
them.