Skip to content
Snippets Groups Projects
Commit e138f1d2 authored by Jammer, Tim's avatar Jammer, Tim
Browse files

Added InstructionBlock has_operation

parent b28fdf2f
No related branches found
No related tags found
1 merge request!5more work on infrastructure III
...@@ -89,6 +89,21 @@ class InstructionBlock: ...@@ -89,6 +89,21 @@ class InstructionBlock:
return result_str return result_str
def has_operation(self, kind='all', index=0):
"""
Checks if the Block has an operation with the given index and kind
Parameters:
- kind ('all','not0' or integer): which ranks should execute the operation
- index (int): the index of the operation within the given kind
Returns:
boolean
"""
try:
result = self.operations[kind][index]
return True
except (KeyError,IndexError) as e:
return False
def get_operation(self, kind='all', index=0): def get_operation(self, kind='all', index=0):
""" """
Retrieve the operation registered. will Raise IndexError if not present Retrieve the operation registered. will Raise IndexError if not present
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment