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

Add support for the linopy io_api option #892

Merged
merged 3 commits into from Jan 24, 2024
Merged

Conversation

koen-vg
Copy link
Contributor

@koen-vg koen-vg commented Jan 24, 2024

Sorry for the barrage of issues and pull requests. I do think this is a nice and simple improvement.

Changes proposed in this Pull Request

Big fan of the io_api = "direct" option that linopy provides for HiGHS and Gurobi; it improves performance and actually solves some problems I've had with .lp files eating up too much disk space on funky cloud setups.

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.
  • A release note doc/release_notes.rst is added.

@koen-vg
Copy link
Contributor Author

koen-vg commented Jan 24, 2024

By the way this isn't worth a new issue but @fneum you seem to have accidentally added your personal config to the last commit to master.

@koen-vg
Copy link
Contributor Author

koen-vg commented Jan 24, 2024

Actually this seems to cause a problem with the snakemake workflow always re-running the solve_network rule; please don't merge until I fix it.

@koen-vg
Copy link
Contributor Author

koen-vg commented Jan 24, 2024

Nevermind, the re-running thing doesn't seem to be a problem with the present PR but with d145758! Feel free to merge this if desired.

@koen-vg
Copy link
Contributor Author

koen-vg commented Jan 24, 2024

Actually this seems to cause a problem with the snakemake workflow always re-running the solve_network rule; please don't merge until I fix it.

The re-running issue is now fixed in #893

Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

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

Nice addition!

Out of curiosity: Performance increases were in terms of memory or time?

@fneum fneum enabled auto-merge January 24, 2024 15:16
@fneum fneum disabled auto-merge January 24, 2024 15:57
@fneum fneum merged commit b8a303b into PyPSA:master Jan 24, 2024
5 checks passed
@koen-vg
Copy link
Contributor Author

koen-vg commented Jan 24, 2024

Out of curiosity: Performance increases were in terms of memory or time?

Definitely in terms of time; using the direct API keeps things in memory meaning that writing the .lp and reading it again is avoided; the time savings surely depend quite a bit on the file system. Of course it shouldn't matter for the time or memory taken by the actual solver: it "doesn't care" if it was fed a problem via python API or .lp file. Total memory use I haven't checked but don't think it changes much overall.

@koen-vg koen-vg deleted the io-api-option branch January 24, 2024 16:09
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.

None yet

2 participants