starplast.guided_panel
The Start-here tab: one question at a time, ending at the strategies worth running.
Beside the Strategies tab, which is left exactly as it was. The Strategies tab answers "what is there"; this one answers "where do I begin", for someone who arrives with a gene list from a screen, their own measurement, or nothing but curiosity.
question one per screen, in a few plain words, with large choices and nothing else on the
screen to read; a gene step searches, a gene-list step pastes, loads, takes the
genes gated on the map or offers a real example, and a column step shows each
column's coverage so an almost-empty one is never picked by accident
trail every answer so far along the top, each one a button back to the question that
asked it, so nothing is a one-way door
the end three to six recommended strategies, each as the card summary the Strategies tab
already shows -- name, method, calibration grade and the same four headline bars
(`strategy_panel.headline`, `strategy_card`, `scorecard.HEADLINE`) -- with one line
on why it is recommended, and Run it here / Open in Strategies
The questions and the ranking are :mod:starplast.guided, which holds no Qt: this module draws
them and nothing more. It also holds no window: it emits what the user asked for (run_strategy,
open_strategy, open_view) and :func:install wires those to the application's strategy panel
and docks, which is what lets the whole panel be built and walked in a test with no window at all.
One answer, as a wide flat row: its label, its coverage or kind on the right, and a border.
Painted rather than styled so the row reads the same on all four themes and so the detail can be dimmer than the label, which a single stylesheet on a QPushButton cannot do.
A frame whose height follows from its width, which is what wrapped text needs in a scroller.
A QScrollArea sizes its contents to their minimum height, and a word-wrapped QLabel has no
minimum height until its width is known: without this the recommendation cards collapsed on top
of one another and their buttons vanished. Declaring height-for-width and handing the question
to the card's own layout is Qt's answer to that, and GuidedPanel._fit_body asks the same
question of the column of cards.
How tall this card must be at width, as its own layout works it out.
One recommended strategy, as the Strategies tab's card summarises it, plus why and Run.
The four bars are scorecard.headline_bars drawn by strategy_card.Scorecard, filled from
strategy_panel.headline -- the same numbers the Strategies tab shows for the same strategy,
computed in one place rather than two.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
Inherited Members
The guided tab: the current question, the trail of answers, and the recommendations.
Build the panel over one organism's context; other spaces are loaded if they are asked
for. gated is a callable returning the gene ids gated on the map, or None.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.
The table the questions are asked of: the space chosen, or the one this panel was built on until one is.
Answer one question and move on. Later answers are dropped, since they followed it.
Forget every answer that came after step, which a changed answer has invalidated.
Wrapped text is taller in a narrow panel, so the scrolled column is measured again.
Apply the card stylesheet of the theme and text size in force; True if it changed.
Put a gene list in the box (and say how many landed); for the buttons and for tests.
Fill the gene box from a text or CSV file. Returns how many identifiers were read.
Add the Start-here tab to the main window, beside Strategies, and wire what it asks for.
Everything it emits is carried out by the panels that already do those things: a strategy is selected, filled in and run in the Strategies tab, so it appears in the Jobs panel and its tables land where every other strategy's tables land; a view request raises that dock.