Skip to content

Commit

Permalink
Merge pull request #225 from Limmen/dev2
Browse files Browse the repository at this point in the history
minot typing errors fixed on several files
  • Loading branch information
Limmen authored Aug 17, 2023
2 parents eb28dc4 + f070369 commit 84a725e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def to_dict(self) -> Dict[str, Any]:
"""
:return: a dict represnetation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["credential"] = self.credential.to_dict()
d["root"] = self.root
d["port"] = self.port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Action(JSONSerializable):
DTO representing an action in a simulation environment
"""

def __init__(self, id: Union[int, float], descr: str):
def __init__(self, id: int, descr: str):
"""
Initializes the DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["actions"] = list(map(lambda x: x.to_dict(), self.actions))
d["action_type"] = self.action_type
d["descr"] = self.descr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Observation(JSONSerializable):
DTO class representing an observation in a simulation
"""

def __init__(self, id: Union[int, float], val: int, descr: str):
def __init__(self, id: int, val: int, descr: str):
"""
Initializes the DTO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class ObservationSpaceConfig(JSONSerializable):

def __init__(self, observations: List[Observation], observation_type: ValueType, descr: str,
player_id: int, observation_component_name_to_index: Dict[str, int],
observation_id_to_observation_id_vector: Dict[int, List],
observation_id_to_observation_vector: Dict[int, List],
observation_id_to_observation_id_vector: Dict[int, List[int]],
observation_id_to_observation_vector: Dict[int, List[int]],
component_observations: Dict[str, List[Observation]]):
"""
Initializes the DTO
Expand Down Expand Up @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]:
:return: a dict representation of the object
"""
d = {}
d: Dict[str, Any] = {}
d["observations"] = list(map(lambda x: x.to_dict(), self.observations))
d["observation_type"] = self.observation_type
d["descr"] = self.descr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, emulation_env_name: str, emulation_statistic_id: int,
self.emulation_env_name = emulation_env_name
self.emulation_statistic_id = emulation_statistic_id
self.id = -1
self.conditionals_kl_divergences = {}
self.conditionals_kl_divergences: Dict[str, Dict[str, Dict[str, float]]] = {}
self.compute_kl_divergences()

def compute_kl_divergences(self) -> None:
Expand Down Expand Up @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]:
"""
:return: a dict representation of the DTO
"""
d = {}
d: Dict[str, Any] = {}
d["conditional_metric_distributions"] = list(map(lambda x: list(map(lambda y: y.to_dict(), x)),
self.conditional_metric_distributions))
d["emulation_env_name"] = self.emulation_env_name
Expand Down

0 comments on commit 84a725e

Please sign in to comment.