
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
gurobi-logtools
Advanced tools
With gurobi-logtools, you can extract information from Gurobi log files and generate pandas DataFrames or Excel worksheets for further processing. We also include a plot method which combines the power of interactive dashboards through ipywidgets
and plotting functions from plotly.express
, making it easy to explore your data and results!
[!NOTE] We have renamed the project to
gurobi-logtools
, so please also adapt the import statement accordingly:
import gurobi_logtools as glt
python -m pip install gurobi-logtools
It is recommended to prepend the pip install
command with python -m
to ensure that the package is installed using the correct Python version currently active in your environment.
See CHANGELOG for added, removed, or fixed functionality.
First, you need a set of Gurobi log files to compare, e.g.,
For a description of the plotting dashboard, please see the following link: Gurobi-logtools plotting dashboard
We provide a TUTORIAL in the form of a gurobi-logtools.ipynb notebook with the example data set to get started. Additionally, there is a Gurobi TechTalk demonstrating how to use it (YouTube), but please note it presents a version of gurobi-logtools that is several years old (but the big ideas remain the same):
Parse log files:
import gurobi_logtools as glt
results = glt.parse(["run1/*.log", "run2/*.log"])
summary = results.summary()
nodelog_progress = results.progress("nodelog")
Depending on your requirements, you may need to filter or modify the resulting DataFrames.
Draw interactive charts, preferably in a Jupyter Notebook:
glt.plot(summary)
glt.plot(nodelog_progress, x="Time", y="Gap", color="Log", type="line")
glt.plot(results.progress("norel"), x="Time", y="Incumbent", color="Log", type="line")
These are just examples using the Plotly Python library - of course, any other plotting library of your choice can be used to work with these DataFrames.
glt.register_custom_palette(name, colors): Use this function to add custom palettes to the "Custom" group in the palette type field. The arguments should be a string and a list/tuple of hex strings, respectively.
glt.reset_custom_palettes(): clears all custom palettes added
glt.show_palettes(): displays a colorful guide to Plotly's built-in palettes
glt.get_plotly_fig(): use this function to access the underlying Plotly figure. You can use this figure object to perform detailed customizations via the Figure.update_layout
, Figure.update_traces
, Figure.update_xaxes
, and Figure.update_yaxes
functions.
glt.save_plot(filepath): use this function to save the plot to a range of formats, including PNG, SVG, PDF, and HTML. The filetype is inferred from the extension of the filepath. Note that additional packages may need to be installed depending on the filetype.
Convert your log files to Excel worksheets right on the command line:
python -m gurobi_logtools myrun.xlsx data/*.log
List all available options and how to use the command-line tool:
python -m gurobi_logtools --help
The command line tool can also rename log files according to the parameters set and model solved in a given run. This is useful if your log files do not have a consistent naming scheme, or if multiple runs are logged per file and you want to extract the individual runs.
For example:
python -m gurobi_logtools --write-to-dir nicenames summary.xlsx tests/assets/combined/*.log
Separates logs for individual runs in the input files and writes copies to the 'nicenames' folder with a consistent naming scheme.
FAQs
Gurobi log file tools for parsing and exploring data
We found that gurobi-logtools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.