Name | jsp-vis JSON |
Version |
1.1.0
JSON |
| download |
home_page | None |
Summary | A visualization tool for job shop scheduling problems. |
upload_time | 2024-07-10 13:48:04 |
maintainer | None |
docs_url | None |
author | Alexander Nasuta |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Alexander Nasuta Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
contourpy
cycler
fonttools
kaleido
kiwisolver
matplotlib
numpy
opencv-python
packaging
pandas
pillow
plotly
pyparsing
python-dateutil
pytz
six
tenacity
tzdata
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div id="top"></div>
<!-- PROJECT LOGO -->
<br />
<div align="center">
<!--
<a href="https://cybernetics-lab.de/">
<img src="https://github.com/Alexander-Nasuta/graph-jsp-env/raw/master/resources/readme_images/logo.png">
</a>
-->
<h1 align="center">
Job Shop Scheduling Problem Visualisations
</h1>
</div>
![](https://raw.githubusercontent.com/Alexander-Nasuta/jsp-vis/main/resources/ft06_console.gif)
- **Github**: https://github.com/Alexander-Nasuta/jsp-vis
- **PyPi**: https://pypi.org/project/jsp-vis/
# About The Project
Ths project provides visualisation for the Job Shop Scheduling Problem (JSP).
This is focused on Gantt charts. The input date for the visualisation is inspired by [plotly's Gantt chart api](https://plotly.com/python/gantt/).
`jsp-vis` is a standalone package and in designed to be used in combination with a JSP-reinforcement learning environments that follow the [Gymnasium Environment](https://gymnasium.farama.org/) standard.
The render function of the environment can be used to render the Gantt chart.
Typically the render function can implement different modes like `human`, `rgb_array` or `ansi` rendering.
The `jsp-vis` package offers three different visualisations: console visualisation, rgb_array visualisation and window visualisation.
The window visualisation is essentially only rendering the rgb_array visualisation in a window using OpenCV.
The console visualisation might be used for the `asni` mode of a render function, the rgb_array visualisation for the `rgb_array` mode and the window visualisation for the `human` mode.
# Installation
Install the package with pip:
```
pip install jsp-vis
```
# Minimal Working Example: console visualisation
```python
from jsp_vis.console import gantt_chart_console
import pandas as pd
df = pd.DataFrame([
{'Task': 'Job 0', 'Start': 5, 'Finish': 16, 'Resource': 'Machine 0'},
{'Task': 'Job 0', 'Start': 28, 'Finish': 31, 'Resource': 'Machine 1'},
{'Task': 'Job 0', 'Start': 31, 'Finish': 34, 'Resource': 'Machine 2'},
{'Task': 'Job 0', 'Start': 34, 'Finish': 46, 'Resource': 'Machine 3'},
{'Task': 'Job 1', 'Start': 0, 'Finish': 5, 'Resource': 'Machine 0'},
{'Task': 'Job 1', 'Start': 5, 'Finish': 21, 'Resource': 'Machine 2'},
{'Task': 'Job 1', 'Start': 21, 'Finish': 28, 'Resource': 'Machine 1'},
{'Task': 'Job 1', 'Start': 28, 'Finish': 32, 'Resource': 'Machine 3'}
])
num_of_machines = 4
gantt_chart_console(df, num_of_machines)
```
The code above will render the following Gantt chart in the console:
![](https://raw.githubusercontent.com/Alexander-Nasuta/jsp-vis/main/resources/example_console.png)
# Minimal Working Example: console visualisation
```python
from jsp_vis.cv2_window import render_gantt_in_window
import pandas as pd
df = pd.DataFrame([
{'Task': 'Job 0', 'Start': 5, 'Finish': 16, 'Resource': 'Machine 0'},
{'Task': 'Job 0', 'Start': 28, 'Finish': 31, 'Resource': 'Machine 1'},
{'Task': 'Job 0', 'Start': 31, 'Finish': 34, 'Resource': 'Machine 2'},
{'Task': 'Job 0', 'Start': 34, 'Finish': 46, 'Resource': 'Machine 3'},
{'Task': 'Job 1', 'Start': 0, 'Finish': 5, 'Resource': 'Machine 0'},
{'Task': 'Job 1', 'Start': 5, 'Finish': 21, 'Resource': 'Machine 2'},
{'Task': 'Job 1', 'Start': 21, 'Finish': 28, 'Resource': 'Machine 1'},
{'Task': 'Job 1', 'Start': 28, 'Finish': 32, 'Resource': 'Machine 3'}
])
num_of_machines = 4
render_gantt_in_window(
df=df,
n_machines=num_of_machines,
wait=2000 # time in ms that the `cv2`-window is open.
# wait=None # ''None'' will keep the window open till a keyboard occurs.
)
```
The code above will render the following Gantt chart in the console:
![](https://raw.githubusercontent.com/Alexander-Nasuta/jsp-vis/main/resources/example_window.png)
# More Examples
For more examples you can have a look at the test files in the `tests` directory.
Every visualisation has its own test file and is tested on two different jsp instances defined in the `conftest.py`.
# License
Distributed under the MIT License. See `LICENSE.txt` for more information.
<!-- MARKDOWN LINKS & IMAGES todo: add Github, Linked in etc.-->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[screenshot]: resources/readme_images/screenshot.png
Raw data
{
"_id": null,
"home_page": null,
"name": "jsp-vis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Alexander Nasuta",
"author_email": "Alexander Nasuta <alexander.nasuta@wzl-iqs.rwth-aachen.de>",
"download_url": "https://files.pythonhosted.org/packages/26/0f/dd1ca8c4bd37dc44342be95f94c31750444f35643377ebe5c8f5c138feb3/jsp_vis-1.1.0.tar.gz",
"platform": "unix",
"description": "\n\n<div id=\"top\"></div>\n\n<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n <!--\n <a href=\"https://cybernetics-lab.de/\">\n <img src=\"https://github.com/Alexander-Nasuta/graph-jsp-env/raw/master/resources/readme_images/logo.png\">\n </a>\n -->\n\n <h1 align=\"center\">\n Job Shop Scheduling Problem Visualisations\n </h1>\n\n\n</div>\n\n![](https://raw.githubusercontent.com/Alexander-Nasuta/jsp-vis/main/resources/ft06_console.gif)\n\n- **Github**: https://github.com/Alexander-Nasuta/jsp-vis\n\n- **PyPi**: https://pypi.org/project/jsp-vis/\n\n\n# About The Project\nThs project provides visualisation for the Job Shop Scheduling Problem (JSP).\nThis is focused on Gantt charts. The input date for the visualisation is inspired by [plotly's Gantt chart api](https://plotly.com/python/gantt/). \n`jsp-vis` is a standalone package and in designed to be used in combination with a JSP-reinforcement learning environments that follow the [Gymnasium Environment](https://gymnasium.farama.org/) standard.\nThe render function of the environment can be used to render the Gantt chart.\nTypically the render function can implement different modes like `human`, `rgb_array` or `ansi` rendering.\nThe `jsp-vis` package offers three different visualisations: console visualisation, rgb_array visualisation and window visualisation.\nThe window visualisation is essentially only rendering the rgb_array visualisation in a window using OpenCV.\nThe console visualisation might be used for the `asni` mode of a render function, the rgb_array visualisation for the `rgb_array` mode and the window visualisation for the `human` mode.\n\n# Installation\n\nInstall the package with pip:\n```\n pip install jsp-vis\n```\n\n# Minimal Working Example: console visualisation\n\n```python\nfrom jsp_vis.console import gantt_chart_console\nimport pandas as pd\n\ndf = pd.DataFrame([\n {'Task': 'Job 0', 'Start': 5, 'Finish': 16, 'Resource': 'Machine 0'},\n {'Task': 'Job 0', 'Start': 28, 'Finish': 31, 'Resource': 'Machine 1'},\n {'Task': 'Job 0', 'Start': 31, 'Finish': 34, 'Resource': 'Machine 2'},\n {'Task': 'Job 0', 'Start': 34, 'Finish': 46, 'Resource': 'Machine 3'},\n {'Task': 'Job 1', 'Start': 0, 'Finish': 5, 'Resource': 'Machine 0'},\n {'Task': 'Job 1', 'Start': 5, 'Finish': 21, 'Resource': 'Machine 2'},\n {'Task': 'Job 1', 'Start': 21, 'Finish': 28, 'Resource': 'Machine 1'},\n {'Task': 'Job 1', 'Start': 28, 'Finish': 32, 'Resource': 'Machine 3'}\n])\nnum_of_machines = 4\n\ngantt_chart_console(df, num_of_machines)\n```\nThe code above will render the following Gantt chart in the console:\n\n![](https://raw.githubusercontent.com/Alexander-Nasuta/jsp-vis/main/resources/example_console.png)\n\n# Minimal Working Example: console visualisation\n\n```python\nfrom jsp_vis.cv2_window import render_gantt_in_window\nimport pandas as pd\n\ndf = pd.DataFrame([\n {'Task': 'Job 0', 'Start': 5, 'Finish': 16, 'Resource': 'Machine 0'},\n {'Task': 'Job 0', 'Start': 28, 'Finish': 31, 'Resource': 'Machine 1'},\n {'Task': 'Job 0', 'Start': 31, 'Finish': 34, 'Resource': 'Machine 2'},\n {'Task': 'Job 0', 'Start': 34, 'Finish': 46, 'Resource': 'Machine 3'},\n {'Task': 'Job 1', 'Start': 0, 'Finish': 5, 'Resource': 'Machine 0'},\n {'Task': 'Job 1', 'Start': 5, 'Finish': 21, 'Resource': 'Machine 2'},\n {'Task': 'Job 1', 'Start': 21, 'Finish': 28, 'Resource': 'Machine 1'},\n {'Task': 'Job 1', 'Start': 28, 'Finish': 32, 'Resource': 'Machine 3'}\n])\nnum_of_machines = 4\n\nrender_gantt_in_window(\n df=df,\n n_machines=num_of_machines,\n wait=2000 # time in ms that the `cv2`-window is open.\n # wait=None # ''None'' will keep the window open till a keyboard occurs.\n )\n```\n\nThe code above will render the following Gantt chart in the console:\n\n![](https://raw.githubusercontent.com/Alexander-Nasuta/jsp-vis/main/resources/example_window.png)\n\n\n# More Examples\nFor more examples you can have a look at the test files in the `tests` directory.\nEvery visualisation has its own test file and is tested on two different jsp instances defined in the `conftest.py`.\n\n# License\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n<!-- MARKDOWN LINKS & IMAGES todo: add Github, Linked in etc.-->\n<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->\n[screenshot]: resources/readme_images/screenshot.png\n\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Alexander Nasuta Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "A visualization tool for job shop scheduling problems.",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/Alexander-Nasuta/jsp-vis"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e57358d1635d3050c5f5b383d3abcd16642ff32c67a1c711d34cb07287c7ec57",
"md5": "a42f8cdcca67cbf6cf5b30c467406689",
"sha256": "003c64d7f42c45bc12edd1fc29314114eebfb2d0407d1f5cf9315eddbf3b3120"
},
"downloads": -1,
"filename": "jsp_vis-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a42f8cdcca67cbf6cf5b30c467406689",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 9063,
"upload_time": "2024-07-10T13:47:59",
"upload_time_iso_8601": "2024-07-10T13:47:59.245567Z",
"url": "https://files.pythonhosted.org/packages/e5/73/58d1635d3050c5f5b383d3abcd16642ff32c67a1c711d34cb07287c7ec57/jsp_vis-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "260fdd1ca8c4bd37dc44342be95f94c31750444f35643377ebe5c8f5c138feb3",
"md5": "a3a729242b250ae3b01eb8a482ca4663",
"sha256": "d63821a4b14d41f89b116d05272d8d255054c5930cf1bdd901ce554c9737fabe"
},
"downloads": -1,
"filename": "jsp_vis-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "a3a729242b250ae3b01eb8a482ca4663",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 10661,
"upload_time": "2024-07-10T13:48:04",
"upload_time_iso_8601": "2024-07-10T13:48:04.576338Z",
"url": "https://files.pythonhosted.org/packages/26/0f/dd1ca8c4bd37dc44342be95f94c31750444f35643377ebe5c8f5c138feb3/jsp_vis-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-10 13:48:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Alexander-Nasuta",
"github_project": "jsp-vis",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "contourpy",
"specs": [
[
"==",
"1.2.1"
]
]
},
{
"name": "cycler",
"specs": [
[
"==",
"0.12.1"
]
]
},
{
"name": "fonttools",
"specs": [
[
"==",
"4.51.0"
]
]
},
{
"name": "kaleido",
"specs": [
[
"==",
"0.2.1"
]
]
},
{
"name": "kiwisolver",
"specs": [
[
"==",
"1.4.5"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.8.4"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"1.26.4"
]
]
},
{
"name": "opencv-python",
"specs": [
[
"==",
"4.9.0.80"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.0"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"10.3.0"
]
]
},
{
"name": "plotly",
"specs": [
[
"==",
"5.20.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
"==",
"3.1.2"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "tenacity",
"specs": [
[
"==",
"8.2.3"
]
]
},
{
"name": "tzdata",
"specs": [
[
"==",
"2024.1"
]
]
}
],
"tox": true,
"lcname": "jsp-vis"
}