typing and comment changes

This commit is contained in:
Andreas Tsouchlos 2022-11-23 12:59:06 +01:00
parent e5934d9948
commit 2885ab76c6

View File

@ -24,8 +24,6 @@ def count_bit_errors(d: np.array, d_hat: np.array) -> int:
# TODO: Write unit tests # TODO: Write unit tests
# TODO: Create generic Simulator Interface which should be implemented for
# specific applications
class Simulator: class Simulator:
"""Class allowing for saving of simulations state. """Class allowing for saving of simulations state.
@ -243,7 +241,6 @@ class Simulator:
return pd.DataFrame(data) return pd.DataFrame(data)
# TODO: Fix typing.Any or Simulator
class SimulationDeSerializer: class SimulationDeSerializer:
"""Class responsible for file management, de- and serialization of """Class responsible for file management, de- and serialization of
Simulator objects.""" Simulator objects."""
@ -300,7 +297,7 @@ class SimulationDeSerializer:
return sim_names return sim_names
def remove_unfinished_sim(self, sim_name): def remove_unfinished_sim(self, sim_name: str):
"""Remove the savefile of a previously paused simulation. """Remove the savefile of a previously paused simulation.
:param sim_name: Name of the simulation :param sim_name: Name of the simulation
@ -376,8 +373,8 @@ class SimulationDeSerializer:
return results, metadata return results, metadata
# TODO: Fix typing.Any or Simulator
# TODO: Autosave simulation every so often # TODO: Autosave simulation every so often
# TODO: Comment explaining what a Simulator class is
class SimulationManager: class SimulationManager:
"""This class only contains functions relating to stopping and """This class only contains functions relating to stopping and
restarting of simulations (and storing of the simulation state in a restarting of simulations (and storing of the simulation state in a
@ -423,7 +420,7 @@ class SimulationManager:
return self._de_serializer.get_unfinished_sims() return self._de_serializer.get_unfinished_sims()
def load_unfinished(self, sim_name: str) -> None: def load_unfinished(self, sim_name: str) -> None:
"""Load the state of an unfinished simulation its savefile. """Load the state of an unfinished simulation form its savefile.
Warning: This function deletes the savefile after loading. Warning: This function deletes the savefile after loading.
""" """