pcdshub / hutch-python

Launcher and config reader for LCLS interactive IPython sessions
https://pcdshub.github.io/hutch-python/
Other
0 stars 18 forks source link

Per-Device {instance,class} user-configurable settings #293

Open klauer opened 2 years ago

klauer commented 2 years ago

Context

There are a certain number of per-ophyd.Device configuration settings that users will never be happy with our choice of defaults. While discussing this, our primary example has been device tab whitelists.

As different users have different (legitimate) needs and preferences, @ZLLentz and I came to the conclusion that it's sensible for us to:

  1. Allow the user to configure these without our intervention or a bug report/pull request/release cycle
  2. Provide a general framework for these configuration settings.
    • Our goal with the framework should be the ability to support any of the following that we agree would be good to include - even if those aren't added on day 1.

User-configurable settings

Some potential things that we would add:

Defaults

Format?

Providing a configuration file of a common format (explicitly not Python code) such as JSON or YAML seems to be superior for the following reasons:

Device classes and instances

Why support classes as well as instances?

Why not just support classes and not instances?

Inheritance?

Questions for now, as this requires more discussion:

Tooling

We should provide some additional tooling that performs the following:

ZLLentz commented 2 years ago

I think this fully encompasses the considerations/ideas we've discussed so far.

Inheritance

To what level do we want to support this without it becoming too confusing to find out where settings are coming from? Is there a middle ground or is it all-or-nothing?

I think we need to have the loader keep track of all config bits that contributes to an object's fully inherited config, such that we can audit it later, e.g. a list that says "got these config settings from Device, added these from EpicsMotor, overrided the whole thing in IMS"...