Skip to content

Commit

Permalink
fix: 🎨 Rename functions to follow the "lower camel case" conavention
Browse files Browse the repository at this point in the history
  • Loading branch information
ARCJ137442 committed Oct 31, 2023
1 parent 5372192 commit 697e452
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pynars/ConsolePlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ def operation_list(*keywords: List[str]) -> None:
Enumerate existing operations; It can be retrieved with parameters'''
keywords = keywords if keywords else ['']
# Search for a matching interface name
from pynars.NARS.Operation.Register import registered_operations, getRegisteredOperationByName, registeredOperationNames
operation_names: List[str] = prefix_browse(registeredOperationNames(), *keywords)
from pynars.NARS.Operation.Register import registered_operations, get_registered_operation_by_name, registered_operation_names
operation_names: List[str] = prefix_browse(registered_operation_names(), *keywords)
# Displays information about "matched interface"
if operation_names:
for name in operation_names: # match the list of all cmds, as long as they match the search results - not necessarily in order
op = getRegisteredOperationByName(name)
op = get_registered_operation_by_name(name)
f = registered_operations[op]
print(f'''<Operation {str(op)}>: {
'No function' if f == None else
Expand Down
2 changes: 1 addition & 1 deletion pynars/NARS/Control/Reasoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def mental_operation(self, task: Task, concept: Concept, answers_question: Task,

def register_operation(self, name_operation: str, callback: Callable):
'''register an operation and return the operation if successful (otherwise, return None)'''
if not Operation.isRegisteredByName(name_operation):
if not Operation.is_registered_by_name(name_operation):
from pynars.Narsese import Operation as Op
op = Op(name_operation)
Operation.register(op, callback)
Expand Down
6 changes: 3 additions & 3 deletions pynars/NARS/Operation/Register.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

registered_operations: Dict[Operation, Callable] = {}

def registeredOperationNames():
def registered_operation_names():
''''''
global registered_operations
return [registered_operation.word for registered_operation in registered_operations.keys()]
Expand All @@ -15,7 +15,7 @@ def register(operation: Operation, callable: Callable):
registered_operations[operation] = callable


def isRegisteredByName(word):
def is_registered_by_name(word):
''''''
global registered_operations
for registered_operation in registered_operations.keys():
Expand All @@ -24,7 +24,7 @@ def isRegisteredByName(word):
return False


def getRegisteredOperationByName(word):
def get_registered_operation_by_name(word):
''''''
global registered_operations
for registered_operation in registered_operations.keys():
Expand Down

0 comments on commit 697e452

Please sign in to comment.