Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lkstrp committed Aug 28, 2024
1 parent 325b3e2 commit 680eeaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ jobs:
- name: Install package and dependencies
run: |
python -m pip install uv
uv pip install --system nbmake requests
uv pip install --system "$(ls dist/*.whl)[dev]"
- name: Run type checker (mypy)
Expand Down
4 changes: 2 additions & 2 deletions linopy/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def sum(self, use_fallback: bool = False, **kwargs) -> LinearExpression:
if group_name == group_dim:
raise ValueError("Group name cannot be the same as group dimension")

arrays = [group, group.groupby(group).cumcount()] # type: ignore
arrays = [group, group.groupby(group).cumcount()]
idx = pd.MultiIndex.from_arrays(
arrays, names=[group_name, GROUPED_TERM_DIM]
)
Expand All @@ -239,7 +239,7 @@ def sum(self, use_fallback: bool = False, **kwargs) -> LinearExpression:
index = ds.indexes["group"].map({v: k for k, v in int_map.items()})
index.names = [str(col) for col in orig_group.columns]
index.name = group_name
coords = Coordinates.from_pandas_multiindex(index, group_name) # type: ignore
coords = Coordinates.from_pandas_multiindex(index, group_name)
ds = xr.Dataset(ds.assign_coords(coords))

return LinearExpression(ds, self.model)
Expand Down

0 comments on commit 680eeaf

Please sign in to comment.