Skip to content

Commit

Permalink
Mod: Update workflow python version and add num_rows and num_columns …
Browse files Browse the repository at this point in the history
…for AACDataset base class.
  • Loading branch information
Labbeti committed Oct 25, 2023
1 parent c2df7fd commit fb8a3f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package-pip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
# --- INSTALLATIONS ---
Expand Down
12 changes: 11 additions & 1 deletion src/aac_datasets/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,23 @@ def flat_captions(self) -> bool:
"""Returns true if captions has been flattened."""
return self._flat_captions

@property
def num_columns(self) -> int:
"""Number of columns in the dataset."""
return len(self.column_names)

@property
def num_rows(self) -> int:
"""Number of rows in the dataset (same as len())."""
return len(self)

@property
def raw_data(self) -> Dict[str, List[Any]]:
return self._raw_data

@property
def shape(self) -> Tuple[int, int]:
"""The shape of the dataset."""
"""Shape of the dataset (number of columns, number of rows)."""
return len(self), len(self.column_names)

@property
Expand Down

0 comments on commit fb8a3f0

Please sign in to comment.