Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#94] Domino Art Mod #102

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

[#94] Domino Art Mod #102

wants to merge 2 commits into from

Conversation

venaturum
Copy link
Member

@venaturum venaturum commented Jun 22, 2023

Description

Work in progress for Domino Art mod #94
For a new Mod contribution, please include the issue number for the Mod proposal and check through the list below.

Looking for feedback on API (or whatever else may be appropriate)

Docstrings/typing mostly completed but haven't checked in Sphinx. Only 1 or 2 classes will be exposed to user.

Typical use case

from gurobi_optimods.domino import Solver, draw

#load example
solver = Solver.from_example(backend="skimage")
# backends for pillow and opencv also available

solver.set_params(width=40, max_dots=9)
# target image (resized, grayscale) shown in matplotlib installed

# user decides width=40 is too coarse
solver.set_params(width=60, max_dots=9)
# target image (resized, grayscale) shown if matplotlib installed

# user decides width=60 is too fine
solver.set_params(width=50, max_dots=9)
# target image (resized, grayscale) shown if matplotlib installed

# user decides width=50 is just right.  Eats porridge.

solution = solver.find_optimal_placements(max_domino_sets=15)

# user is told minimum domino sets needs to be 20 in order for a feasible solution to exist

solution = solver.find_optimal_placements(max_domino_sets=20)

# user draws solution with black dots on white tiles (warning shown if matplotlib not installed)
# function returns numpy array but they don't want to store it
_ = draw(style="black_dots", solution=solution)

# user decides there is a bit of noise in image, increases domino sets to 30
solution = solver.find_optimal_placements(max_domino_sets=30)

# user draws solution with white dots on black tiles
_ = draw(style="white_dots", solution=solution)

#prints some "domino stats" around solution
solution.print_stats()

Checklist

  • Implementation:
    • Implementation of the Mod in the gurobi_optimods installable package
    • Tests for the Mod implementation in tests/
    • Docstrings for public API, correctly linked using sphinx-autodoc
  • Documentation page:
    • Background and problem specification
    • Example of the input data format (use gurobi_optimods.datasets for loading data)
    • Runnable code example
    • Presentation of solutions
    • Included in the mod gallery and toctree

Have a nice day!

@CLAassistant
Copy link

CLAassistant commented Jul 9, 2023

CLA assistant check
All committers have signed the CLA.

@simonbowly simonbowly marked this pull request as draft June 14, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants