Skip to content

Refreshing the environment should refresh the cached plans #1503

Closed

Description

@tpoliaw

In a repl with a blueapi client

>>> bc = BlueapiClient.from_config_file('tests/system_tests/config.yaml').with_instrument_session("cm12345-1")
>>> bc.plans.missing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/dls/athena/blueapi/src/blueapi/client/client.py", line 97, in __getattr__
    raise AttributeError(f"No plan named '{name}' available")
AttributeError: No plan named 'missing' available
>>> # Add a 'missing' plan to a module included in the server
>>> bc.reload_environment()
EnvironmentResponse(environment_id=UUID('72aabe8e-1fdd-4f52-a23d-5717a2ccb725'), initialized=True, error_message=None)
>>> bc.plans.missing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/dls/athena/blueapi/src/blueapi/client/client.py", line 97, in __getattr__
    raise AttributeError(f"No plan named '{name}' available")
AttributeError: No plan named 'missing' available

After the reload, the cached plans should be refreshed to ensure new plans are available and removed plans don't linger.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions