Skip to content

Commit

Permalink
fixing some linting and mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kels271828 committed Dec 6, 2024
1 parent ca29d90 commit dad8af2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/onemod/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def check_exists(
FIXME: Assumes pipeline has been built (so paths are absolute)
"""
item_names = item_names or self.items.keys()
item_names = item_names or set(self.items.keys())
upstream_stages = upstream_stages or self.dependencies

missing_items = {}
Expand Down
14 changes: 1 addition & 13 deletions src/onemod/utils/subsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,12 @@
import polars as pl


# def create_subsets(groupby: set[str], lf: pl.LazyFrame) -> pl.DataFrame:
# """Create subsets from groupby."""
# subsets = (
# lf.select(list(groupby))
# .unique()
# .with_row_index(name="subset_id")
# .collect()
# )

# return subsets


def create_subsets(groupby: set[str], data: pd.DataFrame) -> pd.DataFrame:
"""Create subsets from groupby."""
sorted_groupby = sorted(groupby)
groups = data.groupby(sorted_groupby)
subsets = pd.DataFrame(
[subset for subset in groups.groups.keys()], columns=groups.keys
[subset for subset in groups.groups.keys()], columns=sorted_groupby
)
subsets.sort_values(by=sorted_groupby)
subsets["subset_id"] = subsets.index
Expand Down

0 comments on commit dad8af2

Please sign in to comment.