openjournals / joss-reviews

Reviews for the Journal of Open Source Software
Creative Commons Zero v1.0 Universal
707 stars 37 forks source link

[REVIEW]: Linopy: Linear optimization with n-dimensional labeled variables #4823

Closed editorialbot closed 1 year ago

editorialbot commented 1 year ago

Submitting author: !--author-handle-->@fabianhofmann<!--end-author-handle-- (Fabian Hofmann) Repository: https://github.com/PyPSA/linopy Branch with paper.md (empty if default branch): joss Version: v0.0.11 Editor: !--editor-->@Fei-Tao<!--end-editor-- Reviewers: @torressa, @g4brielvs Archive: 10.5281/zenodo.7751989

Status

status

Status badge code:

HTML: <a href="https://joss.theoj.org/papers/1cb9253438483e4d336508d9a26646f7"><img src="https://joss.theoj.org/papers/1cb9253438483e4d336508d9a26646f7/status.svg"></a>
Markdown: [![status](https://joss.theoj.org/papers/1cb9253438483e4d336508d9a26646f7/status.svg)](https://joss.theoj.org/papers/1cb9253438483e4d336508d9a26646f7)

Reviewers and authors:

Please avoid lengthy details of difficulties in the review thread. Instead, please create a new issue in the target repository and link to those issues (especially acceptance-blockers) by leaving comments in the review thread below. (For completists: if the target issue tracker is also on GitHub, linking the review thread in the issue or vice versa will create corresponding breadcrumb trails in the link target.)

Reviewer instructions & questions

@torressa & @g4brielvs, your review will be checklist based. Each of you will have a separate checklist that you should update when carrying out your review. First of all you need to run this command in a separate comment to create the checklist:

@editorialbot generate my checklist

The reviewer guidelines are available here: https://joss.readthedocs.io/en/latest/reviewer_guidelines.html. Any questions/concerns please let @Fei-Tao know.

Please start on your review when you are able, and be sure to complete your review in the next six weeks, at the very latest

Checklists

📝 Checklist for @g4brielvs

📝 Checklist for @torressa

editorialbot commented 1 year ago

Hello humans, I'm @editorialbot, a robot that can help you with some common editorial tasks.

For a list of things I can do to help you, just type:

@editorialbot commands

For example, to regenerate the paper pdf after making changes in the paper's md or bib files, type:

@editorialbot generate pdf
editorialbot commented 1 year ago
Software report:

github.com/AlDanial/cloc v 1.88  T=0.09 s (693.6 files/s, 119218.6 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          37           1537           1749           3946
TeX                              1             39              0            435
reStructuredText                 7            198            171            306
Jupyter Notebook                 7              0           2103            194
YAML                             5             19              6            149
Markdown                         3             52              0             94
CSS                              1             13              3             54
Julia                            1              6              1             37
DOS Batch                        1              8              1             26
make                             1              4              7              9
TOML                             1              1              0              4
-------------------------------------------------------------------------------
SUM:                            65           1877           4041           5254
-------------------------------------------------------------------------------

gitinspector failed to run statistical information for the repository
editorialbot commented 1 year ago

Wordcount for paper.md is 1261

editorialbot commented 1 year ago
Reference check summary (note 'MISSING' DOIs are suggestions that need verification):

OK DOIs

- 10.3390/pr6080106 is OK
- 10.5334/jors.188 is OK
- 10.5281/zenodo.1208706 is OK
- 10.5281/ZENODO.6478312 is OK
- 10.1007/978-1-4613-0215-5_8 is OK
- 10.7249/R366 is OK
- 10.1137/15M1020575 is OK
- 10.5281/ZENODO.6522795 is OK
- 10.1287/mnsc.36.5.519 is OK
- 10.1016/j.apenergy.2021.117377 is OK
- 10.1038/s41586-020-2649-2 is OK
- 10.1007/978-3-319-58821-6 is OK
- 10.1016/j.esr.2018.08.012 is OK
- 10.5334/jors.148 is OK
- 10.1007/s12532-017-0130-5 is OK
- 10.1016/0041-5553(80)90061-0 is OK
- 10.1016/j.cor.2019.104807 is OK
- 10.1145/2490257.2490283 is OK
- 10.5281/ZENODO.3509134 is OK
- 10.1016/j.ejor.2021.06.063 is OK
- 10.1109/38.56302 is OK
- 10.2307/2344013 is OK

MISSING DOIs

- 10.7249/r366 may be a valid DOI for title: Linear Programming and Extensions
- 10.1007/978-1-4613-0215-5_8 may be a valid DOI for title: General Algebraic Modeling System (GAMS)

INVALID DOIs

- None
editorialbot commented 1 year ago

:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:

g4brielvs commented 1 year ago

Review checklist for @g4brielvs

Conflict of interest

Code of Conduct

General checks

Functionality

Documentation

Software paper

torressa commented 1 year ago

Review checklist for @torressa

Conflict of interest

Code of Conduct

General checks

Functionality

Documentation

Software paper

torressa commented 1 year ago

Hi, @FabianHofmann.

Sorry for the delay, I want to get the ball rolling on this one so this is my first pass on the review. I will come back with more once I find more time.

Really enjoyed looking through this, nicely written code and easy to follow.

I have mostly minor comments/things I'd like to see. Feel free to provide arguments why my comments are not needed/appropriate.

Benchmarks

General code

General

File Types

Paper edits

FabianHofmann commented 1 year ago

Hey @toressa,

first of all thank you for your detailed review! These are all very helpful comments and I could finally find some time to address them. Since version 0.0.11 actually a lot has happened. A lot has to do with stabilizing the API and the data handling. I will try to address all your comments in the following.

Benchmarks

The benchmark was extended. It now includes the following models:

which can chosen by the user. The figure in the paper shows the benchmark of the knapsack problem. It compares the following apis:

However, ortools does not yet support gurobi v10, therefore it did not make it into the final figure. The knapsack model and the original problem lead to very similar overheads. So I hope it is okay to not extend the set of benchmark models further. As far I see it, the solution retrieval is included by the all AML's.

General code

I added a constants module to define sets of constant values used in linopy, i.e. senses, solver status, termination condition. It also includes a solution class definition and result class definition (used for consistent print out of results).

To answer your question about the preferred tool, from the computational point of view, it does not make a difference which data handling tool (numpy, pandas, xarray) is used, as they all rely on numpy arrays in the background. However, I pointed out in the doc that xarray is the most convenient and safe tool to create variables.

General

I added a CONTRIBUTING.md file to the repository. It points to the contributing guidelines in the documentation.

As for the PWL and QC, we discussed a rough but promising structure how to represent them. But for the proper implementation, I will need to have some spare time, or have a motivated and competent student to work on it. So I hope it is fine to not make a requirement for the JOSS contribution.

Good point about the more complex example cases. There were already some users asking for it. I created an issue that I will work on in the next weeks.

File Types

NetCDF is a data format that is used in many scientific fields. It is a very convenient format to store multidimensional data. It is also the default format for xarray, is extremely fast, and can be used to store large amounts of data. In OR, NetCDF is not used to my knowledge. Its use case here is not transferring a linopy model to other APIs but rather store a linopy model to fast disk. It is also used when solving a linopy model on a remote server.

The export in MPS file format is now also supported by linopy. And tested across all solvers https://github.com/PyPSA/linopy/pull/97

The executable files were corrected.

Citation

I added a citation for PuLP

About the naming. Fair point. However I wanted to build the bridge between the data science and the OR community. So, unless I have a brainwave, I would stick to that name.


I hope that tackles all the point so far!

Thanks again and looking forward to hear from you!

Also pinging @g4brielvs whether there are remaining things on the list that I should cover for the package :)

FabianHofmann commented 1 year ago

@Fei-Tao a short question: is it possible to update the version of the package addressed in the paper?

g4brielvs commented 1 year ago

@FabianHofmann Apologies for my delayed response! I'll add my comments before the end of the week.

Fei-Tao commented 1 year ago

@FabianHofmann Yes. that is possible.

@g4brielvs Thanks for your response. Please feel free to let me know if you have any questions about reviewing this submission.

FabianHofmann commented 1 year ago

Great, thank you @g4brielvs and @Fei-Tao

FabianHofmann commented 1 year ago

@g4brielvs just pinging you (perhaps this week suits better)

editorialbot commented 1 year ago

Hello @g4brielvs, here are the things you can ask me to do:


# List all available commands
@editorialbot commands

# Get a list of all editors's GitHub handles
@editorialbot list editors

# Check the references of the paper for missing DOIs
@editorialbot check references

# Perform checks on the repository
@editorialbot check repository

# Adds a checklist for the reviewer using this command
@editorialbot generate my checklist

# Set a value for branch
@editorialbot set joss-paper as branch

# Generates the pdf paper
@editorialbot generate pdf

# Generates a LaTeX preprint file
@editorialbot generate preprint

# Get a link to the complete list of reviewers
@editorialbot list reviewers
g4brielvs commented 1 year ago

@FabianHofmann Apologies for the delay. Thank you for submitting this package and after @torressa's comments were addressed, all looks great to me.

FabianHofmann commented 1 year ago

thank you very much @g4brielvs!

Gently pinging @torressa, could you have a look at the addressed review comments above?

torressa commented 1 year ago

@editorialbot generate pdf

editorialbot commented 1 year ago

:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:

FabianHofmann commented 1 year ago

@torressa gently pinging you again. Do you have any remaining comments?

torressa commented 1 year ago

Thanks for all the work!

I think I am happy now with the code. Just a few more items for the paper itself. I ran the benchmarks and I think the experiments in the paper need a bit more detail. Particularly, version numbers (e.g. Python, gurobipy, Julia, JuMP) and machine details (CPU specs, OS) and benchmark model (i.e. knapsack or other).

When I ran these on my machine the plots looked slightly different that's why I am asking. (I also had to modify the profiling function to populate the memory field for it to produce a plot).

Citations:

@misc{gurobi,
  author = {{Gurobi Optimization, LLC}},
  title = {{Gurobi Optimizer Reference Manual}},
  year = 2023,
  url = "https://www.gurobi.com"
}

I didn't really find citation details for the other solvers.

FabianHofmann commented 1 year ago

@torressa thanks for reviewing again. I've created a README for the benchmark which gives all necessary information how to reproduce the plots. Software and hardware specifications are now given here, these are also referenced in the paper. As for the memory profiler, I have to admit that this is also a bit opaque for me. I have relied on the built-in memory profiler of snakemake. It seemed that sometimes it does not yield expected values. However with the current setting (fixed number of threads per job), it seems to be quite stable. Please let me know if you encounter problems. I have adjusted the Gurobi reference, thanks for looking into it.

Let me know if there is further things to do :)

torressa commented 1 year ago

Perfect thanks! All good from my side. We need to bump the version but other than that good to go.

Fei-Tao commented 1 year ago

@torressa, @g4brielvs, Thank you for your time for reviewing this paper.

@FabianHofmann At this point, could you make a new release of this software that includes the changes resulting from this review? Then, please make an archive of the software in Zenodo/figshare/other service and update this thread with the DOI of the archive. For the Zenodo/figshare archive, please make sure that:

The title of the archive is the same as the JOSS paper title That the authors of the archive are the same as the JOSS paper authors I can then move forward with accepting the submission.

FabianHofmann commented 1 year ago

@editorialbot generate pdf

editorialbot commented 1 year ago

:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:

FabianHofmann commented 1 year ago

@editorialbot generate pdf

editorialbot commented 1 year ago

:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:

FabianHofmann commented 1 year ago

@Fei-Tao thank you for the instruction. I have published the new linopy version v0.1.4 (https://github.com/PyPSA/linopy/releases/tag/v0.1.4) which should be the associated with the paper. I have also created an archive of the software published in https://zenodo.org/record/7751989.

Please let me know if something is still missing

FabianHofmann commented 1 year ago

@torressa and @g4brielvs thank you again very much for the reviews! They helped a lot to improve the software :)

FabianHofmann commented 1 year ago

@Fei-Tao did the releases fulfill the needs? Happy to adjust things if needed.

Fei-Tao commented 1 year ago

@FabianHofmann I am on traveling this week. I’ll get back to you next week. Sorry for the delay.

Fei-Tao commented 1 year ago

@editorialbot check references

editorialbot commented 1 year ago
Reference check summary (note 'MISSING' DOIs are suggestions that need verification):

OK DOIs

- 10.3390/pr6080106 is OK
- 10.5334/jors.188 is OK
- 10.5281/zenodo.1208706 is OK
- 10.5281/ZENODO.6478312 is OK
- 10.1007/978-1-4613-0215-5_8 is OK
- 10.7249/R366 is OK
- 10.1137/15M1020575 is OK
- 10.5281/ZENODO.6522795 is OK
- 10.1287/mnsc.36.5.519 is OK
- 10.1016/j.apenergy.2021.117377 is OK
- 10.1038/s41586-020-2649-2 is OK
- 10.1007/978-3-319-58821-6 is OK
- 10.1016/j.esr.2018.08.012 is OK
- 10.5334/jors.148 is OK
- 10.1007/s12532-017-0130-5 is OK
- 10.1016/0041-5553(80)90061-0 is OK
- 10.1016/j.cor.2019.104807 is OK
- 10.1145/2490257.2490283 is OK
- 10.5281/ZENODO.3509134 is OK
- 10.1016/j.ejor.2021.06.063 is OK
- 10.1109/38.56302 is OK
- 10.2307/2344013 is OK

MISSING DOIs

- 10.1080/23307706.2017.1397554 may be a valid DOI for title: A Rewriting System for Convex Optimization Problems
- 10.7249/r366 may be a valid DOI for title: Linear Programming and Extensions
- 10.1007/978-1-4613-0215-5_8 may be a valid DOI for title: General Algebraic Modeling System (GAMS)

INVALID DOIs

- None
Fei-Tao commented 1 year ago

Hi @FabianHofmann, please fix the DOI of the references. Thanks for your time.

FabianHofmann commented 1 year ago

@editorialbot check references

FabianHofmann commented 1 year ago

Hey @Fei-Tao , I have updated the DOIs. However, the editorialbot did not react when asked for checking (perhaps it needs a couple of minutes?)

editorialbot commented 1 year ago
Reference check summary (note 'MISSING' DOIs are suggestions that need verification):

OK DOIs

- 10.1080/23307706.2017.1397554 is OK
- 10.3390/pr6080106 is OK
- 10.5334/jors.188 is OK
- 10.5281/zenodo.1208706 is OK
- 10.5281/ZENODO.6478312 is OK
- 10.1007/978-1-4613-0215-5_8 is OK
- 10.7249/R366 is OK
- 10.1137/15M1020575 is OK
- 10.5281/ZENODO.6522795 is OK
- 10.1287/mnsc.36.5.519 is OK
- 10.1016/j.apenergy.2021.117377 is OK
- 10.1038/s41586-020-2649-2 is OK
- 10.1007/978-3-319-58821-6 is OK
- 10.1016/j.esr.2018.08.012 is OK
- 10.5334/jors.148 is OK
- 10.1007/s12532-017-0130-5 is OK
- 10.1016/0041-5553(80)90061-0 is OK
- 10.1016/j.cor.2019.104807 is OK
- 10.1145/2490257.2490283 is OK
- 10.5281/ZENODO.3509134 is OK
- 10.1016/j.ejor.2021.06.063 is OK
- 10.1109/38.56302 is OK
- 10.2307/2344013 is OK

MISSING DOIs

- 10.7249/r366 may be a valid DOI for title: Linear Programming and Extensions
- 10.1007/978-1-4613-0215-5_8 may be a valid DOI for title: General Algebraic Modeling System (GAMS)

INVALID DOIs

- None
Fei-Tao commented 1 year ago

@FabianHofmann, no problem, we can check the reference again later.

FabianHofmann commented 1 year ago

Ah it seemed to take a moment, let's give it one more try.

FabianHofmann commented 1 year ago

@editorialbot check references

editorialbot commented 1 year ago
Reference check summary (note 'MISSING' DOIs are suggestions that need verification):

OK DOIs

- 10.3390/pr6080106 is OK
- 10.5334/jors.188 is OK
- 10.5281/zenodo.1208706 is OK
- 10.5281/ZENODO.6478312 is OK
- 10.1007/978-1-4613-0215-5_8 is OK
- 10.7249/R366 is OK
- 10.1137/15M1020575 is OK
- 10.5281/ZENODO.6522795 is OK
- 10.1287/mnsc.36.5.519 is OK
- 10.1016/j.apenergy.2021.117377 is OK
- 10.1038/s41586-020-2649-2 is OK
- 10.1007/978-3-319-58821-6 is OK
- 10.1016/j.esr.2018.08.012 is OK
- 10.5334/jors.148 is OK
- 10.1007/s12532-017-0130-5 is OK
- 10.1016/0041-5553(80)90061-0 is OK
- 10.1016/j.cor.2019.104807 is OK
- 10.1145/2490257.2490283 is OK
- 10.5281/ZENODO.3509134 is OK
- 10.1016/j.ejor.2021.06.063 is OK
- 10.1109/38.56302 is OK
- 10.2307/2344013 is OK

MISSING DOIs

- None

INVALID DOIs

- None
Fei-Tao commented 1 year ago

@editorialbot generate pdf

editorialbot commented 1 year ago

:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:

Fei-Tao commented 1 year ago

@FabianHofmann, could you make a new release of this software that includes the changes resulting from this review. Then, please make an archive of the software in Zenodo/figshare/other service and update this thread with the DOI of the archive. For the Zenodo/figshare archive, please make sure that:

The title of the archive is the same as the JOSS paper title That the authors of the archive are the same as the JOSS paper authors I can then move forward with accepting the submission.

FabianHofmann commented 1 year ago

@Fei-Tao thank you for the instruction. I have published the new linopy version v0.1.4 (https://github.com/PyPSA/linopy/releases/tag/v0.1.4) which should be the associated with the paper. I have also created an archive of the software published in https://zenodo.org/record/7751989.

Hey @Fei-Tao this was already done some days ago, see above. Does that meet all requirements?

Fei-Tao commented 1 year ago

@editorialbot set 10.5281/zenodo.7751989 as archive

editorialbot commented 1 year ago

Done! Archive is now 10.5281/zenodo.7751989

Fei-Tao commented 1 year ago

@editorialbot recommend-accept

editorialbot commented 1 year ago
Attempting dry run of processing paper acceptance...