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
Enabled/VisibleWhenProperty - Multiple conditions #19264
Enabled/VisibleWhenProperty - Multiple conditions #19264
Conversation
…o 19257_EnabledWhenProperty_accept_multiple_properties Re #19257 Fix documentation building
a = VisibleWhenProperty("PropA", PropertyCriterion.IsDefault) | ||
b = VisibleWhenProperty("PropB", PropertyCriterion.IsDefault) | ||
result = VisibleWhenProperty(a, b, LogicOperator.And) | ||
self.assertIsNotNone(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could add test for all logic operators as in EnabledWhenProperty test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't test from Python if these actually work as we would need to subscribe an algorithm and manipulate the properties.
Instead the Python tests just check we can construct it and the C++ unit tests test all combinations of operators work.
I'll add this note to the unit tests on the Python side
LGTM when all tests pass |
PR #19244 needs to be merged firstDescription of work.
This PR allows
EnableWhenProperty
andVisibleWhenProperty
to use logical operatorsand
or
xor
with existingEnable/VisibleWhenProperty
objects. I've tried to match the style of the existing interface from Python and C++.The work completed breaks down as follows:
Enable/VisibleWhenProperty
copyable - this means that have the flexibility to reuse the object (most likely from Python) to either combinations and set the original condition for single propertiesExamples
To use a combination of properties to determine another properties state you would do something as follows in C++:
For Python:
To test:
EnabledWhenPropTest
should appearor
/xor
For
VisibleWhenProperty
Fixes #19257 .
Does not need to be in the release notes. - This change is only visible internally.
However may be worth making developers aware as I'm sure it will be handy for some algorithms.
Reviewer
Please comment on the following (full description):
Code Review
Functional Tests
Do changes function as described? Add comments below that describe the tests performed?
How do the changes handle unexpected situations, e.g. bad input?
Has the relevant documentation been added/updated?
Is user-facing documentation written in a user-friendly manner?
Has developer documentation been updated if required?
Does everything look good? Comment with the ship it emoji but don't merge. A member of
@mantidproject/gatekeepers
will take care of it.