Skip to content

Commit

Permalink
Merge pull request #3 from BairdMcI/patch-1
Browse files Browse the repository at this point in the history
Addressing issues with dataclasses and pandas dataframe
  • Loading branch information
ivanp1994 authored May 29, 2024
2 parents b1d3ce7 + 09bedc1 commit 1fa351b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions PyMart/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ class DataBase(Base):
"""
name: str = ""
display_name: str = ""
_datasets: pd.DataFrame = pd.DataFrame(columns=["name", "display_name"])
_datasets: pd.DataFrame = field(init=False)

def __post_init__(self):
self._datasets = pd.DataFrame(columns=["name", "display_name"])

def _get_datasets(self):
"""
Expand Down Expand Up @@ -338,7 +341,7 @@ class Filter:
type: str
operator: str
sub_options: bool
options: pd.DataFrame = pd.DataFrame()
options: pd.DataFrame

def explain_filter(self, print_options=True):
"""
Expand Down Expand Up @@ -377,7 +380,10 @@ class DataSet(Base):
_config_xml: object = None
_attributes: List[Attribute] = field(default_factory=list)
_filters: List[Filter] = field(default_factory=list)
_homology: pd.DataFrame = pd.DataFrame()
_homology: pd.DataFrame = field(init=False)

def __post_init__(self):
_homology = pd.DataFrame()

@property
def config_xml(self):
Expand Down

0 comments on commit 1fa351b

Please sign in to comment.