jijmodeling 1.7.1__cp310-cp310-manylinux_2_28_aarch64.whl → 1.8.1__cp310-cp310-manylinux_2_28_aarch64.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.
Potentially problematic release.
This version of jijmodeling might be problematic. Click here for more details.
- jijmodeling/__init__.pyi +146 -0
- jijmodeling/_jijmodeling.cpython-310-aarch64-linux-gnu.so +0 -0
- {jijmodeling-1.7.1.dist-info → jijmodeling-1.8.1.dist-info}/METADATA +3 -1
- {jijmodeling-1.7.1.dist-info → jijmodeling-1.8.1.dist-info}/RECORD +9 -9
- {jijmodeling-1.7.1.dist-info → jijmodeling-1.8.1.dist-info}/WHEEL +1 -1
- {jijmodeling-1.7.1.dist-info → jijmodeling-1.8.1.dist-info}/licenses/LICENSE.txt +0 -0
jijmodeling/__init__.pyi
CHANGED
|
@@ -7,6 +7,7 @@ import typing
|
|
|
7
7
|
from . import experimental
|
|
8
8
|
from enum import Enum, auto
|
|
9
9
|
|
|
10
|
+
__version__: str
|
|
10
11
|
class AbsOp:
|
|
11
12
|
r"""
|
|
12
13
|
A class for representing the absolute value
|
|
@@ -1628,6 +1629,146 @@ class IntegerVar:
|
|
|
1628
1629
|
...
|
|
1629
1630
|
|
|
1630
1631
|
|
|
1632
|
+
class Interpreter:
|
|
1633
|
+
r"""
|
|
1634
|
+
Interpreter of the JijModeling AST
|
|
1635
|
+
|
|
1636
|
+
This class is responsible for
|
|
1637
|
+
|
|
1638
|
+
- Creating OMMX instance from the AST.
|
|
1639
|
+
- This means this module also has responsible to register decision variable ID for each decision variables in AST.
|
|
1640
|
+
- Manage instance data to be substituted into the `Placeholder`.
|
|
1641
|
+
|
|
1642
|
+
Examples
|
|
1643
|
+
--------
|
|
1644
|
+
|
|
1645
|
+
```python
|
|
1646
|
+
>>> import jijmodeling as jm
|
|
1647
|
+
>>> import numpy as np
|
|
1648
|
+
|
|
1649
|
+
Create a new interpreter with scalar instance data
|
|
1650
|
+
>>> interpreter = jm.Interpreter({"a": 1})
|
|
1651
|
+
|
|
1652
|
+
Insert instance data after creating the interpreter
|
|
1653
|
+
>>> interpreter.insert_instance_data("b", 2) # scalar
|
|
1654
|
+
|
|
1655
|
+
Python list and numpy array are supported
|
|
1656
|
+
>>> interpreter.insert_instance_data("c", [3, 4])
|
|
1657
|
+
>>> interpreter.insert_instance_data("d", [[1, 2], [3, 4]])
|
|
1658
|
+
>>> interpreter.insert_instance_data("e", np.array([3, 4]))
|
|
1659
|
+
|
|
1660
|
+
JaggedArray, non-uniform multi-dimensional array is also supported
|
|
1661
|
+
>>> interpreter.insert_instance_data("f", [[[1, 2]], [[3, 4, 5]], [[6]]])
|
|
1662
|
+
>>> interpreter.insert_instance_data("g", jm.JaggedArray([[[1, 2]], [[3, 4, 5]], [[6]]]))
|
|
1663
|
+
|
|
1664
|
+
You can get the instance data by using get_instance_data method
|
|
1665
|
+
>>> interpreter.get_instance_data("a")
|
|
1666
|
+
1.0
|
|
1667
|
+
|
|
1668
|
+
Array are normalized to numpy array
|
|
1669
|
+
>>> interpreter.get_instance_data("c")
|
|
1670
|
+
array([3., 4.])
|
|
1671
|
+
>>> interpreter.get_instance_data("e")
|
|
1672
|
+
array([3., 4.])
|
|
1673
|
+
>>> interpreter.get_instance_data("f") # doctest: +ELLIPSIS
|
|
1674
|
+
<jijmodeling.JaggedArray object at 0x...>
|
|
1675
|
+
|
|
1676
|
+
```
|
|
1677
|
+
"""
|
|
1678
|
+
num_decision_variables: int
|
|
1679
|
+
def __new__(cls,instance_data:dict): ...
|
|
1680
|
+
def insert_instance_data(self, key:str, value:float | numpy.typing.NDArray[numpy.float64] | JaggedArray | typing.Sequence[float] | typing.Sequence[typing.Sequence[float]] | typing.Sequence[typing.Sequence[typing.Sequence[float]]] | typing.Sequence[typing.Sequence[typing.Sequence[typing.Sequence[float]]]]) -> None:
|
|
1681
|
+
...
|
|
1682
|
+
|
|
1683
|
+
def get_instance_data(self, key:str) -> float | numpy.typing.NDArray[numpy.float64] | JaggedArray:
|
|
1684
|
+
...
|
|
1685
|
+
|
|
1686
|
+
def instance_data(self) -> dict[str, float | numpy.typing.NDArray[numpy.float64] | JaggedArray]:
|
|
1687
|
+
...
|
|
1688
|
+
|
|
1689
|
+
def __str__(self) -> str:
|
|
1690
|
+
...
|
|
1691
|
+
|
|
1692
|
+
def get_decision_variable_by_id(self, id:int) -> typing.Any:
|
|
1693
|
+
...
|
|
1694
|
+
|
|
1695
|
+
def get_decision_variable_by_name(self, name,subscript = ...) -> typing.Any:
|
|
1696
|
+
...
|
|
1697
|
+
|
|
1698
|
+
def eval_scalar(self, expr:typing.Any) -> float:
|
|
1699
|
+
...
|
|
1700
|
+
|
|
1701
|
+
def eval_expr(self, expr:typing.Any) -> typing.Any:
|
|
1702
|
+
...
|
|
1703
|
+
|
|
1704
|
+
def eval_constraints(self, constraints:Constraint) -> list[typing.Any]:
|
|
1705
|
+
...
|
|
1706
|
+
|
|
1707
|
+
def eval_problem(self, problem:Problem) -> typing.Any:
|
|
1708
|
+
...
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
class JaggedArray:
|
|
1712
|
+
r"""
|
|
1713
|
+
Jagged array, a multi-dimensional array where each element can be an array of different length.
|
|
1714
|
+
|
|
1715
|
+
Examples
|
|
1716
|
+
--------
|
|
1717
|
+
|
|
1718
|
+
```python
|
|
1719
|
+
>>> import jijmodeling as jm
|
|
1720
|
+
>>> arr = jm.JaggedArray([[[1, 2], [3, 4, 5]], [[6]]])
|
|
1721
|
+
|
|
1722
|
+
# Three dimensional
|
|
1723
|
+
>>> assert arr.dim == 3
|
|
1724
|
+
|
|
1725
|
+
# __getitem__ works
|
|
1726
|
+
>>> assert arr[0, 0, 0] == 1.0
|
|
1727
|
+
>>> assert arr[0, 0, 1] == 2.0
|
|
1728
|
+
>>> assert arr[0, 1, 0] == 3.0
|
|
1729
|
+
>>> assert arr[0, 1, 1] == 4.0
|
|
1730
|
+
>>> assert arr[0, 1, 2] == 5.0
|
|
1731
|
+
>>> assert arr[1, 0, 0] == 6.0
|
|
1732
|
+
|
|
1733
|
+
# out of range
|
|
1734
|
+
>>> arr[0, 0, 2]
|
|
1735
|
+
Traceback (most recent call last):
|
|
1736
|
+
...
|
|
1737
|
+
IndexError: Invalid index
|
|
1738
|
+
|
|
1739
|
+
# dimension mismatch
|
|
1740
|
+
>>> arr[0, 0]
|
|
1741
|
+
Traceback (most recent call last):
|
|
1742
|
+
...
|
|
1743
|
+
IndexError: Invalid index
|
|
1744
|
+
|
|
1745
|
+
>>> assert arr.size_at([]) == 2 # [[1, 2], [3, 4, 5]] and [[6]]
|
|
1746
|
+
>>> assert arr.size_at([0]) == 2 # [1, 2] and [3, 4, 5]
|
|
1747
|
+
>>> assert arr.size_at([1]) == 1 # [[6]]
|
|
1748
|
+
>>> assert arr.size_at([0, 0]) == 2 # [1, 2]
|
|
1749
|
+
>>> assert arr.size_at([0, 1]) == 3 # [3, 4, 5]
|
|
1750
|
+
>>> assert arr.size_at([1, 0]) == 1 # [6]
|
|
1751
|
+
|
|
1752
|
+
```
|
|
1753
|
+
"""
|
|
1754
|
+
dim: int
|
|
1755
|
+
def __new__(cls,obj:typing.Any): ...
|
|
1756
|
+
def __str__(self) -> str:
|
|
1757
|
+
...
|
|
1758
|
+
|
|
1759
|
+
def __eq__(self, other:typing.Any) -> bool:
|
|
1760
|
+
...
|
|
1761
|
+
|
|
1762
|
+
def get(self, index:typing.Sequence[int]) -> float:
|
|
1763
|
+
...
|
|
1764
|
+
|
|
1765
|
+
def __getitem__(self, index:typing.Sequence[int]) -> float:
|
|
1766
|
+
...
|
|
1767
|
+
|
|
1768
|
+
def size_at(self, index:typing.Sequence[int]) -> int:
|
|
1769
|
+
...
|
|
1770
|
+
|
|
1771
|
+
|
|
1631
1772
|
class LessThanEqualOp:
|
|
1632
1773
|
r"""
|
|
1633
1774
|
A class for representing the less than equal operator
|
|
@@ -2916,6 +3057,9 @@ class Problem:
|
|
|
2916
3057
|
def used_placeholders(self) -> list[Placeholder]:
|
|
2917
3058
|
...
|
|
2918
3059
|
|
|
3060
|
+
def get_problem_schema(self) -> dict:
|
|
3061
|
+
...
|
|
3062
|
+
|
|
2919
3063
|
|
|
2920
3064
|
class ProdOp:
|
|
2921
3065
|
r"""
|
|
@@ -4835,6 +4979,8 @@ def sum(index:typing.Any,operand:typing.Any) -> SumOp:
|
|
|
4835
4979
|
def to_protobuf(obj:Problem | Constraint | CustomPenaltyTerm | typing.Any | typing.Any) -> bytes:
|
|
4836
4980
|
...
|
|
4837
4981
|
|
|
4982
|
+
class InterpreterError(RuntimeError): ...
|
|
4983
|
+
|
|
4838
4984
|
class ModelingError(Exception): ...
|
|
4839
4985
|
|
|
4840
4986
|
class ProtobufDeserializationError(Exception): ...
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: jijmodeling
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.1
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Operating System :: POSIX :: Linux
|
|
6
6
|
Classifier: Operating System :: MacOS
|
|
@@ -18,9 +18,11 @@ Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
|
18
18
|
Requires-Dist: numpy
|
|
19
19
|
Requires-Dist: pandas
|
|
20
20
|
Requires-Dist: orjson >=3.8.0, <4.0.0
|
|
21
|
+
Requires-Dist: ommx >=1.3.2, <2.0.0
|
|
21
22
|
Requires-Dist: pyright ; extra == 'test'
|
|
22
23
|
Requires-Dist: pytest ; extra == 'test'
|
|
23
24
|
Requires-Dist: twine ; extra == 'test'
|
|
25
|
+
Requires-Dist: pkginfo >=1.10.0 ; extra == 'test'
|
|
24
26
|
Provides-Extra: test
|
|
25
27
|
License-File: LICENSE.txt
|
|
26
28
|
Summary: Mathematical modeling tool for optimization problem
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
jijmodeling-1.
|
|
2
|
-
jijmodeling-1.
|
|
3
|
-
jijmodeling-1.
|
|
4
|
-
jijmodeling/__init__.pyi,sha256=fgbL7lNuAR6f3iF0murcGspACejjxthd0y7PeHhx1do,129647
|
|
1
|
+
jijmodeling-1.8.1.dist-info/METADATA,sha256=kl4ZUSjTyjBzelNz4ocr5G33SFJcwzxqUIL-yYBROuw,12846
|
|
2
|
+
jijmodeling-1.8.1.dist-info/WHEEL,sha256=MOyRxqbe5dyszgkJvKd8AtTP-sjGV4P76yq8D74h3uA,109
|
|
3
|
+
jijmodeling-1.8.1.dist-info/licenses/LICENSE.txt,sha256=T5HdEbP5NWG8fZbvF9pofeteW3HrS30V3_LvtPUHFYM,3400
|
|
5
4
|
jijmodeling/experimental.py,sha256=Of-tUY3kfpFHpjGbIcclbMenCP2BMW07me895YH7tG8,575
|
|
6
|
-
jijmodeling/dataset.pyi,sha256=LSYVLeyvQRq-Xmql8zfjavbmQwFHjU5Ir_GGyeg0q2Y,4005
|
|
7
5
|
jijmodeling/__init__.py,sha256=43DV_WzDxS0n6FseNyfJZ6oQucO31T4qqbz3bx9JMtE,44
|
|
8
|
-
jijmodeling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
jijmodeling/dataset.py,sha256=S4piVIiUGJMi8MlG3kFV-8JIkzvnktAS0IdkbJ655hw,185
|
|
10
6
|
jijmodeling/experimental.pyi,sha256=PBGw5LutDarKtaP3HTzByjV_FPRrPvv4NAZ_XWUZuGA,9018
|
|
11
|
-
jijmodeling/
|
|
12
|
-
jijmodeling
|
|
7
|
+
jijmodeling/dataset.py,sha256=S4piVIiUGJMi8MlG3kFV-8JIkzvnktAS0IdkbJ655hw,185
|
|
8
|
+
jijmodeling/dataset.pyi,sha256=LSYVLeyvQRq-Xmql8zfjavbmQwFHjU5Ir_GGyeg0q2Y,4005
|
|
9
|
+
jijmodeling/__init__.pyi,sha256=5yCnaQclZ7GixEF97Ix0DkZ_QtuxOGJA_MPyla8bCg4,134045
|
|
10
|
+
jijmodeling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
jijmodeling/_jijmodeling.cpython-310-aarch64-linux-gnu.so,sha256=YH_4kg0JfwJooY2HjaiKIGc_Kyxl7z8K75PrNu69JM0,8662576
|
|
12
|
+
jijmodeling-1.8.1.dist-info/RECORD,,
|
|
File without changes
|