Skip to content

Conversation

@danielmaclaren
Copy link
Contributor

Pyright checks returned one error:

c:\Instrument\Dev\genie\src\genie_python\genie_startup.py
c:\Instrument\Dev\genie\src\genie_python\genie_startup.py:26:16 - error: Argument of type "None" cannot be assigned to parameter "pv_prefix" of type "str"
  "None" is not assignable to "str" (reportArgumentType)
1 error, 0 warnings, 0 informations

This was the line it refered to:

# Call set_instrument with None to force it to try to guess the instrument set_instrument(None) # noqa F405 (defined from star import)

This is the change I made to genie.py

def set_instrument(pv_prefix: str | None, import_instrument_init: bool = True) -> None:

Allowed 'None' to be a pv_prefix

Please let me know if there was a better way to fix the pyright error!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants