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

Rename and update sequence #823

Merged
merged 12 commits into from
Feb 12, 2024
Merged

Rename and update sequence #823

merged 12 commits into from
Feb 12, 2024

Conversation

jrobinAV
Copy link
Member

@jrobinAV jrobinAV commented Feb 12, 2024

Resolves #812

  • Opened a new API at the scenario level to rename a sequence
  • Opened a new API at the scenario level to update an existing sequence
  • Updated the add_sequence method to check if a sequence already exists with the same name.
  • Updated the NonExistingSequence exception message.
  • Accept spaces in sequence names.

@FredLL-Avaiga
Copy link
Member

FredLL-Avaiga commented Feb 12, 2024

@FredLL-Avaiga , you should use these APIs without a context manager instead.

I would need the context manager to update the tasks list

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

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

Looking good

taipy/core/scenario/scenario.py Show resolved Hide resolved
@@ -74,7 +74,8 @@ def __init__(

@staticmethod
def _new_id(sequence_name: str, scenario_id) -> SequenceId:
return SequenceId(Sequence._SEPARATOR.join([Sequence._ID_PREFIX, _validate_id(sequence_name), scenario_id]))
seq_id = sequence_name.replace(" ", "_")
Copy link
Member

Choose a reason for hiding this comment

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

Sure about that? Only spaces are a problem?

FredLL-Avaiga
FredLL-Avaiga previously approved these changes Feb 12, 2024
assert scenario.sequences["seq_1"].properties["new_key"] == "new_value"


def test_add_rename_and_remove_sequences_within_context(data_node):
Copy link
Member Author

Choose a reason for hiding this comment

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

@FredLL-Avaiga This test exhibits the fix

@jrobinAV jrobinAV merged commit f3464bb into develop Feb 12, 2024
58 of 60 checks passed
@jrobinAV jrobinAV deleted the feature/update-rename-sequence branch February 12, 2024 15:37
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.

BUG-Add sequence in a Scenario Context Manager
3 participants