-
Notifications
You must be signed in to change notification settings - Fork 5
[NEAT-874] 🔨 Interface for state #1077
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
base: main
Are you sure you want to change the base?
Conversation
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
e5c8807
to
6d56817
Compare
7c4629f
to
8401a25
Compare
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.
Would help with flow and state diagram
cognite/neat/_state/_state.py
Outdated
raise NotImplementedError() | ||
|
||
@abstractmethod | ||
def next_state(self, action: Action) -> "State": |
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.
Next state is telling you what is possible next state or ?
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.
No, it is transitioning to the next state.
# Description This is part of a refactoring to NeatState, #1077. This modifies the `.transform()` method of `NeatGraphStore` to return an `IssueList`. The motivation for this is that this should comply with the other action methods `NeatRuleStore.import_rules/transform()` and `NeatGraphStore.write` that already return an `IssueList`. In addition, it now returns an error if the graph transformation failed. This is important as a failed transformation execution should not lead to a state change. ## Bump - [ ] Patch - [ ] Minor - [x] Skip
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.
rename action to activity to be in sync with provenance
"""Returns the display name of the current state.""" | ||
return self._state.display_name | ||
|
||
def change(self, action: Action) -> IssueList: |
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.
This is change in terms of what we define as change in Provenance, therefore, your argument is not action, but Agent (extractor, loader, transformer) that is configured to perform certain Activity, so this should be called activity not action
Description
Context: This is the first in a series of planned PRs. It is currently unused code as it is not yet complete.
Overall goal: The
NeatSession
is one of two planned user interfaces. Currently, there is some logic in the interface that needs to be moved out. The most significant logic is the state that guards the state transitions. Through a series of PRs the goal is to replace the NeatSession state with this NeatState.This PR: Creates the scaffolding for the new
NeatState
class. In addition, I have implemented a state pattern to guard the transition between four states with basic testing.Bump