Skip to content

Commit

Permalink
move swe path into Data instance
Browse files Browse the repository at this point in the history
  • Loading branch information
hoishing committed Dec 21, 2024
1 parent 1d2a61b commit 5f3d7d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions natal/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@

type BodyPairs = Iterable[tuple[Aspectable, Aspectable]]

data_folder = Path(__file__).parent.absolute() / "data"
swe.set_ephe_path(str(data_folder))


class Data(DotDict):
"""
Data object for a natal chart.
"""

data_folder = Path(__file__).parent.absolute() / "data"

def __init__(
self,
name: str,
Expand All @@ -45,6 +44,7 @@ def __init__(
dt (datetime | str): Date and time as datetime object or string
config (Config): Configuration settings
"""
swe.set_ephe_path(str(self.data_folder))
self.name = name
self.city = city
if isinstance(dt, str):
Expand Down Expand Up @@ -309,7 +309,7 @@ def composite_aspects_pairs(self, data2: Self) -> BodyPairs:
@staticmethod
def get_cities() -> pd.DataFrame:
"""make cities data available outside Data class"""
return pd.read_csv(data_folder / "cities.csv.gz")
return pd.read_csv(Data.data_folder / "cities.csv.gz")

@cached_property
def cities(self) -> pd.DataFrame:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "natal"
version = "0.8.12"
version = "0.8.13"
description = "create Natal Chart with ease"
license = "MIT"
repository = "https://github.com/hoishing/natal"
Expand Down

0 comments on commit 5f3d7d7

Please sign in to comment.