Skip to content

Commit

Permalink
support pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
MBueschelberger committed Jan 9, 2025
1 parent 5eaf2aa commit a1db259
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 383 deletions.
77 changes: 16 additions & 61 deletions docs/dsms_sdk/tutorials/2_creation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -37,7 +37,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -62,71 +62,26 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"KItem(\n",
"\n",
"\tname = Machine-1, \n",
"\n",
"\tid = c4128bec-3ecd-4c92-a307-7015bc9f2e86, \n",
"\n",
"\tktype_id = KTypes.TestingMachine, \n",
"\n",
"\tin_backend = False, \n",
"\n",
"\tslug = machine-1-c4128bec, \n",
"\n",
"\tannotations = [], \n",
"\n",
"\tattachments = [], \n",
"\n",
"\tlinked_kitems = [], \n",
"\n",
"\taffiliations = [], \n",
"\n",
"\tauthors = [], \n",
"\n",
"\tavatar_exists = False, \n",
"\n",
"\tcontacts = [], \n",
"\n",
"\tcreated_at = None, \n",
"\n",
"\tupdated_at = None, \n",
"\n",
"\texternal_links = [], \n",
"\n",
"\tkitem_apps = [], \n",
"\n",
"\tsummary = None, \n",
"\n",
"\tuser_groups = [], \n",
"\n",
"\tcustom_properties = {\n",
"\t\tProducer: TestingLab GmBH, \n",
"\t\tLocation: A404, \n",
"\t\tModel Number: Bending Test Machine No 777\n",
"\t}, \n",
"\n",
"\tdataframe = None, \n",
"\n",
"\trdf_exists = False\n",
")"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
"ename": "AttributeError",
"evalue": "TestingMachine",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[3], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m item \u001b[38;5;241m=\u001b[39m KItem(\n\u001b[1;32m 2\u001b[0m name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMachine-1\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m----> 3\u001b[0m ktype_id\u001b[38;5;241m=\u001b[39m\u001b[43mdsms\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mktypes\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mTestingMachine\u001b[49m,\n\u001b[1;32m 4\u001b[0m custom_properties\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mProducer\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTestingLab GmBH\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 5\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLocation\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mA404\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 6\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mModel Number\u001b[39m\u001b[38;5;124m\"\u001b[39m : \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mBending Test Machine No 777\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 7\u001b[0m },\n\u001b[1;32m 8\u001b[0m )\n\u001b[1;32m 10\u001b[0m item\n",
"File \u001b[0;32m/usr/local/lib/python3.10/enum.py:437\u001b[0m, in \u001b[0;36mEnumMeta.__getattr__\u001b[0;34m(cls, name)\u001b[0m\n\u001b[1;32m 435\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m_member_map_[name]\n\u001b[1;32m 436\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m:\n\u001b[0;32m--> 437\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(name) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
"\u001b[0;31mAttributeError\u001b[0m: TestingMachine"
]
}
],
"source": [
"item = KItem(\n",
" name=\"Machine-1\",\n",
" ktype_id=dsms.ktypes.TestingMachine,\n",
" ktype_id=dsms.ktypes.Specimen,\n",
" custom_properties={\"Producer\": \"TestingLab GmBH\",\n",
" \"Location\": \"A404\",\n",
" \"Model Number\" : \"Bending Test Machine No 777\"\n",
Expand Down Expand Up @@ -365,7 +320,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "sdk",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -379,7 +334,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit a1db259

Please sign in to comment.