python-constraint2 2.8.0__cp315-cp315-win_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,268 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-constraint2
3
+ Version: 2.8.0
4
+ Summary: python-constraint is a module for efficiently solving CSPs (Constraint Solving Problems) over finite domains.
5
+ License-Expression: BSD-2-Clause
6
+ License-File: LICENSE
7
+ Keywords: CSP,constraint solving problems,problem solver,SMT,satisfiability modulo theory,SAT
8
+ Author: Floris-Jan Willemsen
9
+ Author-email: fjwillemsen97@gmail.com
10
+ Maintainer: Floris-Jan Willemsen
11
+ Maintainer-email: fjwillemsen97@gmail.com
12
+ Requires-Python: >= 3.11
13
+ Classifier: Environment :: Console
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Intended Audience :: Education
18
+ Classifier: Natural Language :: English
19
+ Classifier: Programming Language :: C
20
+ Classifier: Programming Language :: Cython
21
+ Classifier: Topic :: Scientific/Engineering
22
+ Classifier: Topic :: Software Development
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Programming Language :: Python :: 3.15
28
+ Project-URL: Changelog, https://github.com/python-constraint/python-constraint/blob/main/CHANGELOG.md
29
+ Project-URL: Documentation, http://python-constraint.github.io/python-constraint/
30
+ Project-URL: Homepage, http://python-constraint.github.io/python-constraint/
31
+ Project-URL: Issues, https://github.com/python-constraint/python-constraint/issues
32
+ Project-URL: Repository, https://github.com/python-constraint/python-constraint
33
+ Description-Content-Type: text/x-rst
34
+
35
+ |CondaDownloads| |Downloads|
36
+ |Python Versions|
37
+ |License| |Build Status| |Status| |Docs| |Code Coverage|
38
+
39
+ .. image:: https://github.com/python-constraint/python-constraint/raw/main/docs/assets/logo/N-Queens_problem_Python.svg
40
+ :align: center
41
+ :width: 50%
42
+
43
+ python-constraint
44
+ =================
45
+
46
+ | ⚠️ IMPORTANT: this software must be installed with ``pip install python-constraint2``, as the original pip release will not be updated.
47
+ | A `Conda Forge <https://anaconda.org/channels/conda-forge/packages/python-constraint2/overview>`_ / `Mamba <https://github.com/conda-forge/python-constraint2-feedstock>`_ version is also available: ``conda install python-constraint2``.
48
+ |
49
+
50
+ | For an overview of recent changes, visit the `Changelog <https://github.com/python-constraint/python-constraint/blob/main/CHANGELOG.md>`_.
51
+ | The complete documentation can be found `here <http://python-constraint.github.io/python-constraint/>`_.
52
+ |
53
+
54
+ | New: writing constraints in the new string format is preferable over functions and lambdas.
55
+ | These strings, even as compound statements, are automatically parsed to faster built-in constraints, are more concise, and do not require constraint solving familiarity by the user to be efficient.
56
+ | For example, :code:`problem.addConstraint(["50 <= x * y < 100"])` is parsed to :code:`[MinProdConstraint(50, ["x", "y"]), MaxProdConstraint(100, ["x", "y"])]`.
57
+ | Similarly, :code:`problem.addConstraint(["x / y == z"])` is parsed to :code:`[ExactProdConstraint("x", ["z", "y"])]`.
58
+ | This feature is in beta and subject to possible change, please provide feedback.
59
+
60
+ .. contents::
61
+ :local:
62
+ :depth: 1
63
+
64
+ Introduction
65
+ ------------
66
+ The :code:`python-constraint` module offers efficient solvers for `Constraint Satisfaction Problems (CSPs) <https://en.wikipedia.org/wiki/Constraint_satisfaction_problem>`_ over finite domains in an accessible Python package.
67
+ CSP is class of problems which may be represented in terms of variables (a, b, ...), domains (a in [1, 2, 3], ...), and constraints (a < b, ...).
68
+
69
+ Examples
70
+ --------
71
+
72
+ Basics
73
+ ~~~~~~
74
+
75
+ This interactive Python session demonstrates basic operations:
76
+
77
+ .. code-block:: python
78
+
79
+ >>> from constraint import *
80
+ >>> problem = Problem()
81
+ >>> problem.addVariable("a", [1,2,3])
82
+ >>> problem.addVariable("b", [4,5,6])
83
+ >>> problem.getSolutions() # doctest: +NORMALIZE_WHITESPACE
84
+ [{'a': 3, 'b': 6}, {'a': 3, 'b': 5}, {'a': 3, 'b': 4},
85
+ {'a': 2, 'b': 6}, {'a': 2, 'b': 5}, {'a': 2, 'b': 4},
86
+ {'a': 1, 'b': 6}, {'a': 1, 'b': 5}, {'a': 1, 'b': 4}]
87
+
88
+ >>> problem.addConstraint("a*2 == b") # string constraints are preferable over the black-box problem.addConstraint(lambda a, b: a*2 == b, ("a", "b"))
89
+ >>> problem.getSolutions()
90
+ [{'a': 3, 'b': 6}, {'a': 2, 'b': 4}]
91
+
92
+ >>> problem = Problem()
93
+ >>> problem.addVariables(["a", "b"], [1, 2, 3])
94
+ >>> problem.addConstraint(AllDifferentConstraint())
95
+ >>> problem.getSolutions() # doctest: +NORMALIZE_WHITESPACE
96
+ [{'a': 3, 'b': 2}, {'a': 3, 'b': 1}, {'a': 2, 'b': 3},
97
+ {'a': 2, 'b': 1}, {'a': 1, 'b': 2}, {'a': 1, 'b': 3}]
98
+
99
+ Rooks problem
100
+ ~~~~~~~~~~~~~
101
+
102
+ The following example solves the classical Eight Rooks problem:
103
+
104
+ .. code-block:: python
105
+
106
+ >>> problem = Problem()
107
+ >>> numpieces = 8
108
+ >>> cols = range(numpieces)
109
+ >>> rows = range(numpieces)
110
+ >>> problem.addVariables(cols, rows)
111
+ >>> for col1 in cols:
112
+ ... for col2 in cols:
113
+ ... if col1 < col2:
114
+ ... problem.addConstraint(lambda row1, row2: row1 != row2, (col1, col2))
115
+ >>> solutions = problem.getSolutions()
116
+ >>> solutions # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
117
+ [{0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 2, 6: 1, 7: 0},
118
+ {0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 2, 6: 0, 7: 1},
119
+ {0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 1, 6: 2, 7: 0},
120
+ {0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 1, 6: 0, 7: 2},
121
+ ...
122
+ {0: 7, 1: 5, 2: 3, 3: 6, 4: 2, 5: 1, 6: 4, 7: 0},
123
+ {0: 7, 1: 5, 2: 3, 3: 6, 4: 1, 5: 2, 6: 0, 7: 4},
124
+ {0: 7, 1: 5, 2: 3, 3: 6, 4: 1, 5: 2, 6: 4, 7: 0},
125
+ {0: 7, 1: 5, 2: 3, 3: 6, 4: 1, 5: 4, 6: 2, 7: 0},
126
+ {0: 7, 1: 5, 2: 3, 3: 6, 4: 1, 5: 4, 6: 0, 7: 2},
127
+ ...]
128
+
129
+
130
+ Magic squares
131
+ ~~~~~~~~~~~~~
132
+
133
+ This example solves a 4x4 magic square:
134
+
135
+ .. code-block:: python
136
+
137
+ >>> problem = Problem()
138
+ >>> problem.addVariables(range(0, 16), range(1, 16 + 1))
139
+ >>> problem.addConstraint(AllDifferentConstraint(), range(0, 16))
140
+ >>> problem.addConstraint(ExactSumConstraint(34), [0, 5, 10, 15])
141
+ >>> problem.addConstraint(ExactSumConstraint(34), [3, 6, 9, 12])
142
+ >>> for row in range(4):
143
+ ... problem.addConstraint(ExactSumConstraint(34), [row * 4 + i for i in range(4)])
144
+ >>> for col in range(4):
145
+ ... problem.addConstraint(ExactSumConstraint(34), [col + 4 * i for i in range(4)])
146
+ >>> solutions = problem.getSolutions() # doctest: +SKIP
147
+
148
+ Features
149
+ --------
150
+
151
+ The following solvers are available:
152
+
153
+ - :code:`OptimizedBacktrackingSolver` (default)
154
+ - :code:`BacktrackingSolver`
155
+ - :code:`RecursiveBacktrackingSolver`
156
+ - :code:`MinConflictsSolver`
157
+ - :code:`ParallelSolver`
158
+
159
+ .. role:: python(code)
160
+ :language: python
161
+
162
+ Predefined constraint types currently available (use the parsing for automatic conversion to these types):
163
+
164
+ - :code:`FunctionConstraint`
165
+ - :code:`AllDifferentConstraint`
166
+ - :code:`AllEqualConstraint`
167
+ - :code:`ExactSumConstraint`
168
+ - :code:`MinSumConstraint`
169
+ - :code:`MaxSumConstraint`
170
+ - :code:`MinProdConstraint`
171
+ - :code:`ExactProdConstraint`
172
+ - :code:`MaxProdConstraint`
173
+ - :code:`VariableExactSumConstraint`
174
+ - :code:`VariableMinSumConstraint`
175
+ - :code:`VariableMaxSumConstraint`
176
+ - :code:`VariableMinProdConstraint`
177
+ - :code:`VariableExactProdConstraint`
178
+ - :code:`VariableMaxProdConstraint`
179
+ - :code:`InSetConstraint`
180
+ - :code:`NotInSetConstraint`
181
+ - :code:`SomeInSetConstraint`
182
+ - :code:`SomeNotInSetConstraint`
183
+
184
+ API documentation
185
+ -----------------
186
+ Documentation for the module is available at: http://python-constraint.github.io/python-constraint/.
187
+ It can be built locally by running :code:`make clean html` from the `docs` folder.
188
+ For viewing RST files locally, `restview <https://pypi.org/project/restview/>`_ is recommended.
189
+
190
+ Download and install
191
+ --------------------
192
+
193
+ .. code-block:: shell
194
+
195
+ $ pip install python-constraint2
196
+
197
+ Conda / Mamba:
198
+
199
+ .. code-block:: shell
200
+
201
+ $ conda config --add channels conda-forge
202
+ $ conda config --set channel_priority strict
203
+ $ conda install python-constraint2
204
+ $ mamba install python-constraint2
205
+
206
+ Testing
207
+ -------
208
+
209
+ Run :code:`nox` (tests for all supported Python versions in own virtual environment).
210
+
211
+ To test against your local Python version: make sure you have the development dependencies installed.
212
+ Run :code:`pytest` (optionally add :code:`--no-cov` if you have the C-extensions enabled).
213
+
214
+ Contributing
215
+ ------------
216
+
217
+ Feel free to contribute by `submitting pull requests <https://github.com/python-constraint/python-constraint/pulls>`_ or `opening issues <https://github.com/python-constraint/python-constraint/issues>`_.
218
+ Please refer to the `contribution guidelines <https://github.com/python-constraint/python-constraint/contribute>`_ before doing so.
219
+
220
+ Roadmap
221
+ -------
222
+
223
+ This GitHub organization and repository is a global effort to help to maintain :code:`python-constraint`, which was written by Gustavo Niemeyer and originaly located at https://labix.org/python-constraint.
224
+ For an overview of recent changes, visit the `Changelog <https://github.com/python-constraint/python-constraint/blob/main/CHANGELOG.md>`_.
225
+
226
+ Planned development:
227
+
228
+ - Support constant modifiers on parsed (variable) constraints instead defaulting to `FunctionConstraint`, e.g. :code:`problem.addConstraint("a+2 == b")` or :code:`problem.addConstraint("x / y == 100")`
229
+ - Parse using Abstract Syntax Trees (AST) instead of the current parser to be more robust and support decomposing lambdas
230
+ - Rewrite hotspots in C / Pyx instead of pure python mode
231
+ - Improvements to make the ParallelSolver competitive (experiments reveal the freethreading mode to be promising)
232
+ - Versioned documentation
233
+
234
+ Contact
235
+ -------
236
+ - `Floris-Jan Willemsen <https://github.com/fjwillemsen>`_ <fjwillemsen97@gmail.com> (current maintainer)
237
+ - `Sébastien Celles <https://github.com/s-celles/>`_ <s.celles@gmail.com> (former maintainer)
238
+ - `Gustavo Niemeyer <https://github.com/niemeyer/>`_ <gustavo@niemeyer.net> (initial developer)
239
+
240
+ But it's probably better to `open an issue <https://github.com/python-constraint/python-constraint/issues>`_.
241
+
242
+ .. |License| image:: https://img.shields.io/pypi/l/python-constraint2
243
+ :alt: PyPI - License
244
+
245
+ .. |Build Status| image:: https://github.com/python-constraint/python-constraint/actions/workflows/build-test-python-package.yml/badge.svg
246
+ :target: https://github.com/python-constraint/python-constraint/actions/workflows/build-test-python-package.yml
247
+ :alt: Build Status
248
+
249
+ .. |Docs| image:: https://img.shields.io/github/actions/workflow/status/python-constraint/python-constraint/publish-documentation.yml?label=Docs
250
+ :target: http://python-constraint.github.io/python-constraint/
251
+ :alt: Documentation Status
252
+
253
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/python-constraint2
254
+ :alt: PyPI - Python Versions
255
+
256
+ .. |Downloads| image:: https://img.shields.io/pypi/dm/python-constraint2
257
+ :alt: PyPI - Downloads
258
+
259
+ .. |CondaDownloads| image:: https://img.shields.io/conda/d/conda-forge/python-constraint2.svg
260
+ :alt: Conda - Downloads
261
+
262
+ .. |Status| image:: https://img.shields.io/pypi/status/python-constraint2
263
+ :alt: PyPI - Status
264
+
265
+ .. |Code Coverage| image:: https://coveralls.io/repos/github/python-constraint/python-constraint/badge.svg
266
+ :target: https://coveralls.io/github/python-constraint/python-constraint
267
+ :alt: Code Coverage
268
+
@@ -0,0 +1,15 @@
1
+ constraint/__init__.py,sha256=uNFtPbuCvaG6nPmBeoNioPaBJq-pqWHJrVfYTvfdxOM,1891
2
+ constraint/constraints.c,sha256=9bWv1oJkfuJrF0TMqpuk-Wr959zC2M4Dg2tsjbQKEdk,3064140
3
+ constraint/constraints.py,sha256=HUoFrek2Esd32j55NKmPDK2SeQdT-Us2uAlSGYFCSYA,69336
4
+ constraint/domain.c,sha256=MPIJ_e5Ykl2OXdJ0aj9rYHY3zfYKasM_di7n9FvK6tY,425779
5
+ constraint/domain.py,sha256=XLzl619prCdB8vxSLAVQWQiFwEV2qRzyLqUJLqxmWrk,3031
6
+ constraint/parser.c,sha256=mpOi7BWqGwtLagQPvjLI1O9nx_JEpT8wfxh6PO78RFY,1268385
7
+ constraint/parser.py,sha256=PMi5bBtYRXJNSHNBILUsP0afkNQmkSUdYHom8dQzY3Q,23196
8
+ constraint/problem.c,sha256=9uVm55nN5HA_AJNjkeu3Xw_riLWnzsc1VCsvpuvqtak,894966
9
+ constraint/problem.py,sha256=kOdms-5A71EAqlyn0u1_KMvd-8tM3rbZ4UE5arkVGZM,13040
10
+ constraint/solvers.c,sha256=B0VOrdVSKqcZOQAz-lezCmnVq3CH2ffzFk_GIPG2PHA,1494636
11
+ constraint/solvers.py,sha256=RhLDf7HGnoeIfk9VdPAdw3urTr1q0ydhwhj-oDyE9BY,32611
12
+ python_constraint2-2.8.0.dist-info/licenses/LICENSE,sha256=-29wB_JJKS4anSogQEG0yZqx5lPZc2m8iPJhKL-p45A,1358
13
+ python_constraint2-2.8.0.dist-info/METADATA,sha256=TgS54dwbryYWTnM5RiVbOpXKCSWC6sJcJjNec02NUL4,11385
14
+ python_constraint2-2.8.0.dist-info/WHEEL,sha256=v5VFInRwV_2dGDW7vyl6CQRk195GehygpMIJ5S-GU5s,98
15
+ python_constraint2-2.8.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.5.0
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win_arm64
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2005-2014 - Gustavo Niemeyer <gustavo@niemeyer.net>
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+ 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.