Skip to content

Commit

Permalink
fix: mypy configuration error
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo-digian committed Sep 10, 2024
1 parent 1312342 commit 98e3950
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nervaluate/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def evaluate(self) -> Tuple[Dict, Dict, Dict, Dict]:

return self.results, self.evaluation_agg_entities_type, self.evaluation_indices, self.evaluation_agg_indices

# Helper method to flatten a nested dictionary
def _flatten_dict(self, d, parent_key='', sep='.') -> dict:
# Helper method to flatten a nested dictionary
def _flatten_dict(self, d: Dict[str, Any], parent_key: str = '', sep: str = '.') -> Dict[str, Any]:
"""
Flattens a nested dictionary.
Expand All @@ -134,7 +134,7 @@ def _flatten_dict(self, d, parent_key='', sep='.') -> dict:
Returns:
dict: A flattened dictionary.
"""
items = []
items: List[Tuple[str, Any]] = []
for k, v in d.items():
new_key = f"{parent_key}{sep}{k}" if parent_key else k
if isinstance(v, dict):
Expand All @@ -144,7 +144,7 @@ def _flatten_dict(self, d, parent_key='', sep='.') -> dict:
return dict(items)

# Modified results_to_dataframe method using the helper method
def results_to_dataframe(self) -> pd.DataFrame:
def results_to_dataframe(self) -> Any:
if not self.results:
raise ValueError("self.results should be defined.")

Expand Down

0 comments on commit 98e3950

Please sign in to comment.