kicad2ems.gui.study

The study: one board, the questions asked of it, who answers each, and the runs
that takes.

    TREE                        what the list shows: kicad2ems's study_tree (the
                                questions by group, each with the engines
                                that answer it)
    title(key), key_of(step)    a run's name ('rf': S-parameters); the run a
                                Step of kicad2ems's plan is
    StudyModel                  the study itself, with no window: what can be
                                asked, what is, who answers each question, the
                                Fields ticks, what cannot run here and why, each
                                run's state, and the Steps a Run takes
                                (kicad2ems.core.study.plan)
    StudyTree                   the list in the Study dock (studytree.py: the
                                model's view): a row per question, with a tick
                                (it is asked), who answers it (a menu: one
                                engine, or several to compare), a tick for its
                                field dumps where an engine can write them, and
                                its state

A question is something to find out (kicad2ems.core.study: the ports'
S-parameters, a rail's drop, the temperature); an engine is a solver or an
analysis that answers it. The three RF questions are answered by the
solvers, together, as kicad2ems's one run; every other engine is a run of its
own, in the registry's order, which is also a run's: Thermal, which takes its
losses from the latest circuit run unless they are typed, runs after Circuit.
The plan, and an analysis's `needs` (one not made when what it needs did not
finish: core.study.unmet), are kicad2ems's own, as `kicad2ems study` has them.

Nothing in this module needs Qt (or a display): a program that drives a study
without the window (kicad2ems-ipc, a test) imports it alone.
class kicad2ems.gui.study.StudyModel(tree=None)[source]
The study with no window: the questions by group with the engines that
answer each (TREE as it is when this is made), and what the
user has made of them:

    on       the questions ticked
    choice   {question: [engine names]}: who answers ([]: its default, the
             first that can run here)
    fields   {question: its Fields tick}
    solvers  {name: ticked} of the solvers and 'auto', as the RF settings
             have them; None: not known
    why      {run: why it cannot be made here}
    states   {run: (text, tone)}

A run is an engine's, so availability, state and the queue go by run ('rf',
or an analysis's name), and a question shows those of its engines. Every
change calls each of `listeners` with what changed ('ticks', 'engines',
'fields', 'available', 'state', 'study') and the question or run it was
(None: several).
ask(key, questions=None)[source]
The questions a run answers asked too (those that can be, by that run
where it is one of several engines: the others stay as they are): what a
result proposed for it is to be run. questions: those of them its
settings answer (Analysis.answers), default all.
asked()[source]
{question: [engine names]} of the questions ticked, in the list's
order: the engines chosen, [] for its default (a solver question: the
solvers ticked, which the settings hold).
asked_fields()[source]
{question: its Fields tick} of the questions asked that have one.
asked_of(key, only=None)[source]
The questions asked of a run ('rf' or an analysis), in the list's
order.
by(q)[source]
A question's 'Answered by' as a list shows it: (text, tooltip,
whether there is a choice to make).
can_dump(q)[source]
Whether a question's engines, as chosen, can write field dumps.
choose(q, name, on)[source]
Tick or untick an engine of a question that analyses answer ('auto':
its default alone). The variants of one analysis are one run: ticking
one unticks the others.
clear_states()[source]
Another board: the last one's runs say nothing of it.
engine_of(key)[source]
The name of the engine chosen for a run (a variant's:
crosstalk_gfdtd; the run's own name when none is).
engines_for(q)[source]
The analyses that answer a question as it stands: those chosen that
can run here, else its first that can. A solver question: none (the
solvers ticked answer it, in kicad2ems's own run).
fields_on(key)[source]
Whether a run's field dumps are asked for: a Fields tick on one of
its questions.
jobs(preview=False, only=None)[source]
The runs (their keys) the questions asked take, in order:
steps'.
panels_of(q)[source]
The runs whose settings a question shows: 'rf' for the solvers', else
its engines' (those chosen, or its default; all of them where none can
run, so that their settings can still be read).
run_of(q)[source]
The run a question's settings and page belong to: 'rf', or its first
engine's.
runs_for(q)[source]
The runs (analyses) of the engines that answer a question as it
stands: engines_for's, a variant as the analysis it runs.
set_available(key, ok, why='')[source]
A run that cannot be made here: its engine is not offered, and a
question nobody else answers cannot be asked (it is unticked), its state
saying why.
set_fields(q, on)[source]
A question's Fields tick, as its settings say (no default filled in:
they hold what is asked). True: it changed.
set_solvers(ticked)[source]
The solvers' ticks ({name: bool}, 'auto' among them), as the RF
settings have them.
set_state(key, text, tone='')[source]
A run's state ('running', 'done 21:42', 'failed (exit 2)', 'not
started: no rail'); tone: '', 'gray' or 'bad'.
set_study(study)[source]
The ticks, the engines and the Fields ticks of a Study (a config's):
a question it does not ask unticked. An engine the registry does not
list is left out; a solver question's solvers are the settings'.
sets_of(key)[source]
The settings the engine chosen for a run fixes (a variant's: the
crosstalk's full-wave check), {} for none.
solver_names(q)[source]
The solvers ticked that answer a solver question, and whether auto
is.
state(key)[source]
A run's state as it was set.
state_of(q)[source]
A question's state as a list shows it, from its engines' runs: (text,
tooltip, tone).
steps(preview=False, only=None)[source]
The runs the questions asked take, in order (kicad2ems.core.study's
plan: [Step]): the solvers' (one run) when an RF question is asked,
then each analysis engine's in the registry's order; those that cannot
run here left out. preview: those that have one. only: a question (or
a run) alone, ticked or not.
study()[source]
The study as kicad2ems holds one (a config's [study] tables).
study_of_runs(keys)[source]
The Study in which the questions these runs answer are asked, each by
that engine: 'rf' is S-parameters.
tick(q, on=True)[source]
Ask a question, or not (one that cannot be asked here stays
unasked).
ticked()[source]
The runs of the questions asked, in order.
usable(q)[source]
The engines of a question that can run here, in their order.
why_not(q, name)[source]
Why an engine of a question cannot run here ('' it can): its own
reason (a variant's solver missing) or its run's.
kicad2ems.gui.study.key_of(step)[source]
The run a Step of the plan (kicad2ems.core.study.plan) is in the
window: 'rf' for the solvers', else its analysis's name (a variant's: the
analysis it is one of).
kicad2ems.gui.study.run_key(e)[source]
The run an analysis engine makes: its analysis's name (a variant's:
the analysis it is one of); None for none.
kicad2ems.gui.study.title(key)[source]
A run's name as the window shows it: 'S-parameters', an analysis's
label.
kicad2ems.gui.study.tree()[source]
What the list shows: kicad2ems's study_tree, [dict(group,
questions=[dict(question, engines, missing)])].