Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.cumsum for Variables and LinearExpression #147

Merged
merged 10 commits into from
Jul 19, 2023
Merged

Conversation

hblunck
Copy link
Contributor

@hblunck hblunck commented Jul 12, 2023

Addresses #145

Implements (to the best of my knowledge) .cumsum methods for Variable and LinearExpression objects. No implementation is provided yet for e.g. LinearExpressionGroupBy objects.

@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Patch coverage: 69.23% and project coverage change: -0.09 ⚠️

Comparison is base (e9c9efc) 87.03% compared to head (3a56e6e) 86.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #147      +/-   ##
==========================================
- Coverage   87.03%   86.95%   -0.09%     
==========================================
  Files          14       14              
  Lines        3101     3112      +11     
  Branches      707      710       +3     
==========================================
+ Hits         2699     2706       +7     
- Misses        294      296       +2     
- Partials      108      110       +2     
Impacted Files Coverage Δ
linopy/expressions.py 87.45% <66.66%> (-0.33%) ⬇️
linopy/variables.py 90.75% <75.00%> (-0.18%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks @hblunck. Just one small thing

linopy/expressions.py Outdated Show resolved Hide resolved
@FabianHofmann
Copy link
Collaborator

and would you mind adding a small test to test_linear_expression? If you are time-constrained, I can also take over.

@hblunck
Copy link
Contributor Author

hblunck commented Jul 14, 2023

Hey @FabianHofmann , I added some tests, but they fail. On inspection (i.e. printing), the linear expressions are exactly what I would expect and they are also equal. But assert_linequal is throwing errors at me that I cannot decipher. I think I would have to hand it over to you at this point.

Copy link
Collaborator

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good solution. Let's keep it simplistic then

test/test_linear_expression.py Outdated Show resolved Hide resolved
test/test_linear_expression.py Outdated Show resolved Hide resolved
@FabianHofmann FabianHofmann merged commit a28b11f into PyPSA:master Jul 19, 2023
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants