-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from maxfordham/tidy-editgrid-internals-and-api
Tidy editgrid internals and api
- Loading branch information
Showing
58 changed files
with
10,143 additions
and
8,778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,117 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "05fa98e6-8efc-4798-9124-1ff3be780512", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "43129c1d87b64d17a4458df03dd27636", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"AutoUi(children=(VBox(children=(HBox(children=(SaveButtonBar(children=(ToggleButton(value=False, button_style=…" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"import typing\n", | ||
"from enum import Enum\n", | ||
"from pydantic import Field, conint, constr\n", | ||
"from ipyautoui.basemodel import BaseModel\n", | ||
"from pydantic.color import Color\n", | ||
"from datetime import datetime, date\n", | ||
"import pathlib\n", | ||
"\n", | ||
"from ipyautoui import AutoUi\n", | ||
"\n", | ||
"STR_MARKDOWN = \"\"\"\n", | ||
"See details here: [__commonmark__](https://commonmark.org/help/)\n", | ||
"\n", | ||
"or press the question mark button. \n", | ||
"\"\"\"\n", | ||
"\n", | ||
"class GenderEnum(str, Enum):\n", | ||
" \"\"\"available genders. this is just an example.\"\"\"\n", | ||
"\n", | ||
" male = \"male\"\n", | ||
" female = \"female\"\n", | ||
" other = \"other\"\n", | ||
" not_given = \"not_given\"\n", | ||
"\n", | ||
"\n", | ||
"class TestAutoLogicSimple(BaseModel):\n", | ||
" \"\"\"this is a test UI form to demonstrate how pydantic class can be used to generate an ipywidget input form. \n", | ||
" only simple datatypes used (i.e. not lists/arrays or objects)\n", | ||
" \"\"\"\n", | ||
"\n", | ||
" string: str = Field(default=\"adsf\", description=\"a description about my string\")\n", | ||
" int_slider: conint(ge=0, le=3) = 2\n", | ||
" int_text: int = 1\n", | ||
" int_range_slider: tuple[int, int] = Field(default=(0, 3), ge=0, le=4) # check\n", | ||
" float_slider: float = Field(default=2.2, ge=0, le=3)\n", | ||
" float_text: float = 2.2\n", | ||
" float_text_locked: float = Field(default=2.2, disabled=True)\n", | ||
" float_range_slider: tuple[float, float] = Field(default=(0, 2.2), ge=0, le=3.5)\n", | ||
" checkbox: bool = True\n", | ||
" dropdown: GenderEnum = Field(\n", | ||
" default=GenderEnum.female, description=\"updated description\"\n", | ||
" )\n", | ||
" combobox: str = Field(\n", | ||
" default=\"asd\", enum=[\"asd\", \"asdf\"], autoui=\"ipyautoui.autowidgets.Combobox\",\n", | ||
" )\n", | ||
" text: constr(min_length=0, max_length=20) = \"short text\"\n", | ||
" text_area: constr(min_length=0, max_length=800) = Field(\n", | ||
" \"long text \" * 50, description=\"long text field\"\n", | ||
" )\n", | ||
" markdown: str = Field(\n", | ||
" STR_MARKDOWN, description=\"markdown widget!\", format=\"markdown\"\n", | ||
" )\n", | ||
" color_picker_ipywidgets: Color = \"#f5f595\"\n", | ||
" date_picker: typing.Optional[\n", | ||
" date\n", | ||
" ] = date.today() # TODO: serialisation / parsing round trip not working...\n", | ||
"\n", | ||
"\n", | ||
"AutoUi(TestAutoLogicSimple, path='ui.json') \n", | ||
" " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "174767f3-87e1-4717-8f74-2fd81b9bc138", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "05fa98e6-8efc-4798-9124-1ff3be780512", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "43129c1d87b64d17a4458df03dd27636", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"AutoUi(children=(VBox(children=(HBox(children=(SaveButtonBar(children=(ToggleButton(value=False, button_style=…" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"import typing as ty\n", | ||
"from enum import Enum\n", | ||
"from pydantic import Field, conint, constr\n", | ||
"from ipyautoui.basemodel import BaseModel\n", | ||
"from pydantic.color import Color\n", | ||
"from datetime import datetime, date\n", | ||
"import pathlib\n", | ||
"\n", | ||
"from ipyautoui import AutoUi\n", | ||
"\n", | ||
"STR_MARKDOWN = \"\"\"\n", | ||
"See details here: [__commonmark__](https://commonmark.org/help/)\n", | ||
"\n", | ||
"or press the question mark button. \n", | ||
"\"\"\"\n", | ||
"\n", | ||
"class GenderEnum(str, Enum):\n", | ||
" \"\"\"available genders. this is just an example.\"\"\"\n", | ||
"\n", | ||
" male = \"male\"\n", | ||
" female = \"female\"\n", | ||
" other = \"other\"\n", | ||
" not_given = \"not_given\"\n", | ||
"\n", | ||
"\n", | ||
"class TestAutoLogicSimple(BaseModel):\n", | ||
" \"\"\"this is a test UI form to demonstrate how pydantic class can be used to generate an ipywidget input form. \n", | ||
" only simple datatypes used (i.e. not lists/arrays or objects)\n", | ||
" \"\"\"\n", | ||
"\n", | ||
" string: str = Field(default=\"adsf\", description=\"a description about my string\")\n", | ||
" int_slider: conint(ge=0, le=3) = 2\n", | ||
" int_text: int = 1\n", | ||
" int_range_slider: tuple[int, int] = Field(default=(0, 3), ge=0, le=4) # check\n", | ||
" float_slider: float = Field(default=2.2, ge=0, le=3)\n", | ||
" float_text: float = 2.2\n", | ||
" float_text_locked: float = Field(default=2.2, disabled=True)\n", | ||
" float_range_slider: tuple[float, float] = Field(default=(0, 2.2), ge=0, le=3.5)\n", | ||
" checkbox: bool = True\n", | ||
" dropdown: GenderEnum = Field(\n", | ||
" default=GenderEnum.female, description=\"updated description\"\n", | ||
" )\n", | ||
" combobox: str = Field(\n", | ||
" default=\"asd\", enum=[\"asd\", \"asdf\"], autoui=\"ipyautoui.autowidgets.Combobox\",\n", | ||
" )\n", | ||
" text: constr(min_length=0, max_length=20) = \"short text\"\n", | ||
" text_area: constr(min_length=0, max_length=800) = Field(\n", | ||
" \"long text \" * 50, description=\"long text field\"\n", | ||
" )\n", | ||
" markdown: str = Field(\n", | ||
" STR_MARKDOWN, description=\"markdown widget!\", format=\"markdown\"\n", | ||
" )\n", | ||
" color_picker_ipywidgets: Color = \"#f5f595\"\n", | ||
" date_picker: ty.Optional[\n", | ||
" date\n", | ||
" ] = date.today() # TODO: serialisation / parsing round trip not working...\n", | ||
"\n", | ||
"\n", | ||
"AutoUi(TestAutoLogicSimple, path='ui.json') \n", | ||
" " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "174767f3-87e1-4717-8f74-2fd81b9bc138", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.