
[](https://github.com/Som-Energia/tomato-cooker/actions/workflows/main.yml)
[](https://coveralls.io/github/Som-Energia/tomato-cooker?branch=main)
# cooked-tomato
Timetable scheduler for phone attention turns in Som Energia
## History
This project is the result of an internal Som Energia Hackathon held on 11-03-2022 about MiniZinc
with the goal of reimplementing the previous solution based on a
[pruned backtracking](https://github.com/Som-Energia/somenergia-tomatic/blob/master/tomatic/backtracker.py).
### Prerequisites
Before you begin, ensure you have met the following requirements:
* You must have at least `python 3.8`. You can get this python version through `pyenv`. See more here -> https://github.com/pyenv/pyenv#installation
* You should have a `Linux/Mac` machine. Windows is not supported and we are not thinking in it.
### Installation
```bash
pip install cooked-tomato
```
### Usage
```python
import asyncio
from tomato_cooker.grill import GrillTomatoCooker
from tomato_cooker.models import TomaticProblem, tomatic
# define a problem
tomatic_problem_params = {
"nPersons": 4,
"nLines": 2,
"nHours": 3,
"nNingus": 1,
"nDays": 5,
"maxTorns": 2,
"nTorns": [3, 3, 3, 3,],
"indisponibilitats": [
{1}, {1}, {2}, {1}, {1},
{2}, {2}, {2}, {2}, {2},
{3}, {3}, {2}, {3}, {3},
{2}, {3}, {2}, {2}, {1},
]
}
tomatic_problem = TomaticProblem(**tomatic_problem_params)
# choose a list of minizinc solvers to user
solvers = ["chuffed", "coin-bc"]
# create an instance of the cooker
tomato_cooker = GrillTomatoCooker(tomatic.MODEL_DEFINITION_PATH, solvers)
# Now, we can solve the problem
solution = asyncio.run(tomato_cooker.cook(tomatic_problem))
print(solution)
```
### Contribute
1. Fork the repository on GitHub.
2. Set up your development setup
```bash
$> pip install -e .[dev,tests]
```
3. Run the tests to confirm they all pass on your system.
```bash
$> pytest
```
4. Make your change and run the entire test suite again and confirm that all tests pass including the ones you just added.
5. Create us a GitHub Pull Request to the main repository’s master branch. GitHub Pull Requests are the expected method of code collaboration on this project.
## Changes
[Historic of changes.][changelog]
## License
This project uses the following license: [GNU AFFERO GENERAL PUBLIC LICENSE](LICENSE).
[changelog]: CHANGELOG.md
Raw data
{
"_id": null,
"home_page": "https://github.com/Som-Energia/Som-Minizinc",
"name": "tomato-cooker",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.0",
"maintainer_email": "",
"keywords": "",
"author": "Som Energia SCCL",
"author_email": "info@somenergia.coop",
"download_url": "https://files.pythonhosted.org/packages/cc/98/d258bdfa022c8b25b021d4dd81c0164a458655ad775fbc8d0d648be43ccd/tomato-cooker-0.4.0.tar.gz",
"platform": null,
"description": "\n[](https://github.com/Som-Energia/tomato-cooker/actions/workflows/main.yml)\n[](https://coveralls.io/github/Som-Energia/tomato-cooker?branch=main)\n\n\n# cooked-tomato\n\nTimetable scheduler for phone attention turns in Som Energia\n\n## History\n\nThis project is the result of an internal Som Energia Hackathon held on 11-03-2022 about MiniZinc\nwith the goal of reimplementing the previous solution based on a \n[pruned backtracking](https://github.com/Som-Energia/somenergia-tomatic/blob/master/tomatic/backtracker.py).\n\n\n### Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n* You must have at least `python 3.8`. You can get this python version through `pyenv`. See more here -> https://github.com/pyenv/pyenv#installation\n* You should have a `Linux/Mac` machine. Windows is not supported and we are not thinking in it.\n\n### Installation\n\n```bash\npip install cooked-tomato\n```\n\n### Usage\n\n```python\nimport asyncio\nfrom tomato_cooker.grill import GrillTomatoCooker\nfrom tomato_cooker.models import TomaticProblem, tomatic\n\n# define a problem\ntomatic_problem_params = {\n \"nPersons\": 4,\n \"nLines\": 2,\n \"nHours\": 3,\n \"nNingus\": 1,\n \"nDays\": 5,\n \"maxTorns\": 2,\n \"nTorns\": [3, 3, 3, 3,],\n \"indisponibilitats\": [\n {1}, {1}, {2}, {1}, {1},\n {2}, {2}, {2}, {2}, {2},\n {3}, {3}, {2}, {3}, {3},\n {2}, {3}, {2}, {2}, {1},\n ]\n}\ntomatic_problem = TomaticProblem(**tomatic_problem_params)\n\n# choose a list of minizinc solvers to user\nsolvers = [\"chuffed\", \"coin-bc\"]\n\n# create an instance of the cooker\ntomato_cooker = GrillTomatoCooker(tomatic.MODEL_DEFINITION_PATH, solvers)\n\n# Now, we can solve the problem\nsolution = asyncio.run(tomato_cooker.cook(tomatic_problem))\nprint(solution)\n```\n\n### Contribute\n\n1. Fork the repository on GitHub.\n2. Set up your development setup\n```bash\n$> pip install -e .[dev,tests]\n```\n3. Run the tests to confirm they all pass on your system.\n```bash\n$> pytest\n```\n4. Make your change and run the entire test suite again and confirm that all tests pass including the ones you just added.\n5. Create us a GitHub Pull Request to the main repository\u2019s master branch. GitHub Pull Requests are the expected method of code collaboration on this project.\n\n## Changes\n\n[Historic of changes.][changelog]\n\n## License\n\nThis project uses the following license: [GNU AFFERO GENERAL PUBLIC LICENSE](LICENSE).\n\n[changelog]: CHANGELOG.md\n",
"bugtrack_url": null,
"license": "GNU Affero General Public License v3 or later (AGPLv3+)",
"summary": "Minizinc problem solver",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/Som-Energia/Som-Minizinc"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ac1b81e027aa52cc60a8cc101708519aee28024bf55254d680f92311ac8db23b",
"md5": "ad61c8c6835c94e5cf46750024819306",
"sha256": "89f318ecea4a035617c42ec10610a285d5fd5b10d7e620de22bb619dec78335b"
},
"downloads": -1,
"filename": "tomato_cooker-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ad61c8c6835c94e5cf46750024819306",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.0",
"size": 23913,
"upload_time": "2023-09-14T06:59:22",
"upload_time_iso_8601": "2023-09-14T06:59:22.108471Z",
"url": "https://files.pythonhosted.org/packages/ac/1b/81e027aa52cc60a8cc101708519aee28024bf55254d680f92311ac8db23b/tomato_cooker-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc98d258bdfa022c8b25b021d4dd81c0164a458655ad775fbc8d0d648be43ccd",
"md5": "be44be1087d783edb022be90f737e497",
"sha256": "e6d82170cbc577b6c4d98359ff79f52b66a9403181c3491c6a832095933b47e7"
},
"downloads": -1,
"filename": "tomato-cooker-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "be44be1087d783edb022be90f737e497",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.0",
"size": 25742,
"upload_time": "2023-09-14T06:59:23",
"upload_time_iso_8601": "2023-09-14T06:59:23.783083Z",
"url": "https://files.pythonhosted.org/packages/cc/98/d258bdfa022c8b25b021d4dd81c0164a458655ad775fbc8d0d648be43ccd/tomato-cooker-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-14 06:59:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Som-Energia",
"github_project": "Som-Minizinc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "tomato-cooker"
}