Skip to content

Commit

Permalink
depricate: feature.data
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmetNSimsek committed Oct 10, 2024
1 parent 6b3a546 commit 1e2a64e
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions siibra/concepts/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,6 @@ def matrix_indices(self):
]
return sorted(attr, key=lambda a: a.extra[MATRIX_INDEX_ENTITY_KEY])

@property
def data(self):
logger.warning("`data` will be depricated! Use `extract_data()` instead.")
from ..attributes.datarecipes import TabularDataRecipe

matrix_entity_key = self.filter(attr_of_general_interest)

dfs: List[pd.DataFrame] = [d.get_data() for d in self._find(TabularDataRecipe)]
if len(matrix_entity_key.attributes) > 0:
mapping_idx = {
attr.extra[MATRIX_INDEX_ENTITY_KEY]: attr
for attr in matrix_entity_key.attributes
}

def remapper(index: int):
return mapping_idx.get(index, index)

for df in dfs:
df.rename(index=remapper, columns=remapper, inplace=True)

return dfs

def extract_data(self, expr: str = None, index: int = 0):
dp = self.get_datarecipe(expr=expr, index=index)
return dp.get_data()
Expand Down

0 comments on commit 1e2a64e

Please sign in to comment.