-
Notifications
You must be signed in to change notification settings - Fork 6
PPBC skeleton class implementation #59
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
2e4aefc
PPBC
VladIftime ced07d2
Generated classes
VladIftime abecea8
PPBC sub-modules created
VladIftime e33a499
PPBC message types
VladIftime 161a16b
PPBC fixed issues with wrong class names and the gen_unit tests
VladIftime 56b83c3
Removed the build files
VladIftime 627dbda
Merge branch 'Dev-VladIftime-Kiflin-PPBC' of https://github.com/flexi…
VladIftime ca3465f
Ignore the randomly generated unit tests
VladIftime 699800f
Stop tracking ignored files
VladIftime 8edb029
Refactor FRBC for better readability and add TODO comments for abstra…
VladIftime ea2635a
Remove unused imports from PPBC modules
VladIftime ab202de
Added the frbcs tests back
VladIftime a26405f
Added the frbcs tests back
VladIftime 743e923
Reverted example_frbc_type.py to put it on a different PR
VladIftime 8d0f3a6
Reverted example_frbc_type.py to put it on a different PR
VladIftime f87df9f
Reverted src/s2python/generated/gen_s2.py to put it on a different PR
VladIftime 236b154
Reverted development_utilities/gen_unit_test_template.py to put it on…
VladIftime fbfdd99
Reverted the frbc unit tests to put them on a different PR
VladIftime db2cd80
Update pylint configuration to disable W0511 for TODOs and fix type i…
VladIftime a77bae7
Refactor type annotations in PPBCPowerSequenceContainerStatus to use …
VladIftime 258c7ed
Add type ignore comments for assignment in PPBC model fields
VladIftime 2f68190
Remove unused import of Duration in ppbc_power_sequence_container_sta…
VladIftime 24c4f5b
Update src/s2python/s2_control_type.py
Flix6x 10cd8c2
fix: replace generic TODOs with developer instructions
Flix6x f2e8ffa
chore: check for generic TODOs
Flix6x 3bec6e2
chore: pylint W0107
Flix6x 5518a22
chore: pylint W0107 again
Flix6x a79e921
W2301 from pylint fix
VladIftime File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,4 @@ venv | |
| *venv* | ||
| .tox/ | ||
| dist/ | ||
| build/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from s2python.ppbc.ppbc_schedule_instruction import PPBCScheduleInstruction | ||
| from s2python.ppbc.ppbc_end_interruption_instruction import ( | ||
| PPBCEndInterruptionInstruction, | ||
| ) | ||
| from s2python.ppbc.ppbc_power_profile_definition import PPBCPowerProfileDefinition | ||
| from s2python.ppbc.ppbc_power_sequence_container import PPBCPowerSequenceContainer | ||
| from s2python.ppbc.ppbc_power_sequence import PPBCPowerSequence | ||
| from s2python.ppbc.ppbc_power_profile_status import PPBCPowerProfileStatus | ||
| from s2python.ppbc.ppbc_power_sequence_container_status import ( | ||
| PPBCPowerSequenceContainerStatus, | ||
| ) | ||
| from s2python.ppbc.ppbc_power_sequence_element import PPBCPowerSequenceElement |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import uuid | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCEndInterruptionInstruction as GenPPBCEndInterruptionInstruction, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCEndInterruptionInstruction( | ||
| GenPPBCEndInterruptionInstruction, S2Message["PPBCEndInterruptionInstruction"] | ||
| ): | ||
| model_config = GenPPBCEndInterruptionInstruction.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields["id"] # type: ignore[assignment] | ||
| power_profile_id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields[ | ||
| "power_profile_id" | ||
| ] # type: ignore[assignment] | ||
| sequence_container_id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields[ | ||
| "sequence_container_id" | ||
| ] # type: ignore[assignment] | ||
| power_sequence_id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields[ | ||
| "power_sequence_id" | ||
| ] # type: ignore[assignment] | ||
| abnormal_condition: bool = GenPPBCEndInterruptionInstruction.model_fields[ | ||
| "abnormal_condition" | ||
| ] # type: ignore[assignment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from typing import List | ||
| import uuid | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCPowerProfileDefinition as GenPPBCPowerProfileDefinition, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
| from s2python.ppbc.ppbc_power_sequence_container import PPBCPowerSequenceContainer | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCPowerProfileDefinition( | ||
| GenPPBCPowerProfileDefinition, S2Message["PPBCPowerProfileDefinition"] | ||
| ): | ||
| model_config = GenPPBCPowerProfileDefinition.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| message_id: uuid.UUID = GenPPBCPowerProfileDefinition.model_fields["message_id"] # type: ignore[assignment] | ||
| id: uuid.UUID = GenPPBCPowerProfileDefinition.model_fields["id"] # type: ignore[assignment] | ||
| power_sequences_containers: List[PPBCPowerSequenceContainer] = ( | ||
| GenPPBCPowerProfileDefinition.model_fields["power_sequences_containers"] # type: ignore[assignment] | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| from typing import List | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCPowerProfileStatus as GenPPBCPowerProfileStatus, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
| from s2python.ppbc.ppbc_power_sequence_container_status import ( | ||
| PPBCPowerSequenceContainerStatus, | ||
| ) | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCPowerProfileStatus( | ||
| GenPPBCPowerProfileStatus, S2Message["PPBCPowerProfileStatus"] | ||
| ): | ||
| model_config = GenPPBCPowerProfileStatus.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| sequence_container_status: List[PPBCPowerSequenceContainerStatus] = ( | ||
| GenPPBCPowerProfileStatus.model_fields["sequence_container_status"] # type: ignore[assignment] | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from typing import List | ||
| import uuid | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCPowerSequence as GenPPBCPowerSequence, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
| from s2python.ppbc.ppbc_power_sequence_element import PPBCPowerSequenceElement | ||
| from s2python.common import Duration | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCPowerSequence(GenPPBCPowerSequence, S2Message["PPBCPowerSequence"]): | ||
| model_config = GenPPBCPowerSequence.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| id: uuid.UUID = GenPPBCPowerSequence.model_fields["id"] # type: ignore[assignment] | ||
| elements: List[PPBCPowerSequenceElement] = GenPPBCPowerSequence.model_fields[ | ||
| "elements" | ||
| ] # type: ignore[assignment] | ||
| is_interruptible: bool = GenPPBCPowerSequence.model_fields["is_interruptible"] # type: ignore[assignment] | ||
| max_pause_before: Duration = GenPPBCPowerSequence.model_fields["max_pause_before"] # type: ignore[assignment] | ||
| abnormal_condition_only: bool = GenPPBCPowerSequence.model_fields[ | ||
| "abnormal_condition_only" | ||
| ] # type: ignore[assignment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from typing import List | ||
| import uuid | ||
|
|
||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCPowerSequenceContainer as GenPPBCPowerSequenceContainer, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
| from s2python.ppbc.ppbc_power_sequence import PPBCPowerSequence | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCPowerSequenceContainer( | ||
| GenPPBCPowerSequenceContainer, S2Message["PPBCPowerSequenceContainer"] | ||
| ): | ||
| model_config = GenPPBCPowerSequenceContainer.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| id: uuid.UUID = GenPPBCPowerSequenceContainer.model_fields["id"] # type: ignore[assignment] | ||
| power_sequences: List[PPBCPowerSequence] = ( | ||
| GenPPBCPowerSequenceContainer.model_fields["power_sequences"] # type: ignore[assignment] | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import uuid | ||
| from typing import Union | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCPowerSequenceContainerStatus as GenPPBCPowerSequenceContainerStatus, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCPowerSequenceContainerStatus( | ||
| GenPPBCPowerSequenceContainerStatus, S2Message["PPBCPowerSequenceContainerStatus"] | ||
| ): | ||
| model_config = GenPPBCPowerSequenceContainerStatus.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| power_profile_id: uuid.UUID = GenPPBCPowerSequenceContainerStatus.model_fields[ | ||
| "power_profile_id" # type: ignore[assignment] | ||
| ] | ||
| sequence_container_id: uuid.UUID = GenPPBCPowerSequenceContainerStatus.model_fields[ | ||
| "sequence_container_id" # type: ignore[assignment] | ||
| ] | ||
| selected_sequence_id: Union[uuid.UUID, None] = ( | ||
| GenPPBCPowerSequenceContainerStatus.model_fields["selected_sequence_id"] # type: ignore[assignment] | ||
| ) | ||
| progress: Union[uuid.UUID, None] = GenPPBCPowerSequenceContainerStatus.model_fields[ | ||
| "progress" # type: ignore[assignment] | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from typing import List | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCPowerSequenceElement as GenPPBCPowerSequenceElement, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
| from s2python.common import Duration, PowerForecastValue | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCPowerSequenceElement( | ||
| GenPPBCPowerSequenceElement, S2Message["PPBCPowerSequenceElement"] | ||
| ): | ||
| model_config = GenPPBCPowerSequenceElement.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| duration: Duration = GenPPBCPowerSequenceElement.model_fields["duration"] # type: ignore[assignment] | ||
| power_values: List[PowerForecastValue] = GenPPBCPowerSequenceElement.model_fields[ | ||
| "power_values" | ||
| ] # type: ignore[assignment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import uuid | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCScheduleInstruction as GenPPBCScheduleInstruction, | ||
| ) | ||
| from s2python.validate_values_mixin import ( | ||
| catch_and_convert_exceptions, | ||
| S2Message, | ||
| ) | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCScheduleInstruction( | ||
| GenPPBCScheduleInstruction, S2Message["PPBCScheduleInstruction"] | ||
| ): | ||
| model_config = GenPPBCScheduleInstruction.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| id: uuid.UUID = GenPPBCScheduleInstruction.model_fields["id"] # type: ignore[assignment] | ||
|
|
||
| power_profile_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields[ | ||
| "power_profile_id" | ||
| ] # type: ignore[assignment] | ||
|
|
||
| message_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields["message_id"] # type: ignore[assignment] | ||
|
|
||
| sequence_container_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields[ | ||
| "sequence_container_id" | ||
| ] # type: ignore[assignment] | ||
|
|
||
| power_sequence_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields[ | ||
| "power_sequence_id" | ||
| ] # type: ignore[assignment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import uuid | ||
|
|
||
| from s2python.generated.gen_s2 import ( | ||
| PPBCStartInterruptionInstruction as GenPPBCStartInterruptionInstruction, | ||
| ) | ||
|
|
||
| from s2python.validate_values_mixin import ( | ||
| S2Message, | ||
| catch_and_convert_exceptions, | ||
| ) | ||
|
|
||
|
|
||
| @catch_and_convert_exceptions | ||
| class PPBCStartInterruptionInstruction( | ||
| GenPPBCStartInterruptionInstruction, S2Message["PPBCStartInterruptionInstruction"] | ||
| ): | ||
| model_config = GenPPBCStartInterruptionInstruction.model_config | ||
| model_config["validate_assignment"] = True | ||
|
|
||
| id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields["id"] # type: ignore[assignment] | ||
| power_profile_id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields[ | ||
| "power_profile_id" | ||
| ] # type: ignore[assignment] | ||
| sequence_container_id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields[ | ||
| "sequence_container_id" | ||
| ] # type: ignore[assignment] | ||
| power_sequence_id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields[ | ||
| "power_sequence_id" | ||
| ] # type: ignore[assignment] | ||
| abnormal_condition: bool = GenPPBCStartInterruptionInstruction.model_fields[ | ||
| "abnormal_condition" | ||
| ] # type: ignore[assignment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.