Skip to content
Snippets Groups Projects
Commit 8b0fcc57 authored by shinedday's avatar shinedday
Browse files

Add bunch of docstring and type

parent e5cc5e02
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent)) ...@@ -9,7 +9,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent))
from pyAmakCore.exception.override import ToOverrideWarning from pyAmakCore.exception.override import ToOverrideWarning
class Schedulable(): class Schedulable:
""" """
Class Schedulable Class Schedulable
""" """
......
...@@ -11,7 +11,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent)) ...@@ -11,7 +11,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent))
from pyAmakCore.classes.schedulable import Schedulable from pyAmakCore.classes.schedulable import Schedulable
class Scheduler(): class Scheduler:
""" """
Scheduler class, to make sure that environment and amas are always sync together Scheduler class, to make sure that environment and amas are always sync together
""" """
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
class allowing to save the state of the system at a given moment class allowing to save the state of the system at a given moment
""" """
from os import path from os import path
from typing import List
from pandas import DataFrame from pandas import DataFrame
...@@ -14,7 +15,7 @@ class Loggable: ...@@ -14,7 +15,7 @@ class Loggable:
self.__do_log = False self.__do_log = False
self.__file_path = None self.__file_path = None
def to_csv(self, cycle, var_list): def to_csv(self, cycle: int, var_list: List['Agent']) -> None:
""" """
get cycle and agent list and print them get cycle and agent list and print them
""" """
...@@ -34,8 +35,14 @@ class Loggable: ...@@ -34,8 +35,14 @@ class Loggable:
else: else:
dataframe.to_csv(path_or_buf=self.__file_path, index=False) dataframe.to_csv(path_or_buf=self.__file_path, index=False)
def set_do_log(self, boolean): def set_do_log(self, boolean: bool) -> None:
"""
tell the amas if it should log or not
"""
self.__do_log = boolean self.__do_log = boolean
def set_file_path(self, path_to_file): def set_file_path(self, path_to_file: str) -> None:
"""
specify path to csv
"""
self.__file_path = path_to_file self.__file_path = path_to_file
"""
Agent phases
"""
from enum import Enum, auto from enum import Enum, auto
......
"""
Agent execution policy
"""
from enum import Enum, auto from enum import Enum, auto
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment