omnipy.data.multi
| CLASS | DESCRIPTION |
|---|---|
MultiModelDataset |
Variant of Dataset that allows custom models to be set on individual data files |
MultiModelDataset
Bases: Dataset[_GeneralModelT], Generic[_GeneralModelT]
Variant of Dataset that allows custom models to be set on individual data files
Note that the general model still needs to hold for all data files, in addition to any custom models.
| CLASS | DESCRIPTION |
|---|---|
Config |
|
| METHOD | DESCRIPTION |
|---|---|
__init__ |
|
absorb |
|
absorb_and_replace |
|
as_multi_model_dataset |
|
browse |
Opens the model or dataset in a browser, if possible. |
clone_dataset_cls |
|
copy |
|
deepcopy_context |
|
default_repr_to_terminal_str |
|
dict |
|
do |
|
failed_task_details |
|
from_data |
|
from_json |
|
full |
Display the content of the Model or Dataset in full height. |
get_model |
|
get_type |
Returns the concrete type (Model or Dataset class) used for all |
json |
Preview the data content of the Model or Dataset as JSON. |
list |
Displays a summary list of all models in the dataset. |
load |
|
load_into |
|
peek |
Display a preview of the Model or Dataset content. |
pending_task_details |
|
save |
|
set_model |
|
to |
|
to_data |
|
to_json |
|
to_json_schema |
|
update_forward_refs |
|
validate |
Hack to allow overwriting of iter method without compromising pydantic validation. Part |
| ATTRIBUTE | DESCRIPTION |
|---|---|
available_data |
TYPE:
|
config |
TYPE:
|
data |
TYPE:
|
failed_data |
TYPE:
|
pending_data |
TYPE:
|
reactive_objects |
TYPE:
|
snapshot_holder |
TYPE:
|
Source code in src/omnipy/data/multi.py
Config
| ATTRIBUTE | DESCRIPTION |
|---|---|
arbitrary_types_allowed |
|
validate_assignment |
|
Source code in src/omnipy/data/dataset.py
__init__
__init__(
value: Mapping[str, object] | Iterable[tuple[str, object]] | UndefinedType = Undefined,
*,
data: Mapping[str, object] | UndefinedType = Undefined,
**kwargs: object,
) -> None
Source code in src/omnipy/data/dataset.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
absorb
absorb(other: Dataset)
absorb_and_replace
absorb_and_replace(other: Dataset)
as_multi_model_dataset
as_multi_model_dataset() -> IsMultiModelDataset[_ModelOrDatasetT]
Source code in src/omnipy/data/dataset.py
browse
browse(
*,
width: pyd.NonNegativeInt | None = None,
height: pyd.NonNegativeInt | None = None,
tab: pyd.NonNegativeInt = 4,
indent: pyd.NonNegativeInt = 2,
printer: PrettyPrinterLib.Literals = "auto",
syntax: SyntaxLanguageSpec.Literals | str = "auto",
freedom: pyd.NonNegativeFloat | None = 2.5,
debug: bool = False,
ui: UserInterfaceType.Literals = "auto",
system: DisplayColorSystem.Literals = "auto",
style: AllColorStyles.Literals | str = "auto",
dark: Literal = "auto",
bg: bool = False,
fonts: tuple = ("Menlo", "DejaVu Sans Mono", "Consolas", "Courier New", "monospace"),
font_size: pyd.NonNegativeInt | None = 14,
font_weight: pyd.NonNegativeInt | None = 400,
line_height: pyd.NonNegativeFloat | None = 1.25,
h_overflow: HorizontalOverflowMode.Literals = "ellipsis",
v_overflow: VerticalOverflowMode.Literals = "ellipsis_bottom",
panel: PanelDesign.Literals = "table",
title_at_top: bool = True,
max_title_height: MaxTitleHeight.Literals = -1,
min_panel_width: pyd.NonNegativeInt = 3,
min_crop_width: pyd.NonNegativeInt = 33,
use_min_crop_width: bool = False,
max_panels_hor: pyd.NonNegativeInt | None = 9,
max_nesting_depth: pyd.NonNegativeInt | None = 3,
justify: Justify.Literals = "left",
) -> None
Opens the model or dataset in a browser, if possible.
For models, this is a detailed view of the model's content, and for datasets this is a detailed view of each model contained in the dataset, one model per browser tab.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
Width in characters of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
height
|
Height in lines of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
tab
|
Number of spaces to use for each tab.
TYPE:
|
indent
|
Number of spaces to use for each indentation level.
TYPE:
|
printer
|
Library to use for pretty printing.
TYPE:
|
syntax
|
Syntax language for code highlighting. Supported lexers are defined in SyntaxLanguageSpec. For non-supported styles, the user can specify a string with the Pygments lexer name. For this to work, the lexer must be registered in the Pygments library.
TYPE:
|
freedom
|
Parameter that controls the level of freedom for formatted text to follow the geometry of the frame size (=total available area) in a proportional manner. If the proportional freedom is 0 (the lowest), then the output area must not in any case be proportionally wider that the frame (i.e. a 16/9 frame will only produce output that is 16/9 or narrower). Larger values of proportional freedom allow the output to be proportionally wider than the total available frame, to a degree that relates to the size difference between the frame and the content (larger difference gives more freedom). The default value of 2.5 is a good compromise between readability/aesthetics and good use of the screen estate. If None, the freedom is unlimited (i.e. proportionality is not taken into account at all).
TYPE:
|
debug
|
When True, enables additional debugging information in
the output, such as the hierarchy of the Model
objects. Currently, only Python pretty printers support
debug=True. Hence, enabling debug mode will
automatically set the printer to the default Python
pretty printer if the
TYPE:
|
ui
|
Type of user interface for which the output should being prepared. The user interface describes the technical solutions available for interacting with the user, encompassing the support available for displaying output as well as how the user interacts with the library (including the type of interactive interpreter used, if any).
TYPE:
|
system
|
Color system to use for terminal output. The default
is
TYPE:
|
style
|
Color style/theme for syntax highlighting and other
display elements. Supported styles are defined in
AllColorStyles. For non-supported styles, the user can
specify a string with the Pygments style name. For this to
work, the style must be registered in the Pygments
library. If style is
TYPE:
|
dark
|
Whether the background color of the output is dark. This is used to determine the appropriate color scheme for syntax highlighting. The default is AUTO, which automatically tries to detect whether the background is dark. Capability of auto-detection depends on the user interface.
TYPE:
|
bg
|
If False, uses transparent background for the output. In the case of terminal output, the background color will be the current background color of the terminal. For HTML output, the background color will be automatically set to pure black or pure white, depending on the luminosity of the foreground color.
TYPE:
|
fonts
|
Font families to use in HTML output, in order of preference (empty tuple for browser default).
TYPE:
|
font_size
|
Font size in pixels for HTML output (None for browser default).
TYPE:
|
font_weight
|
Font weight for HTML output (None for browser default).
TYPE:
|
line_height
|
Line height multiplier for HTML output (None for browser default).
TYPE:
|
h_overflow
|
How to handle text that exceeds the width.
TYPE:
|
v_overflow
|
How to handle text that exceeds the height.
TYPE:
|
panel
|
Visual design of the panel used as container for the
output. Only
TYPE:
|
title_at_top
|
Whether panel titles will be displayed over the panel content (True) or below the content (False)
TYPE:
|
max_title_height
|
Maximum height of the panel title. If
TYPE:
|
min_panel_width
|
Minimum width in characters per panel.
TYPE:
|
min_crop_width
|
Minimum cropping width in characters for panels in
cases where more than one panel are to be displayed.
This is for instance used to calculate the number of
models to display in a Dataset peek(). Only applied if
TYPE:
|
use_min_crop_width
|
Whether the
TYPE:
|
max_panels_hor
|
Maximum number of panels to display horizontally
side-by-side at the top level. This value also acts as
a ceiling for nested panels; nested panels cannot
exceed this limit even if the constant
TYPE:
|
max_nesting_depth
|
Maximum levels of nested panels to display. If None, there is no limit.
TYPE:
|
justify
|
Justification mode for the panel if inside a layout panel. This is only used for the panel content. |
Source code in src/omnipy/data/_mixins/display.py
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 | |
clone_dataset_cls
classmethod
clone_dataset_cls(
new_dataset_cls_name: str, model_cls: type[_NewModelT] | None = None
) -> type[Self]
Source code in src/omnipy/data/dataset.py
copy
Source code in src/omnipy/data/dataset.py
deepcopy_context
deepcopy_context(
top_level_entry_func: Callable[[], None], top_level_exit_func: Callable[[], None]
) -> ContextManager[int]
Source code in src/omnipy/data/_data_class_creator.py
default_repr_to_terminal_str
default_repr_to_terminal_str(ui_type: TerminalOutputUserInterfaceType.Literals) -> str
Source code in src/omnipy/data/_mixins/display.py
dict
dict(**kwargs) -> dict_t[str, Any]
do
do(placeholder: F) -> Dataset[_ModelOrDatasetT]
failed_task_details
failed_task_details() -> dict[str, IsFailedData]
from_data
Source code in src/omnipy/data/multi.py
from_json
Source code in src/omnipy/data/dataset.py
full
full(
*,
width: pyd.NonNegativeInt | None = None,
height: pyd.NonNegativeInt | None = None,
tab: pyd.NonNegativeInt = 4,
indent: pyd.NonNegativeInt = 2,
printer: PrettyPrinterLib.Literals = "auto",
syntax: SyntaxLanguageSpec.Literals | str = "auto",
freedom: pyd.NonNegativeFloat | None = 2.5,
debug: bool = False,
ui: UserInterfaceType.Literals = "auto",
system: DisplayColorSystem.Literals = "auto",
style: AllColorStyles.Literals | str = "auto",
dark: Literal = "auto",
bg: bool = False,
fonts: tuple = ("Menlo", "DejaVu Sans Mono", "Consolas", "Courier New", "monospace"),
font_size: pyd.NonNegativeInt | None = 14,
font_weight: pyd.NonNegativeInt | None = 400,
line_height: pyd.NonNegativeFloat | None = 1.25,
h_overflow: HorizontalOverflowMode.Literals = "ellipsis",
v_overflow: VerticalOverflowMode.Literals = "ellipsis_bottom",
panel: PanelDesign.Literals = "table",
title_at_top: bool = True,
max_title_height: MaxTitleHeight.Literals = -1,
min_panel_width: pyd.NonNegativeInt = 3,
min_crop_width: pyd.NonNegativeInt = 33,
use_min_crop_width: bool = False,
max_panels_hor: pyd.NonNegativeInt | None = 9,
max_nesting_depth: pyd.NonNegativeInt | None = 3,
justify: Justify.Literals = "left",
) -> Element | None
Display the content of the Model or Dataset in full height.
full() is a shorthand for peek(height=None) for both
models and datasets. Both full-height views are automatically
limited in width by the available display dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
Width in characters of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
height
|
Height in lines of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
tab
|
Number of spaces to use for each tab.
TYPE:
|
indent
|
Number of spaces to use for each indentation level.
TYPE:
|
printer
|
Library to use for pretty printing.
TYPE:
|
syntax
|
Syntax language for code highlighting. Supported lexers are defined in SyntaxLanguageSpec. For non-supported styles, the user can specify a string with the Pygments lexer name. For this to work, the lexer must be registered in the Pygments library.
TYPE:
|
freedom
|
Parameter that controls the level of freedom for formatted text to follow the geometry of the frame size (=total available area) in a proportional manner. If the proportional freedom is 0 (the lowest), then the output area must not in any case be proportionally wider that the frame (i.e. a 16/9 frame will only produce output that is 16/9 or narrower). Larger values of proportional freedom allow the output to be proportionally wider than the total available frame, to a degree that relates to the size difference between the frame and the content (larger difference gives more freedom). The default value of 2.5 is a good compromise between readability/aesthetics and good use of the screen estate. If None, the freedom is unlimited (i.e. proportionality is not taken into account at all).
TYPE:
|
debug
|
When True, enables additional debugging information in
the output, such as the hierarchy of the Model
objects. Currently, only Python pretty printers support
debug=True. Hence, enabling debug mode will
automatically set the printer to the default Python
pretty printer if the
TYPE:
|
ui
|
Type of user interface for which the output should being prepared. The user interface describes the technical solutions available for interacting with the user, encompassing the support available for displaying output as well as how the user interacts with the library (including the type of interactive interpreter used, if any).
TYPE:
|
system
|
Color system to use for terminal output. The default
is
TYPE:
|
style
|
Color style/theme for syntax highlighting and other
display elements. Supported styles are defined in
AllColorStyles. For non-supported styles, the user can
specify a string with the Pygments style name. For this to
work, the style must be registered in the Pygments
library. If style is
TYPE:
|
dark
|
Whether the background color of the output is dark. This is used to determine the appropriate color scheme for syntax highlighting. The default is AUTO, which automatically tries to detect whether the background is dark. Capability of auto-detection depends on the user interface.
TYPE:
|
bg
|
If False, uses transparent background for the output. In the case of terminal output, the background color will be the current background color of the terminal. For HTML output, the background color will be automatically set to pure black or pure white, depending on the luminosity of the foreground color.
TYPE:
|
fonts
|
Font families to use in HTML output, in order of preference (empty tuple for browser default).
TYPE:
|
font_size
|
Font size in pixels for HTML output (None for browser default).
TYPE:
|
font_weight
|
Font weight for HTML output (None for browser default).
TYPE:
|
line_height
|
Line height multiplier for HTML output (None for browser default).
TYPE:
|
h_overflow
|
How to handle text that exceeds the width.
TYPE:
|
v_overflow
|
How to handle text that exceeds the height.
TYPE:
|
panel
|
Visual design of the panel used as container for the
output. Only
TYPE:
|
title_at_top
|
Whether panel titles will be displayed over the panel content (True) or below the content (False)
TYPE:
|
max_title_height
|
Maximum height of the panel title. If
TYPE:
|
min_panel_width
|
Minimum width in characters per panel.
TYPE:
|
min_crop_width
|
Minimum cropping width in characters for panels in
cases where more than one panel are to be displayed.
This is for instance used to calculate the number of
models to display in a Dataset peek(). Only applied if
TYPE:
|
use_min_crop_width
|
Whether the
TYPE:
|
max_panels_hor
|
Maximum number of panels to display horizontally
side-by-side at the top level. This value also acts as
a ceiling for nested panels; nested panels cannot
exceed this limit even if the constant
TYPE:
|
max_nesting_depth
|
Maximum levels of nested panels to display. If None, there is no limit.
TYPE:
|
justify
|
Justification mode for the panel if inside a layout panel. This is only used for the panel content. |
| RETURNS | DESCRIPTION |
|---|---|
Element | None
|
If the UI type is Jupyter running in browser, the method returns a ReactivelyResizingHtml element which is a Jupyter widget to display HTML output in the browser. Otherwise, the method returns None. |
Note
Any default argument value is overridden by the corresponding value in the relevant subsection of the UserInterfaceConfig.
Source code in src/omnipy/data/_mixins/display.py
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 | |
get_model
get_model(data_file: str) -> type[Model]
get_type
cached
classmethod
Returns the concrete type (Model or Dataset class) used for all
data files in the dataset, e.g.: Model[list[int]], or
Dataset[Model[dict[str, float]]] for nested datasets.
:return: The concrete type (Model or Dataset class) used for all
data files in the dataset.
Source code in src/omnipy/data/dataset.py
json
json(
*,
width: pyd.NonNegativeInt | None = None,
height: pyd.NonNegativeInt | None = None,
tab: pyd.NonNegativeInt = 4,
indent: pyd.NonNegativeInt = 2,
printer: PrettyPrinterLib.Literals = "auto",
syntax: SyntaxLanguageSpec.Literals | str = "auto",
freedom: pyd.NonNegativeFloat | None = 2.5,
debug: bool = False,
ui: UserInterfaceType.Literals = "auto",
system: DisplayColorSystem.Literals = "auto",
style: AllColorStyles.Literals | str = "auto",
dark: Literal = "auto",
bg: bool = False,
fonts: tuple = ("Menlo", "DejaVu Sans Mono", "Consolas", "Courier New", "monospace"),
font_size: pyd.NonNegativeInt | None = 14,
font_weight: pyd.NonNegativeInt | None = 400,
line_height: pyd.NonNegativeFloat | None = 1.25,
h_overflow: HorizontalOverflowMode.Literals = "ellipsis",
v_overflow: VerticalOverflowMode.Literals = "ellipsis_bottom",
panel: PanelDesign.Literals = "table",
title_at_top: bool = True,
max_title_height: MaxTitleHeight.Literals = -1,
min_panel_width: pyd.NonNegativeInt = 3,
min_crop_width: pyd.NonNegativeInt = 33,
use_min_crop_width: bool = False,
max_panels_hor: pyd.NonNegativeInt | None = 9,
max_nesting_depth: pyd.NonNegativeInt | None = 3,
justify: Justify.Literals = "left",
) -> Element | None
Preview the data content of the Model or Dataset as JSON.
In contrast to e.g. peek(), json() displays the "data
content" of the Model or Dataset, i.e. the content as plain
Python objects, potentially converted from the internal data
structure. This plain data is formatted in JSON (for
compactness). Hence json() represents a the basic
compatibility layer of all Omnipy Model or Dataset objects.
The view is automatically limited by the available display
dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
Width in characters of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
height
|
Height in lines of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
tab
|
Number of spaces to use for each tab.
TYPE:
|
indent
|
Number of spaces to use for each indentation level.
TYPE:
|
printer
|
Library to use for pretty printing.
TYPE:
|
syntax
|
Syntax language for code highlighting. Supported lexers are defined in SyntaxLanguageSpec. For non-supported styles, the user can specify a string with the Pygments lexer name. For this to work, the lexer must be registered in the Pygments library.
TYPE:
|
freedom
|
Parameter that controls the level of freedom for formatted text to follow the geometry of the frame size (=total available area) in a proportional manner. If the proportional freedom is 0 (the lowest), then the output area must not in any case be proportionally wider that the frame (i.e. a 16/9 frame will only produce output that is 16/9 or narrower). Larger values of proportional freedom allow the output to be proportionally wider than the total available frame, to a degree that relates to the size difference between the frame and the content (larger difference gives more freedom). The default value of 2.5 is a good compromise between readability/aesthetics and good use of the screen estate. If None, the freedom is unlimited (i.e. proportionality is not taken into account at all).
TYPE:
|
debug
|
When True, enables additional debugging information in
the output, such as the hierarchy of the Model
objects. Currently, only Python pretty printers support
debug=True. Hence, enabling debug mode will
automatically set the printer to the default Python
pretty printer if the
TYPE:
|
ui
|
Type of user interface for which the output should being prepared. The user interface describes the technical solutions available for interacting with the user, encompassing the support available for displaying output as well as how the user interacts with the library (including the type of interactive interpreter used, if any).
TYPE:
|
system
|
Color system to use for terminal output. The default
is
TYPE:
|
style
|
Color style/theme for syntax highlighting and other
display elements. Supported styles are defined in
AllColorStyles. For non-supported styles, the user can
specify a string with the Pygments style name. For this to
work, the style must be registered in the Pygments
library. If style is
TYPE:
|
dark
|
Whether the background color of the output is dark. This is used to determine the appropriate color scheme for syntax highlighting. The default is AUTO, which automatically tries to detect whether the background is dark. Capability of auto-detection depends on the user interface.
TYPE:
|
bg
|
If False, uses transparent background for the output. In the case of terminal output, the background color will be the current background color of the terminal. For HTML output, the background color will be automatically set to pure black or pure white, depending on the luminosity of the foreground color.
TYPE:
|
fonts
|
Font families to use in HTML output, in order of preference (empty tuple for browser default).
TYPE:
|
font_size
|
Font size in pixels for HTML output (None for browser default).
TYPE:
|
font_weight
|
Font weight for HTML output (None for browser default).
TYPE:
|
line_height
|
Line height multiplier for HTML output (None for browser default).
TYPE:
|
h_overflow
|
How to handle text that exceeds the width.
TYPE:
|
v_overflow
|
How to handle text that exceeds the height.
TYPE:
|
panel
|
Visual design of the panel used as container for the
output. Only
TYPE:
|
title_at_top
|
Whether panel titles will be displayed over the panel content (True) or below the content (False)
TYPE:
|
max_title_height
|
Maximum height of the panel title. If
TYPE:
|
min_panel_width
|
Minimum width in characters per panel.
TYPE:
|
min_crop_width
|
Minimum cropping width in characters for panels in
cases where more than one panel are to be displayed.
This is for instance used to calculate the number of
models to display in a Dataset peek(). Only applied if
TYPE:
|
use_min_crop_width
|
Whether the
TYPE:
|
max_panels_hor
|
Maximum number of panels to display horizontally
side-by-side at the top level. This value also acts as
a ceiling for nested panels; nested panels cannot
exceed this limit even if the constant
TYPE:
|
max_nesting_depth
|
Maximum levels of nested panels to display. If None, there is no limit.
TYPE:
|
justify
|
Justification mode for the panel if inside a layout panel. This is only used for the panel content. |
| RETURNS | DESCRIPTION |
|---|---|
Element | None
|
If the UI type is Jupyter running in browser, the method returns a ReactivelyResizingHtml element which is a Jupyter widget to display HTML output in the browser. Otherwise, the method returns None. |
Note
Any default argument value is overridden by the corresponding value in the relevant subsection of the UserInterfaceConfig.
Source code in src/omnipy/data/_mixins/display.py
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 | |
list
list(
*,
width: pyd.NonNegativeInt | None = None,
height: pyd.NonNegativeInt | None = None,
tab: pyd.NonNegativeInt = 4,
indent: pyd.NonNegativeInt = 2,
printer: PrettyPrinterLib.Literals = "auto",
syntax: SyntaxLanguageSpec.Literals | str = "auto",
freedom: pyd.NonNegativeFloat | None = 2.5,
debug: bool = False,
ui: UserInterfaceType.Literals = "auto",
system: DisplayColorSystem.Literals = "auto",
style: AllColorStyles.Literals | str = "auto",
dark: Literal = "auto",
bg: bool = False,
fonts: tuple = ("Menlo", "DejaVu Sans Mono", "Consolas", "Courier New", "monospace"),
font_size: pyd.NonNegativeInt | None = 14,
font_weight: pyd.NonNegativeInt | None = 400,
line_height: pyd.NonNegativeFloat | None = 1.25,
h_overflow: HorizontalOverflowMode.Literals = "ellipsis",
v_overflow: VerticalOverflowMode.Literals = "ellipsis_bottom",
panel: PanelDesign.Literals = "table",
title_at_top: bool = True,
max_title_height: MaxTitleHeight.Literals = -1,
min_panel_width: pyd.NonNegativeInt = 3,
min_crop_width: pyd.NonNegativeInt = 33,
use_min_crop_width: bool = False,
max_panels_hor: pyd.NonNegativeInt | None = 9,
max_nesting_depth: pyd.NonNegativeInt | None = 3,
justify: Justify.Literals = "left",
) -> Element | None
Displays a summary list of all models in the dataset.
The summary list includes a number of key properties for each model, including data file names, types, lengths, and sizes in memory. The output is automatically limited by the available display dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
Width in characters of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
height
|
Height in lines of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
tab
|
Number of spaces to use for each tab.
TYPE:
|
indent
|
Number of spaces to use for each indentation level.
TYPE:
|
printer
|
Library to use for pretty printing.
TYPE:
|
syntax
|
Syntax language for code highlighting. Supported lexers are defined in SyntaxLanguageSpec. For non-supported styles, the user can specify a string with the Pygments lexer name. For this to work, the lexer must be registered in the Pygments library.
TYPE:
|
freedom
|
Parameter that controls the level of freedom for formatted text to follow the geometry of the frame size (=total available area) in a proportional manner. If the proportional freedom is 0 (the lowest), then the output area must not in any case be proportionally wider that the frame (i.e. a 16/9 frame will only produce output that is 16/9 or narrower). Larger values of proportional freedom allow the output to be proportionally wider than the total available frame, to a degree that relates to the size difference between the frame and the content (larger difference gives more freedom). The default value of 2.5 is a good compromise between readability/aesthetics and good use of the screen estate. If None, the freedom is unlimited (i.e. proportionality is not taken into account at all).
TYPE:
|
debug
|
When True, enables additional debugging information in
the output, such as the hierarchy of the Model
objects. Currently, only Python pretty printers support
debug=True. Hence, enabling debug mode will
automatically set the printer to the default Python
pretty printer if the
TYPE:
|
ui
|
Type of user interface for which the output should being prepared. The user interface describes the technical solutions available for interacting with the user, encompassing the support available for displaying output as well as how the user interacts with the library (including the type of interactive interpreter used, if any).
TYPE:
|
system
|
Color system to use for terminal output. The default
is
TYPE:
|
style
|
Color style/theme for syntax highlighting and other
display elements. Supported styles are defined in
AllColorStyles. For non-supported styles, the user can
specify a string with the Pygments style name. For this to
work, the style must be registered in the Pygments
library. If style is
TYPE:
|
dark
|
Whether the background color of the output is dark. This is used to determine the appropriate color scheme for syntax highlighting. The default is AUTO, which automatically tries to detect whether the background is dark. Capability of auto-detection depends on the user interface.
TYPE:
|
bg
|
If False, uses transparent background for the output. In the case of terminal output, the background color will be the current background color of the terminal. For HTML output, the background color will be automatically set to pure black or pure white, depending on the luminosity of the foreground color.
TYPE:
|
fonts
|
Font families to use in HTML output, in order of preference (empty tuple for browser default).
TYPE:
|
font_size
|
Font size in pixels for HTML output (None for browser default).
TYPE:
|
font_weight
|
Font weight for HTML output (None for browser default).
TYPE:
|
line_height
|
Line height multiplier for HTML output (None for browser default).
TYPE:
|
h_overflow
|
How to handle text that exceeds the width.
TYPE:
|
v_overflow
|
How to handle text that exceeds the height.
TYPE:
|
panel
|
Visual design of the panel used as container for the
output. Only
TYPE:
|
title_at_top
|
Whether panel titles will be displayed over the panel content (True) or below the content (False)
TYPE:
|
max_title_height
|
Maximum height of the panel title. If
TYPE:
|
min_panel_width
|
Minimum width in characters per panel.
TYPE:
|
min_crop_width
|
Minimum cropping width in characters for panels in
cases where more than one panel are to be displayed.
This is for instance used to calculate the number of
models to display in a Dataset peek(). Only applied if
TYPE:
|
use_min_crop_width
|
Whether the
TYPE:
|
max_panels_hor
|
Maximum number of panels to display horizontally
side-by-side at the top level. This value also acts as
a ceiling for nested panels; nested panels cannot
exceed this limit even if the constant
TYPE:
|
max_nesting_depth
|
Maximum levels of nested panels to display. If None, there is no limit.
TYPE:
|
justify
|
Justification mode for the panel if inside a layout panel. This is only used for the panel content. |
| RETURNS | DESCRIPTION |
|---|---|
Element | None
|
If the UI type is Jupyter running in browser, the method returns a ReactivelyResizingHtml element which is a Jupyter widget to display HTML output in the browser. Otherwise, the method returns None. |
Note
Any default argument value is overridden by the corresponding value in the relevant subsection of the UserInterfaceConfig.
Source code in src/omnipy/data/_mixins/display.py
3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 | |
load
classmethod
load(
paths_or_urls: IsPathsOrUrlsOneOrMoreOrNone = None,
by_file_suffix: bool = False,
as_mime_type: None | str = None,
**kwargs: IsPathOrUrl,
) -> Self | asyncio.Task[Self]
Source code in src/omnipy/data/dataset.py
load_into
load_into(
paths_or_urls: IsPathsOrUrlsOneOrMoreOrNone = None,
by_file_suffix: bool = False,
as_mime_type: None | str = None,
**kwargs: IsPathOrUrl,
) -> Self | asyncio.Task[Self]
Source code in src/omnipy/data/dataset.py
peek
peek(
*,
width: pyd.NonNegativeInt | None = None,
height: pyd.NonNegativeInt | None = None,
tab: pyd.NonNegativeInt = 4,
indent: pyd.NonNegativeInt = 2,
printer: PrettyPrinterLib.Literals = "auto",
syntax: SyntaxLanguageSpec.Literals | str = "auto",
freedom: pyd.NonNegativeFloat | None = 2.5,
debug: bool = False,
ui: UserInterfaceType.Literals = "auto",
system: DisplayColorSystem.Literals = "auto",
style: AllColorStyles.Literals | str = "auto",
dark: Literal = "auto",
bg: bool = False,
fonts: tuple = ("Menlo", "DejaVu Sans Mono", "Consolas", "Courier New", "monospace"),
font_size: pyd.NonNegativeInt | None = 14,
font_weight: pyd.NonNegativeInt | None = 400,
line_height: pyd.NonNegativeFloat | None = 1.25,
h_overflow: HorizontalOverflowMode.Literals = "ellipsis",
v_overflow: VerticalOverflowMode.Literals = "ellipsis_bottom",
panel: PanelDesign.Literals = "table",
title_at_top: bool = True,
max_title_height: MaxTitleHeight.Literals = -1,
min_panel_width: pyd.NonNegativeInt = 3,
min_crop_width: pyd.NonNegativeInt = 33,
use_min_crop_width: bool = False,
max_panels_hor: pyd.NonNegativeInt | None = 9,
max_nesting_depth: pyd.NonNegativeInt | None = 3,
justify: Justify.Literals = "left",
) -> Element | None
Display a preview of the Model or Dataset content.
For Model instances, peek() displays a preview of the
model's content. For Dataset instances, peek() displays a
side-by-side view of each model contained in the dataset. Both
views are automatically limited by the available display
dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
Width in characters of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
height
|
Height in lines of the output area (None for auto-detect based on available display dimensions).
TYPE:
|
tab
|
Number of spaces to use for each tab.
TYPE:
|
indent
|
Number of spaces to use for each indentation level.
TYPE:
|
printer
|
Library to use for pretty printing.
TYPE:
|
syntax
|
Syntax language for code highlighting. Supported lexers are defined in SyntaxLanguageSpec. For non-supported styles, the user can specify a string with the Pygments lexer name. For this to work, the lexer must be registered in the Pygments library.
TYPE:
|
freedom
|
Parameter that controls the level of freedom for formatted text to follow the geometry of the frame size (=total available area) in a proportional manner. If the proportional freedom is 0 (the lowest), then the output area must not in any case be proportionally wider that the frame (i.e. a 16/9 frame will only produce output that is 16/9 or narrower). Larger values of proportional freedom allow the output to be proportionally wider than the total available frame, to a degree that relates to the size difference between the frame and the content (larger difference gives more freedom). The default value of 2.5 is a good compromise between readability/aesthetics and good use of the screen estate. If None, the freedom is unlimited (i.e. proportionality is not taken into account at all).
TYPE:
|
debug
|
When True, enables additional debugging information in
the output, such as the hierarchy of the Model
objects. Currently, only Python pretty printers support
debug=True. Hence, enabling debug mode will
automatically set the printer to the default Python
pretty printer if the
TYPE:
|
ui
|
Type of user interface for which the output should being prepared. The user interface describes the technical solutions available for interacting with the user, encompassing the support available for displaying output as well as how the user interacts with the library (including the type of interactive interpreter used, if any).
TYPE:
|
system
|
Color system to use for terminal output. The default
is
TYPE:
|
style
|
Color style/theme for syntax highlighting and other
display elements. Supported styles are defined in
AllColorStyles. For non-supported styles, the user can
specify a string with the Pygments style name. For this to
work, the style must be registered in the Pygments
library. If style is
TYPE:
|
dark
|
Whether the background color of the output is dark. This is used to determine the appropriate color scheme for syntax highlighting. The default is AUTO, which automatically tries to detect whether the background is dark. Capability of auto-detection depends on the user interface.
TYPE:
|
bg
|
If False, uses transparent background for the output. In the case of terminal output, the background color will be the current background color of the terminal. For HTML output, the background color will be automatically set to pure black or pure white, depending on the luminosity of the foreground color.
TYPE:
|
fonts
|
Font families to use in HTML output, in order of preference (empty tuple for browser default).
TYPE:
|
font_size
|
Font size in pixels for HTML output (None for browser default).
TYPE:
|
font_weight
|
Font weight for HTML output (None for browser default).
TYPE:
|
line_height
|
Line height multiplier for HTML output (None for browser default).
TYPE:
|
h_overflow
|
How to handle text that exceeds the width.
TYPE:
|
v_overflow
|
How to handle text that exceeds the height.
TYPE:
|
panel
|
Visual design of the panel used as container for the
output. Only
TYPE:
|
title_at_top
|
Whether panel titles will be displayed over the panel content (True) or below the content (False)
TYPE:
|
max_title_height
|
Maximum height of the panel title. If
TYPE:
|
min_panel_width
|
Minimum width in characters per panel.
TYPE:
|
min_crop_width
|
Minimum cropping width in characters for panels in
cases where more than one panel are to be displayed.
This is for instance used to calculate the number of
models to display in a Dataset peek(). Only applied if
TYPE:
|
use_min_crop_width
|
Whether the
TYPE:
|
max_panels_hor
|
Maximum number of panels to display horizontally
side-by-side at the top level. This value also acts as
a ceiling for nested panels; nested panels cannot
exceed this limit even if the constant
TYPE:
|
max_nesting_depth
|
Maximum levels of nested panels to display. If None, there is no limit.
TYPE:
|
justify
|
Justification mode for the panel if inside a layout panel. This is only used for the panel content. |
| RETURNS | DESCRIPTION |
|---|---|
Element | None
|
If the UI type is Jupyter running in browser, the method returns a ReactivelyResizingHtml element which is a Jupyter widget to display HTML output in the browser. Otherwise, the method returns None. |
Note
Any default argument value is overridden by the corresponding value in the relevant subsection of the UserInterfaceConfig.
Source code in src/omnipy/data/_mixins/display.py
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | |
pending_task_details
pending_task_details() -> dict[str, IsPendingData]
save
Source code in src/omnipy/data/dataset.py
set_model
set_model(data_file: str, model: type[Model]) -> None
Source code in src/omnipy/data/multi.py
to
to_data
to_data() -> dict_t[str, Any]
to_json
to_json(pretty=True) -> dict_t[str, str]
to_json_schema
classmethod
to_json_schema(pretty: bool = True) -> str | dict_t[str, str]
Source code in src/omnipy/data/dataset.py
update_forward_refs
classmethod
update_forward_refs(
calling_module: str | None = None, prev_visited_classes: set[type] | None = None, **localns: Any
) -> None
Source code in src/omnipy/data/dataset.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 | |
validate
classmethod
Hack to allow overwriting of iter method without compromising pydantic validation. Part of the pydantic API and not the Omnipy API.