From 6a7afa2703c0feba89f1e5b4c9dc405a1dec97ab Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff <35577657+nikhilwoodruff@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:41:12 +0200 Subject: [PATCH] Minor bug fixes (#258) * Fix minor bug * Fix typing bug --- changelog_entry.yaml | 4 ++++ policyengine_core/data/dataset.py | 2 +- policyengine_core/types/data_types/arrays.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..9dc4a0329 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + fixed: + - Bugs in typing and Dataset saving. diff --git a/policyengine_core/data/dataset.py b/policyengine_core/data/dataset.py index 5752351fe..656f34ecc 100644 --- a/policyengine_core/data/dataset.py +++ b/policyengine_core/data/dataset.py @@ -187,7 +187,7 @@ def save_dataset(self, data, file_path: str = None) -> None: f"Could not save {variable} to {file}. The value is {value}." ) elif self.data_format == Dataset.FLAT_FILE: - values.to_csv(file, index=False) + data.to_csv(file, index=False) def load_dataset( self, diff --git a/policyengine_core/types/data_types/arrays.py b/policyengine_core/types/data_types/arrays.py index be3a146be..4068906fb 100644 --- a/policyengine_core/types/data_types/arrays.py +++ b/policyengine_core/types/data_types/arrays.py @@ -3,7 +3,7 @@ T = TypeVar("T", bool, bytes, float, int, object, str) -ArrayLike = ArrayType[Any] | Sequence[T] +ArrayLike = Sequence[T] """:obj:`typing.Generic`: Type of any castable to :class:`numpy.ndarray`.