joss-reviews
joss-reviews copied to clipboard
[REVIEW]: Linopy: Linear optimization with n-dimensional labeled variables
Submitting author: @fabianhofmann (Fabian Hofmann) Repository: https://github.com/PyPSA/linopy Branch with paper.md (empty if default branch): joss Version: v0.0.11 Editor: @Fei-Tao Reviewers: @torressa, @g4brielvs Archive: Pending
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: [](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
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
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
Wordcount for paper.md
is 1261
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
:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:
Review checklist for @g4brielvs
Conflict of interest
- [x] I confirm that I have read the JOSS conflict of interest (COI) policy and that: I have no COIs with reviewing this work or that any perceived COIs have been waived by JOSS for the purpose of this review.
Code of Conduct
- [x] I confirm that I read and will adhere to the JOSS code of conduct.
General checks
- [x] Repository: Is the source code for this software available at the https://github.com/PyPSA/linopy?
- [x] License: Does the repository contain a plain-text LICENSE file with the contents of an OSI approved software license?
- [x] Contribution and authorship: Has the submitting author (@fabianhofmann) made major contributions to the software? Does the full list of paper authors seem appropriate and complete?
- [x] Substantial scholarly effort: Does this submission meet the scope eligibility described in the JOSS guidelines
- [x] Data sharing: If the paper contains original data, data are accessible to the reviewers. If the paper contains no original data, please check this item.
- [x] Reproducibility: If the paper contains original results, results are entirely reproducible by reviewers. If the paper contains no original results, please check this item.
- [x] Human and animal research: If the paper contains original data research on humans subjects or animals, does it comply with JOSS's human participants research policy and/or animal research policy? If the paper contains no such data, please check this item.
Functionality
- [x] Installation: Does installation proceed as outlined in the documentation?
- [x] Functionality: Have the functional claims of the software been confirmed?
- [x] Performance: If there are any performance claims of the software, have they been confirmed? (If there are no claims, please check off this item.)
Documentation
- [x] A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?
- [x] Installation instructions: Is there a clearly-stated list of dependencies? Ideally these should be handled with an automated package management solution.
- [x] Example usage: Do the authors include examples of how to use the software (ideally to solve real-world analysis problems).
- [x] Functionality documentation: Is the core functionality of the software documented to a satisfactory level (e.g., API method documentation)?
- [x] Automated tests: Are there automated tests or manual steps described so that the functionality of the software can be verified?
- [x] Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support
Software paper
- [x] Summary: Has a clear description of the high-level functionality and purpose of the software for a diverse, non-specialist audience been provided?
- [x] A statement of need: Does the paper have a section titled 'Statement of need' that clearly states what problems the software is designed to solve, who the target audience is, and its relation to other work?
- [x] State of the field: Do the authors describe how this software compares to other commonly-used packages?
- [x] Quality of writing: Is the paper well written (i.e., it does not require editing for structure, language, or writing quality)?
- [x] References: Is the list of references complete, and is everything cited appropriately that should be cited (e.g., papers, datasets, software)? Do references in the text use the proper citation syntax?
Review checklist for @torressa
Conflict of interest
- [x] I confirm that I have read the JOSS conflict of interest (COI) policy and that: I have no COIs with reviewing this work or that any perceived COIs have been waived by JOSS for the purpose of this review.
Code of Conduct
- [x] I confirm that I read and will adhere to the JOSS code of conduct.
General checks
- [x] Repository: Is the source code for this software available at the https://github.com/PyPSA/linopy?
- [x] License: Does the repository contain a plain-text LICENSE file with the contents of an OSI approved software license?
- [x] Contribution and authorship: Has the submitting author (@fabianhofmann) made major contributions to the software? Does the full list of paper authors seem appropriate and complete?
- [x] Substantial scholarly effort: Does this submission meet the scope eligibility described in the JOSS guidelines
- [x] Data sharing: If the paper contains original data, data are accessible to the reviewers. If the paper contains no original data, please check this item.
- [x] Reproducibility: If the paper contains original results, results are entirely reproducible by reviewers. If the paper contains no original results, please check this item.
- [x] Human and animal research: If the paper contains original data research on humans subjects or animals, does it comply with JOSS's human participants research policy and/or animal research policy? If the paper contains no such data, please check this item.
Functionality
- [x] Installation: Does installation proceed as outlined in the documentation?
- [x] Functionality: Have the functional claims of the software been confirmed?
- [x] Performance: If there are any performance claims of the software, have they been confirmed? (If there are no claims, please check off this item.)
Documentation
- [x] A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?
- [x] Installation instructions: Is there a clearly-stated list of dependencies? Ideally these should be handled with an automated package management solution.
- [x] Example usage: Do the authors include examples of how to use the software (ideally to solve real-world analysis problems).
- [x] Functionality documentation: Is the core functionality of the software documented to a satisfactory level (e.g., API method documentation)?
- [x] Automated tests: Are there automated tests or manual steps described so that the functionality of the software can be verified?
- [x] Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support
Software paper
- [x] Summary: Has a clear description of the high-level functionality and purpose of the software for a diverse, non-specialist audience been provided?
- [x] A statement of need: Does the paper have a section titled 'Statement of need' that clearly states what problems the software is designed to solve, who the target audience is, and its relation to other work?
- [x] State of the field: Do the authors describe how this software compares to other commonly-used packages?
- [x] Quality of writing: Is the paper well written (i.e., it does not require editing for structure, language, or writing quality)?
- [x] References: Is the list of references complete, and is everything cited appropriately that should be cited (e.g., papers, datasets, software)? Do references in the text use the proper citation syntax?
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
- Comparison of model building times for some well-known model types: e.g. p-median, knapsack, n-queens. I understand that it may not be any different for
linopy
, however, other APIs may have a different (and significant overhead for different, more complex constraints). - I'd like to see a comparison against all major Python packages: PuLP, Pyomo, Highspy, Gurobipy (standard API), Gurobipy-matrixAPI (note major changes in v10.0 so please re-run benchmarks), ortools-pywraplp. (I may have missed some).
- If you want to also include things like JuMP, (or other languages) it would be a more complete benchmark but I would say this is more optional.
- Include solution retrieval in these benchmarks: i.e. extract all variable solution values.
General code
- Status codes, termination conditions, and constraint signs are not easily maintainable as a string (e.g. typos,
m.add_constraints(x, ",", 0)
would work just error when trying to solve. Please add some appropriate internal constants or some other data structure for these three things. Users can then export and use (similar toGRB.OPTIMAL, GRB.EQUAL
etc). - What is the preferred way of building large models?
xarray
supports building from anything array-like, e.g. numpy, pandas dataframe, but would be good to know which is the best/fastest way of doing this, or your recommendation.
General
- Please add the info you have in the docs pages (https://linopy.readthedocs.io/en/latest/) about contributing in a
CONTRIBUTING.md
file (this is standard GitHub). - What's the status of generic non-linear constraints? Is this easy enough to do? https://github.com/PyPSA/linopy/issues/18
- PWL would be good (https://github.com/PyPSA/linopy/issues/19) but also other general constraints (not sure which ones would work). Also, not all solver support these.
- Functionality dive: for someone not used to the xarray syntax, it would be cool that you showcase some simple examples already in the README, however, this is my preference. I would also like to see some more complex examples in the examples directory. I like the shifting stuff with the
y
variables for example.
File Types
- More as a question: I have never heard of NetCDF, what are the advantages when compared to the widely used
mps
format, for example? - I would like to see functionality for MPS as well. And tested for across all solvers.
- LP files contain unnecessary blank lines. These can make files a lot bigger in size than they need to be.
- Some files are executable:
setup.py
,linopy/__init__.py
,test/test_model_creation.py
.
Paper edits
- PuLP needs a proper citation.
- N-dimensional labelled is not a very well-known term in the OR community (I'd never heard this term). I would revise the title to something that is more in the court of the core users of this package. (again, this is my opinion).
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:
- knapsack
- the original model
which can chosen by the user. The figure in the paper shows the benchmark of the knapsack problem. It compares the following apis:
- linopy
- JuMP
- cvxpy
- pulp
- pyomo
- gurobipy (matrix api)
- ortools
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 :)
@Fei-Tao a short question: is it possible to update the version of the package addressed in the paper?
@FabianHofmann Apologies for my delayed response! I'll add my comments before the end of the week.
@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.
Great, thank you @g4brielvs and @Fei-Tao
@g4brielvs just pinging you (perhaps this week suits better)
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
@FabianHofmann Apologies for the delay. Thank you for submitting this package and after @torressa's comments were addressed, all looks great to me.
thank you very much @g4brielvs!
Gently pinging @torressa, could you have a look at the addressed review comments above?
@editorialbot generate pdf
:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:
@torressa gently pinging you again. Do you have any remaining comments?
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.
@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 :)
Perfect thanks! All good from my side. We need to bump the version but other than that good to go.
@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.
@editorialbot generate pdf
:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:
@editorialbot generate pdf
:point_right::page_facing_up: Download article proof :page_facing_up: View article proof on GitHub :page_facing_up: :point_left:
@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
@torressa and @g4brielvs thank you again very much for the reviews! They helped a lot to improve the software :)