|
CellModules
|
Public Member Functions | |
| def | __init__ (self, str db_path, bool readonly=True) |
| def | close (self) |
| list[str] | studies (self) |
| str | trial_to_study (self, int trial_id) |
| dict[str, Any] | study_attrs (self, str study_name) |
| pd.DataFrame | trial_attrs (self, str study_name, Optional[str] key=None) |
| pd.DataFrame | fitness_long (self, Optional[str] study_name=None) |
| pd.DataFrame | fitness_wide (self, Optional[str] study_name=None) |
| pd.DataFrame | params (self, Optional[str] study_name=None) |
| pd.DataFrame | get_trial_timeseries (self, str key, study_name=None, trial_ids=None) |
| pd.DataFrame | get_trial_data (self, str key, study_name=None, trial_ids=None, raw=False, sep='.') |
| Any | context_value (self, str name) |
| dict[str, Any] | load_context (self) |
| dict[str, Any] | get_trial_params_flat (self, int trial_id) |
| def | build_params (self, int trial_id) |
| def | plot_param_distributions (self, float fitness_threshold=1500, int objective=0, study_name=None, trial_ids=None, float figsize_width=11, float row_height=0.42, float min_fig_height=3.0, int label_fontsize=8, float min_cat_label_width=0.08, int max_cat_label_len=14) |
Public Attributes | |
| db_path | |
| con | |
| suggest_fn | |
| run_fn | |
| eval_fn | |
Static Public Attributes | |
| string | CONTEXT_ID = "__default__" |
Private Member Functions | |
| def | _normalize_ids (self, x, cast=int, name="ids") |
| def | _sql_in_clause (self, values) |
| bool | _has_isicell_tables (self) |
| list[tuple[str, str, str]] | _read_isicell_context_rows (self) |
| dict[str, str] | _read_isicell_entrypoints (self) |
Static Private Member Functions | |
| Any | _decode_json_runtime_value (Any v) |
| Any | _coerce_param_value (Any x) |
Read-only Optuna SQLite helper (fast SQL) + archived function loading (exec) + replay-ready helpers. Context and entrypoints are read from custom tables: - isicell_context - isicell_context_entrypoints Study-specific metadata (axes, timeseries specs, etc.) remains in study_user_attributes.
Definition at line 565 of file OptunaWrapper.py.
| def pythonlib.OptunaWrapper.OptunaDB.__init__ | ( | self, | |
| str | db_path, | ||
| bool | readonly = True |
||
| ) |
Definition at line 578 of file OptunaWrapper.py.
|
staticprivate |
Definition at line 1139 of file OptunaWrapper.py.
|
staticprivate |
Definition at line 1071 of file OptunaWrapper.py.
|
private |
Definition at line 1022 of file OptunaWrapper.py.
|
private |
Normalize None | scalar | iterable -> None | list[cast(x)]. Strings are treated as scalars (not iterables).
Definition at line 741 of file OptunaWrapper.py.
|
private |
Returns rows: (key, mode, payload) for CONTEXT_ID.
Definition at line 1033 of file OptunaWrapper.py.
|
private |
Returns {"suggest": "optim", "run": "run_simu", ...}
Definition at line 1050 of file OptunaWrapper.py.
|
private |
Returns ('(?,?,?)', [..]) for SQL IN clauses.
values must be a non-empty list.
Definition at line 760 of file OptunaWrapper.py.
| def pythonlib.OptunaWrapper.OptunaDB.build_params | ( | self, | |
| int | trial_id | ||
| ) |
Rebuild structured params from flat optuna params using archived suggest_fn. Handles categorical params stored as category indices.
Definition at line 1175 of file OptunaWrapper.py.
| def pythonlib.OptunaWrapper.OptunaDB.close | ( | self | ) |
Definition at line 597 of file OptunaWrapper.py.
| Any pythonlib.OptunaWrapper.OptunaDB.context_value | ( | self, | |
| str | name | ||
| ) |
Return a data object from the shared isicell context (json/pickle only).
Definition at line 1081 of file OptunaWrapper.py.
| pd.DataFrame pythonlib.OptunaWrapper.OptunaDB.fitness_long | ( | self, | |
| Optional[str] | study_name = None |
||
| ) |
Definition at line 669 of file OptunaWrapper.py.
| pd.DataFrame pythonlib.OptunaWrapper.OptunaDB.fitness_wide | ( | self, | |
| Optional[str] | study_name = None |
||
| ) |
Definition at line 694 of file OptunaWrapper.py.
| pd.DataFrame pythonlib.OptunaWrapper.OptunaDB.get_trial_data | ( | self, | |
| str | key, | ||
study_name = None, |
|||
trial_ids = None, |
|||
raw = False, |
|||
sep = '.' |
|||
| ) |
Definition at line 947 of file OptunaWrapper.py.
| dict[str, Any] pythonlib.OptunaWrapper.OptunaDB.get_trial_params_flat | ( | self, | |
| int | trial_id | ||
| ) |
Definition at line 1161 of file OptunaWrapper.py.
| pd.DataFrame pythonlib.OptunaWrapper.OptunaDB.get_trial_timeseries | ( | self, | |
| str | key, | ||
study_name = None, |
|||
trial_ids = None |
|||
| ) |
Definition at line 769 of file OptunaWrapper.py.
| dict[str, Any] pythonlib.OptunaWrapper.OptunaDB.load_context | ( | self | ) |
Build exec namespace from shared isicell_context + caller namespace. Source-backed symbols are exec'ed into the same namespace. Entrypoints are resolved from isicell_context_entrypoints.
Definition at line 1102 of file OptunaWrapper.py.
| pd.DataFrame pythonlib.OptunaWrapper.OptunaDB.params | ( | self, | |
| Optional[str] | study_name = None |
||
| ) |
Definition at line 708 of file OptunaWrapper.py.
| def pythonlib.OptunaWrapper.OptunaDB.plot_param_distributions | ( | self, | |
| float | fitness_threshold = 1500, |
||
| int | objective = 0, |
||
study_name = None, |
|||
trial_ids = None, |
|||
| float | figsize_width = 11, |
||
| float | row_height = 0.42, |
||
| float | min_fig_height = 3.0, |
||
| int | label_fontsize = 8, |
||
| float | min_cat_label_width = 0.08, |
||
| int | max_cat_label_len = 14 |
||
| ) |
Plot normalized distributions of selected trials' parameters: - numeric params: violin plots on x in [0, 1] - categorical params: stacked horizontal bars of frequencies on x in [0, 1] Selection logic: - keep completed trials with fitness(objective) < fitness_threshold - optional filter by study_name and/or trial_ids Notes ----- - Requires self.suggest_fn (loaded from isicell context) to infer param bounds/types. - Assumes categorical params in trial_params are stored as category indices (Optuna/LHSIterator path). - Uses seaborn + matplotlib (imported lazily).
Definition at line 1202 of file OptunaWrapper.py.
| list[str] pythonlib.OptunaWrapper.OptunaDB.studies | ( | self | ) |
Definition at line 603 of file OptunaWrapper.py.
| dict[str, Any] pythonlib.OptunaWrapper.OptunaDB.study_attrs | ( | self, | |
| str | study_name | ||
| ) |
Definition at line 621 of file OptunaWrapper.py.
| pd.DataFrame pythonlib.OptunaWrapper.OptunaDB.trial_attrs | ( | self, | |
| str | study_name, | ||
| Optional[str] | key = None |
||
| ) |
Definition at line 633 of file OptunaWrapper.py.
| str pythonlib.OptunaWrapper.OptunaDB.trial_to_study | ( | self, | |
| int | trial_id | ||
| ) |
Definition at line 607 of file OptunaWrapper.py.
| pythonlib.OptunaWrapper.OptunaDB.con |
Definition at line 581 of file OptunaWrapper.py.
|
static |
Definition at line 576 of file OptunaWrapper.py.
| pythonlib.OptunaWrapper.OptunaDB.db_path |
Definition at line 579 of file OptunaWrapper.py.
| pythonlib.OptunaWrapper.OptunaDB.eval_fn |
Definition at line 587 of file OptunaWrapper.py.
| pythonlib.OptunaWrapper.OptunaDB.run_fn |
Definition at line 586 of file OptunaWrapper.py.
| pythonlib.OptunaWrapper.OptunaDB.suggest_fn |
Definition at line 585 of file OptunaWrapper.py.