{"id":26155583,"url":"https://github.com/gurobi/gurobi-logtools","last_synced_at":"2025-04-10T00:19:03.617Z","repository":{"id":42472769,"uuid":"396883250","full_name":"Gurobi/gurobi-logtools","owner":"Gurobi","description":"Extract and visualize information from Gurobi log files","archived":false,"fork":false,"pushed_at":"2024-03-12T12:46:08.000Z","size":1181,"stargazers_count":90,"open_issues_count":6,"forks_count":17,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-01T19:30:07.178Z","etag":null,"topics":["logs","optimization","pandas","plotly","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gurobi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-16T16:45:05.000Z","updated_at":"2024-07-08T20:29:36.346Z","dependencies_parsed_at":"2023-10-11T23:06:43.579Z","dependency_job_id":"5847d2fd-2842-41bd-9cbc-6fdb370fa27d","html_url":"https://github.com/Gurobi/gurobi-logtools","commit_stats":{"total_commits":224,"total_committers":10,"mean_commits":22.4,"dds":0.6428571428571428,"last_synced_commit":"1865261523b2098987ec6c6f049d2b25db37815b"},"previous_names":["gurobi/gurobi-logtools","gurobi/grblogtools"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-logtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-logtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-logtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gurobi%2Fgurobi-logtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gurobi","download_url":"https://codeload.github.com/Gurobi/gurobi-logtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131414,"owners_count":21052838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logs","optimization","pandas","plotly","python"],"created_at":"2025-03-11T08:57:25.638Z","updated_at":"2025-04-10T00:19:03.588Z","avatar_url":"https://github.com/Gurobi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gurobi-logtools\n\n[![PyPI](https://img.shields.io/pypi/v/gurobi-logtools?label=PyPI)](https://pypi.python.org/pypi/gurobi-logtools)\n[![License](https://img.shields.io/github/license/Gurobi/gurobi-logtools?color=blue\u0026label=License)](https://github.com/Gurobi/gurobi-logtools/blob/master/LICENSE)\n[![Test Python Package](https://github.com/Gurobi/gurobi-logtools/actions/workflows/python-tox.yml/badge.svg?branch=master)](https://github.com/Gurobi/gurobi-logtools/actions/workflows/python-tox.yml)\n\nExtract information from Gurobi log files and generate [pandas DataFrames](https://pandas.pydata.org/) or Excel worksheets for further processing. Also includes a wrapper for out-of-the-box interactive visualizations using the plotting library [Plotly](https://plotly.com/python/).\n\n\u003e [!NOTE]\n\u003e We have renamed the project to `gurobi-logtools`, so please also adapt the import statement accordingly:\n\u003e\n\u003e `import gurobi_logtools as glt`\n\n![performance plot](https://github.com/Gurobi/gurobi-logtools/raw/master/assets/performance-plot.png)\n\n# Installation\n\n```\npython -m pip install gurobi-logtools\n```\n\nIt 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.\n\nSee [CHANGELOG](https://github.com/Gurobi/gurobi-logtools/blob/master/CHANGELOG.md) for added, removed or fixed functionality.\n\n# Usage\n\nFirst, you need a set of Gurobi log files to compare, e.g.,\n  - results from several model instances\n  - comparisons of different parameter settings\n  - performance variability experiments involving multiple random seed runs\n  - ...\n\nYou may also use the provided [gurobi-logtools.ipynb notebook](https://github.com/Gurobi/gurobi-logtools/blob/master/gurobi-logtools.ipynb) with the [example data set](https://github.com/Gurobi/gurobi-logtools/tree/master/data) to get started.\nAdditionally, there is a [Gurobi TechTalk demonstrating how to use it (YouTube)](https://youtu.be/wbg4Zr_A1s8):\n\n[![](https://github.com/Gurobi/gurobi-logtools/raw/master/assets/youtube-thumbnail.png)](https://youtu.be/wbg4Zr_A1s8)\n\n## Pandas/Plotly\n1. parse log files:\n    ```Python\n    import gurobi_logtools as glt\n\n    results = glt.parse([\"run1/*.log\", \"run2/*.log\"])\n    summary = results.summary()\n    nodelog_progress = results.progress(\"nodelog\")\n    ```\n    Depending on your requirements, you may need to filter or modify the resulting DataFrames.\n\n2. draw interactive charts, preferably in a [Jupyter Notebook](https://jupyter.org/):\n\n    - final results from the individual runs:\n    ```Python\n    glt.plot(summary, type=\"box\")\n    ```\n\n    - progress charts for the individual runs:\n    ```Python\n    glt.plot(nodelog_progress, y=\"Gap\", color=\"Log\", type=\"line\")\n    ```\n\n    - progress of the norel heuristic (note, the time recorded here is since the start of norel, and does not include presolve + read time):\n    ```Python\n    glt.plot(results.progress(\"norel\"), x=\"Time\", y=\"Incumbent\", color=\"Log\", type=\"line\")\n    ```\n\n    These are just examples using the [Plotly Python library](https://plotly.com/python/) - of course, any other plotting library of your choice can be used to work with these DataFrames.\n\n## Excel\nConvert your log files to Excel worksheets right on the command-line:\n\n```\npython -m gurobi_logtools myrun.xlsx data/*.log\n```\n\nList all available options and how to use the command-line tool:\n\n```\npython -m gurobi_logtools --help\n```\n\n## Rename log files\nThe 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.\n\nFor example:\n\n```\npython -m gurobi_logtools --write-to-dir nicenames summary.xlsx tests/assets/combined/*.log\n```\n\nseparates logs for individual runs in the input files and writes copies to the 'nicenames' folder with a consistent naming scheme:\n\n```\n\u003e ls nicenames\n912-MIPFocus1-Presolve1-TimeLimit600-glass4-0.log\n912-MIPFocus1-Presolve1-TimeLimit600-glass4-1.log\n912-MIPFocus1-Presolve1-TimeLimit600-glass4-2.log\n912-MIPFocus2-Presolve1-TimeLimit600-glass4-0.log\n912-MIPFocus2-Presolve1-TimeLimit600-glass4-1.log\n912-MIPFocus2-Presolve1-TimeLimit600-glass4-2.log\n912-Presolve1-TimeLimit600-glass4-0.log\n912-Presolve1-TimeLimit600-glass4-1.log\n912-Presolve1-TimeLimit600-glass4-2.log\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurobi%2Fgurobi-logtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgurobi%2Fgurobi-logtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurobi%2Fgurobi-logtools/lists"}