update function example

This commit is contained in:
Gergő Jedlicska
2023-08-25 16:03:06 +02:00
parent bdb54cde50
commit bf146bc88a
+10 -6
View File
@@ -60,9 +60,9 @@
},
"outputs": [],
"source": [
"speckle_project_data = \"\"\n",
"function_inputs = \"\"\n",
"token_env_var = \"\""
"speckle_project_data = '{\"projectId\": \"03434ee1f1\", \"versionId\": \"09d2a0e55a\", \"modelId\": \"base design\", \"speckleServerUrl\": \"https://latest.speckle.dev\" }'\n",
"function_inputs = '{\"speckleType\": \"Objects.Geometry.Brep\"}'\n",
"token_env_var = \"SPECKLE_TOKEN\""
]
},
{
@@ -153,7 +153,6 @@
" client = SpeckleClient(project_data.speckle_server_url)\n",
" client.authenticate_with_token(speckle_token)\n",
" commit = client.commit.get(project_data.project_id, project_data.version_id)\n",
" branch = client.branch.get(project_data.project_id, project_data.model_id, 1)\n",
"\n",
" memory_transport = MemoryTransport()\n",
" server_transport = ServerTransport(project_data.project_id, client)\n",
@@ -161,7 +160,8 @@
"\n",
" matching_types = [\n",
" b for b in flatten_base(base) if b.speckle_type == function_inputs.speckle_type\n",
" ]"
" ]\n",
" print(f\"Found {len(matching_types)} elements that have the speckle_type {function_inputs.speckle_type}\")"
]
},
{
@@ -178,7 +178,11 @@
" project_data = SpeckleProjectData.model_validate_json(speckle_project_data)\n",
" speckle_token = os.environ[token_env_var]\n",
" print(project_data)\n",
" print(inputs)"
" print(inputs)\n",
"\n",
" automate_function(project_data, inputs, speckle_token)\n",
" \n",
"main()"
]
}
],