Skip to content

Commit f421e66

Browse files
committed
Updated config creation docs.
1 parent f551102 commit f421e66

3 files changed

Lines changed: 30 additions & 4 deletions

File tree

‎docs/source/how-to/configuration/create-configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The principles and syntax of the configuration are explained in more detail in [
44

55
There are several ways to create a configuration. It is recommended to test the different options and see which one you prefer:
66

7-
- Create `ConfigurationSchema` objects and export as a dictionary or text file
7+
- [Use ConfigurationSchema](./use-configuration-schema.ipynb) objects and export as a dictionary or text file
88

99
- Use a JSON Schema in the [MetaConfigurator](./use-meta-configurator.md)
1010

‎docs/source/how-to/configuration/use-configuration-schema.ipynb‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,32 @@
318318
"id": "cfde8f36",
319319
"metadata": {},
320320
"source": [
321-
"You have now created a Pydantic BaseModel which describes the configuration and can dump it to JSON using Pydantic functionality."
321+
"You have now created a Pydantic BaseModel which describes the configuration and can dump it to a dictionary or JSON using Pydantic functionality depending on what you prefer."
322322
]
323323
},
324324
{
325325
"cell_type": "code",
326-
"execution_count": 10,
326+
"execution_count": 13,
327327
"id": "ad78da2c",
328328
"metadata": {},
329+
"outputs": [
330+
{
331+
"name": "stdout",
332+
"output_type": "stream",
333+
"text": [
334+
"{'class_path': 'pyaml.accelerator.Accelerator', 'facility': 'pyaml_facility', 'machine': 'storage_ring', 'energy': 1000000.0, 'alphac': None, 'harmonic_number': None, 'controls': [{'class_path': 'tango.pyaml.controlsystem.TangoControlSystem', 'name': 'live', 'tango_host': None, 'catalog': None, 'debug_level': None, 'lazy_devices': True, 'timeout_ms': 3000}], 'simulators': None, 'arrays': None, 'devices': None, 'data_folder': None, 'description': None}\n"
335+
]
336+
}
337+
],
338+
"source": [
339+
"print(accelerator.model_dump())"
340+
]
341+
},
342+
{
343+
"cell_type": "code",
344+
"execution_count": 14,
345+
"id": "7e48e0e6",
346+
"metadata": {},
329347
"outputs": [
330348
{
331349
"name": "stdout",
@@ -361,6 +379,14 @@
361379
"source": [
362380
"print(accelerator.model_dump_json(indent=2))"
363381
]
382+
},
383+
{
384+
"cell_type": "code",
385+
"execution_count": null,
386+
"id": "3be782be",
387+
"metadata": {},
388+
"outputs": [],
389+
"source": []
364390
}
365391
],
366392
"metadata": {

‎docs/source/how-to/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ configuration/create-configuration
2525
configuration/use-schema-registry
2626
configuration/validate-configuration
2727
configuration/generate-json-schema
28-
configuration/use-configuration-schemas
28+
configuration/use-configuration-schema
2929
configuration/use-meta-configurator
3030
configuration/use-vscode-json-schema
3131

0 commit comments

Comments
 (0)