taipy
taipy copied to clipboard
Tags should not be unique in cycle
Description Scenario tags are unique within each cycle. It needs to be better suited.
For example, I want to say that some scenarios are more important than others. I could use the term "High priority" for multiple scenarios inside a cycle. Right now, it is not possible as tags are unique for each cycle.
Acceptance Criteria
- [ ] Ensure new code is unit tested, and check code coverage is at least 90%
- [ ] Propagate any change on the demos and run all of them to ensure there is no breaking change
- [ ] Ensure any change is well documented and/or a new issue is created on the taipy-doc repository
In the _ScenarioManager, the static _tag method should be updated by removing the "old_tagged_scenario" update a follows:
@classmethod
def _tag(cls, scenario: Scenario, tag: str):
tags = scenario.properties.get(cls._AUTHORIZED_TAGS_KEY, set())
if len(tags) > 0 and tag not in tags:
raise UnauthorizedTagError(f"Tag `{tag}` not authorized by scenario configuration `{scenario.config_id}`")
scenario._add_tag(tag)
cls._set(scenario)
Notifier.publish(
_make_event(scenario, EventOperation.UPDATE, attribute_name="tags", attribute_value=scenario.tags)
)
- Unit tests must be updated as well.
- The ref manual of the
Scenarioclass and thetaipymodule must be updated.