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

0.5.0 #83

Merged
merged 4 commits into from
Dec 21, 2024
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
9 changes: 6 additions & 3 deletions .github/workflows/doc.yml → .github/workflows/doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Documentation and doctests

on:
workflow_dispatch:
pull_request:
branches: [ master ]

Expand All @@ -13,8 +14,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
minizinc-version: ["2.7.6", "2.6.0"]
# use 3.12 until pytest-sphinx doesn't work with 3.13
# https://github.com/twmr/pytest-sphinx/issues/67
python-version: ["3.8", "3.12"]
minizinc-version: ["2.8.7", "2.6.0"]

env:
MINIZINC_URL: https://github.com/MiniZinc/MiniZincIDE/releases/download/${{ matrix.minizinc-version }}/MiniZincIDE-${{ matrix.minizinc-version }}-x86_64.AppImage
Expand Down Expand Up @@ -58,4 +61,4 @@ jobs:
pip install nox
- name: Doc tests
run: |
nox -s doc --reuse-existing-virtualenvs
nox -s doctest --reuse-existing-virtualenvs
5 changes: 3 additions & 2 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: On release

on:
workflow_dispatch:
pull_request:
branches: [ release ]

Expand All @@ -13,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
minizinc-version: ["2.7.6", "2.6.0"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
minizinc-version: ["2.8.7", "2.6.0"]

env:
MINIZINC_URL: https://github.com/MiniZinc/MiniZincIDE/releases/download/${{ matrix.minizinc-version }}/MiniZincIDE-${{ matrix.minizinc-version }}-x86_64.AppImage
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: On release

on:
workflow_dispatch:
push:
branches: [ release ]

Expand All @@ -13,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
minizinc-version: ["2.7.6", "2.6.0"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
minizinc-version: ["2.8.7", "2.6.0"]

env:
MINIZINC_URL: https://github.com/MiniZinc/MiniZincIDE/releases/download/${{ matrix.minizinc-version }}/MiniZincIDE-${{ matrix.minizinc-version }}-x86_64.AppImage
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Unit tests

on:
workflow_dispatch:
pull_request:
branches: [ master ]

Expand All @@ -13,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
minizinc-version: ["2.7.6", "2.6.0"]
python-version: ["3.8", "3.13"]
minizinc-version: ["2.8.7", "2.6.0"]

env:
MINIZINC_URL: https://github.com/MiniZinc/MiniZincIDE/releases/download/${{ matrix.minizinc-version }}/MiniZincIDE-${{ matrix.minizinc-version }}-x86_64.AppImage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/source/api

# PyBuilder
target/
Expand Down
102 changes: 93 additions & 9 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,206 @@
## 0.5.0

#### Python interpreters support

- Add 3.13 CPython.

#### Added

- Introduce the ``strict`` argument to the ``disjunctive`` constraint.
- Add ``abs``, ``exp``, ``ln``, ``log``, ``log10``, ``log2``, and ``sqrt`` functions.
- Add ``product`` function to calculate product of all elements in the array.
- Add trigonometric functions: `acos`, `asin`, `atan`, `cos`, `sin`, `tan`.

#### Changed

- Array indexing must now specify all indices.

#### CI changes:

- Use minizinc 2.8.7 instead of 2.8.2

### 0.4.3

#### Added

- `disjunctive` constraint

#### Fixed

- array slices with upper slice as operations should compile correctly now

#### Documentation
- simplify and fix layout of ``count``, ``cumulative``

- simplify and fix layout of ``count``, ``cumulative``
``table`` and ``max`` examples

### 0.4.2

#### CI changes

- use minizinc 2.7.6 as maximum version in CI (as in minizinc-python)
- use minizinc 2.6.0 as minimum version in CI (as in minizinc-python)

#### Python interpreters support

- add 3.12 CPython

### 0.4.1

#### Added

- ``table`` constraint
- ``contains`` method for arrays and sets, to check if elem presented
in collection
- ``except_`` argument to ``all_different`` constraint

## 0.4.0

#### Added

- ``cumulative`` constraint
- ``forall`` constraint now supports enums which is not model's field

#### CI changes

- use minizinc 2.7.2 as maximum version in CI
- use minizinc 2.5.4 as minimum version in CI (as in minizinc-python)

### 0.3.1

#### Added

- var can be parametrized (you can assign values to them)

#### Fixed

- int fallback as a result of operation where both operands are float

#### CI changes

- use ruff for style checks

## 0.3

#### Syntax and compatibility

- some arguments are made positional only

#### Fixes

- fix enum doc example
- some minor fixes for internal code

#### Python interpreters support

- add 3.11 CPython
- drop 3.7 CPython
- drop pypy

### 0.2.4

#### Added

- available_solver_tags function to get available solvers
- optimization_level, n_processes, timeout and random_seed arg to solve

#### Fixed

- solve_maximize now correctly use solver arg

#### Changed

- add some type hints

### 0.2.3

#### Added

- validation for float ranges in some constraints, e.g. forall

#### Fixed

- ranges with float values correctly set bigger limit

#### Deleted
- check for minizinc executable is available,
as it seems, python-minizinc implement it by itself.

- check for minizinc executable is available,
as it seems, python-minizinc implement it by itself.

### 0.2.2

#### Added

- sets support enums

### 0.2.1

#### Added

- integer sets

#### Changed

- refactor some code

## 0.2

#### Changed
- zython doesn't redefine builtin range function,

- zython doesn't redefine builtin range function,
use ``zn.range`` for float, zython's var/par types.

#### Python interpreters support

- drop 3.6 CPython
- add 3.10 CPython

### 0.1.5

#### Added

- possibility to choose solver
- float fields support
- float ranges support

### 0.1.4

#### Changed

- an error about minizinc wasn't found in $PATH was changed to warning

### 0.1.3

#### Added

- check for minizinc in $PATH for startup
- documentation page about model parts

#### CI Changes
- Use minizinc 2.5.5 in CI.

- Use minizinc 2.5.5 in CI.

### 0.1.2

#### Fixed

- some method of Operation and Constraint classes which were
accessible by and visible for user are now hidden

#### Added

- ``increasing`` and ``decreasing`` constraints


### 0.1.1

#### Added

- ``allequal`` constraint
- ``ndistinct`` function
- ``except_0`` argument to ``alldifferent`` constraint

#### Changed:
#### Changed

- project description in readme.md
- link to the html doc

Expand Down
12 changes: 0 additions & 12 deletions doc/readme.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/guides/array_advanced/sudoku.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Python Model
def __init__(self):
self.a = zn.Array(zn.var(range(1, 10)), shape=(9, 9))

self.constraints = [zn.forall(range(9), lambda i: zn.alldifferent(self.a[i])),
self.constraints = [zn.forall(range(9), lambda i: zn.alldifferent(self.a[i, :])),
zn.forall(range(9), lambda i: zn.alldifferent(self.a[:, i])),
zn.forall(range(3),
lambda i: zn.forall(range(3),
Expand Down
Loading
Loading