Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ this project adheres to `Semantic Versioning <https://semver.org/>`_.
Unreleased_
------------


Added
^^^^^

- Add the ``Instance.diverse_solutions`` method to use the MiniZinc
experimental feature to model diversity and try and find a set of diverse
solutions for the given problem.

Removed
^^^^^^^

Expand All @@ -35,6 +43,8 @@ Fixed

- Fix problem where some exceptions when creating processes where hidden and
would then cause errors where the ``proc`` variable did not exist.
- Fix issue where MiniZinc would not correctly be terminated on Windows when
the Python process was interrupted.

0.9.0_ - 2023-04-04
-------------------
Expand Down Expand Up @@ -88,7 +98,7 @@ Removed
- **BREAKING:** The project no longer contains the (uncompleted) direct library
connection to libminizinc. With this change come some simplications in methods of
relocated from ``CLIDriver`` and ``CLIInstance``, and the move of ``find_driver`` to
``Driver.find``.
``Driver.find``.

Fixed
^^^^^
Expand All @@ -107,7 +117,7 @@ Added
Fixed
^^^^^

- Do not raise error about unsupported solver flags when MiniZinc driver would
- Do not raise error about unsupported solver flags when MiniZinc driver would
not raise an error.
- Fix warnings caused by unterminated coroutines when using the asynchronous
iterators
Expand Down
8 changes: 5 additions & 3 deletions src/minizinc/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,11 @@ async def solutions(
# an unexpected Python exception occurred
# First, terminate the process
if sys.platform == "win32":
import signal

proc.send_signal(signal.CTRL_C_EVENT)
with open(
f"\\\\.\\pipe\\minizinc-{proc.pid}", mode="w"
) as named_pipe:
# Trigger MiniZinc termination
named_pipe.write("")
else:
proc.terminate()
_ = await proc.wait()
Expand Down
Loading