From bd97781b1fe5a904db06e5c0bc3c4aa008d588f2 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 3 Nov 2023 11:36:21 -0700 Subject: [PATCH] docs: Update basic usage with better wording for examples. (#83) --- docs/basic_usage.md | 16 ++++++++++++---- .../driver_mixins/class_extension_mixin.py | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/basic_usage.md b/docs/basic_usage.md index fcfaf591..cc89f6c5 100644 --- a/docs/basic_usage.md +++ b/docs/basic_usage.md @@ -17,6 +17,13 @@ This will print the available VISA devices to the console when run from a shell ## Adding devices +Configure device connections as needed using the +[config file](configuration.md#config-file), an +[environment variable](configuration.md#environment-variable), or +via [Python code](configuration.md#python-code) (shown here). See the +[Configuration guide](configuration.md) for more information on how to +configure devices to connect with. + ```{literalinclude} ../examples/miscellaneous/adding_devices.py --- language: python @@ -35,9 +42,10 @@ language: python ## Adding devices with environment variables -Configure device environment variables as needed using the config file or -[Python](#adding-devices). See the [Configuration guide](configuration.md) for -more information on how to do that. +Device configuration information can be defined in an +[environment variable](configuration.md#environment-variable), usually done +outside the Python code for ease of automation +(shown inside the Python code here for demonstration purposes). ```{literalinclude} ../examples/miscellaneous/adding_devices_with_env_var.py --- @@ -148,6 +156,6 @@ In order to do this a few things will need to be created: ```{literalinclude} ../examples/miscellaneous/custom_device_driver_support.py --- language: python -emphasize-lines: 9-14,21-23,26 +emphasize-lines: 7-12,19-21,28-30 --- ``` diff --git a/src/tm_devices/driver_mixins/class_extension_mixin.py b/src/tm_devices/driver_mixins/class_extension_mixin.py index 894c2c0c..d8550506 100644 --- a/src/tm_devices/driver_mixins/class_extension_mixin.py +++ b/src/tm_devices/driver_mixins/class_extension_mixin.py @@ -114,7 +114,7 @@ def wrap(function: Callable[[_EM], _T]) -> None: # Handle being called as @add_property() with parens. if method is None: - return wrap + return wrap # pyright: ignore[reportUnknownVariableType] # called as @add_property without parens. return wrap(method)