Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added runtime enum class, metaclass, and tests #341

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

evalott100
Copy link
Contributor

@evalott100 evalott100 commented May 28, 2024

Closes #238

@evalott100 evalott100 linked an issue May 28, 2024 that may be closed by this pull request
@evalott100 evalott100 marked this pull request as draft May 29, 2024 07:26
@evalott100 evalott100 force-pushed the 238-support-extensible-enums branch 2 times, most recently from 1f140e1 to 449605b Compare June 4, 2024 08:04
@evalott100 evalott100 self-assigned this Jun 4, 2024
@evalott100 evalott100 marked this pull request as ready for review June 4, 2024 08:05
@evalott100 evalott100 force-pushed the 238-support-extensible-enums branch 2 times, most recently from 02522cf to 200c215 Compare June 4, 2024 09:28
src/ophyd_async/epics/_backend/common.py Outdated Show resolved Hide resolved
src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
@coretl
Copy link
Collaborator

coretl commented Jun 5, 2024

Please can we also have some new entries in the matrix in tests/epics/test_signals.py using RuntimeEnum on a subset of the entries of the enum record?

@evalott100 evalott100 force-pushed the 238-support-extensible-enums branch 2 times, most recently from 7a8fa6a to e32d8d6 Compare June 6, 2024 09:21
@evalott100 evalott100 requested a review from coretl June 10, 2024 09:31
Copy link
Collaborator

@coretl coretl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having just written this, I'm wondering if SubsetEnum is a better name than RuntimeEnum?

src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
src/ophyd_async/epics/_backend/common.py Outdated Show resolved Hide resolved
@evalott100 evalott100 force-pushed the 238-support-extensible-enums branch from e32d8d6 to e2a5618 Compare June 18, 2024 12:40
@evalott100 evalott100 requested a review from coretl June 19, 2024 09:06
Also made it so that
	* if the record is mbb then the signal has to be
	  `Enum`,`SubsetEnum`, or None
	* `SubsetEnum` metaclass caches with a tuple, so
	  order matters and `RuntimeEnum['A', 'B'] is not
	  RuntimeEnum['B', 'A']`
@evalott100 evalott100 force-pushed the 238-support-extensible-enums branch from 8b5c3b0 to e265eff Compare June 19, 2024 09:07
src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
@evalott100 evalott100 requested a review from coretl June 20, 2024 08:00
src/ophyd_async/core/signal_backend.py Outdated Show resolved Hide resolved
src/ophyd_async/core/soft_signal_backend.py Outdated Show resolved Hide resolved
src/ophyd_async/core/soft_signal_backend.py Outdated Show resolved Hide resolved
@evalott100 evalott100 merged commit 9165c5a into main Jun 20, 2024
18 checks passed
@evalott100 evalott100 deleted the 238-support-extensible-enums branch June 20, 2024 12:05
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.

Support enum signals for enum classes that are generated at runtime Support extensible enums
2 participants