omnipy.data.dataset
| CLASS | DESCRIPTION |
|---|---|
Dataset |
Dict-based container of data files that follow a specific Model |
| FUNCTION | DESCRIPTION |
|---|---|
is_dataset_instance |
|
is_dataset_subclass |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
dict_t |
|
Dataset
Bases: DatasetDisplayMixin, TaskDatasetMixin, DataClassBase, pyd.GenericModel, UserDict[str, _ModelOrDatasetT], Generic[_ModelOrDatasetT]
Dict-based container of data files that follow a specific Model
Dataset is a generic class that cannot be instantiated directly. Instead, a Dataset class needs to be specialized with a data model before Dataset objects can be instantiated. A data model functions as a data parser and guarantees that the parsed data follows the specified model.
The specialization must be done through the use of Model, either directly, e.g.::
MyDataset = Dataset[Model[dict[str, list[int]]])
... or indirectly, using a Model subclass, e.g.::
class MyModel(Model[dict[str, list[int]]):
pass
MyDataset = Dataset[MyModel]
... alternatively through the specification of a Dataset subclass::
class MyDataset(Dataset[MyModel]):
pass
The specialization can also be done in a more deeply nested structure, e.g.::
class MyNumberList(Model[list[int]]):
pass
class MyToplevelDict(Model[dict[str, MyNumberList]]):
pass
class MyDataset(Dataset[MyToplevelDict]):
pass
Once instantiated, a dataset object functions as a dict of data files, with the keys referring to the data file names and the content to the data file content, e.g.::
MyNumberListDataset = Dataset[Model[list[int]]]
my_dataset = MyNumberListDataset({'file_1': [1,2,3]})
my_dataset['file_2'] = [2,3,4]
print(my_dataset.keys())
The Dataset class is a wrapper class around the powerful GenericModel class from pydantic.
| 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_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 |
|
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/dataset.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 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 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 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 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 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 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 | |
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/dataset.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_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
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.
Source code in src/omnipy/data/dataset.py
is_dataset_instance
is_dataset_instance(__obj: object) -> TypeIs[Dataset]