iita-python 1.4.1__tar.gz → 1.4.3__tar.gz

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.
Files changed (22) hide show
  1. {iita_python-1.4.1 → iita_python-1.4.3}/.gitignore +2 -1
  2. {iita_python-1.4.1/iita_python.egg-info → iita_python-1.4.3}/PKG-INFO +1 -1
  3. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/_version.py +3 -3
  4. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/quasiorder.py +16 -4
  5. {iita_python-1.4.1 → iita_python-1.4.3/iita_python.egg-info}/PKG-INFO +1 -1
  6. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python.egg-info/SOURCES.txt +2 -0
  7. iita_python-1.4.3/iita_python.egg-info/scm_file_list.json +16 -0
  8. iita_python-1.4.3/iita_python.egg-info/scm_version.json +8 -0
  9. {iita_python-1.4.1 → iita_python-1.4.3}/.github/workflows/release.yaml +0 -0
  10. {iita_python-1.4.1 → iita_python-1.4.3}/README.md +0 -0
  11. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/__init__.py +0 -0
  12. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/additional_ce.py +0 -0
  13. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/dataset.py +0 -0
  14. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/fit_metrics.py +0 -0
  15. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python/utils.py +0 -0
  16. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python.egg-info/dependency_links.txt +0 -0
  17. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python.egg-info/requires.txt +0 -0
  18. {iita_python-1.4.1 → iita_python-1.4.3}/iita_python.egg-info/top_level.txt +0 -0
  19. {iita_python-1.4.1 → iita_python-1.4.3}/pyproject.toml +0 -0
  20. {iita_python-1.4.1 → iita_python-1.4.3}/setuf.cfg +0 -0
  21. {iita_python-1.4.1 → iita_python-1.4.3}/setup.cfg +0 -0
  22. {iita_python-1.4.1 → iita_python-1.4.3}/setup.py +0 -0
@@ -3,4 +3,5 @@ test_data
3
3
  test.py
4
4
  build
5
5
  dist
6
- *.egg-info
6
+ *.egg-info
7
+ .vscode
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iita_python
3
- Version: 1.4.1
3
+ Version: 1.4.3
4
4
  Summary: IITA algorithm in python
5
5
  Author-email: Aliaksei Badnarchuk <alexejbodnarchuk@gmail.com>
6
6
  Requires-Python: >=3.9
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.4.1'
22
- __version_tuple__ = version_tuple = (1, 4, 1)
21
+ __version__ = version = '1.4.3'
22
+ __version_tuple__ = version_tuple = (1, 4, 3)
23
23
 
24
- __commit_id__ = commit_id = 'gbd4c17f18'
24
+ __commit_id__ = commit_id = 'ga518a2db6'
@@ -3,8 +3,12 @@ import numpy.typing as npt
3
3
  import pandas as pd
4
4
 
5
5
  class QuasiOrder:
6
- def __init__(self, matrix: npt.NDArray):
6
+ knowledge_space = None
7
+ full_matrix: np.ndarray
8
+
9
+ def __init__(self, matrix: np.ndarray, knowledge_space: np.ndarray|None = None):
7
10
  self.full_matrix = matrix
11
+ self.knowledge_space = knowledge_space if knowledge_space is not None else self.get_knowledge_space()
8
12
 
9
13
  def get_edge_list(self, buff=0):
10
14
  """
@@ -22,13 +26,16 @@ class QuasiOrder:
22
26
 
23
27
  return edge_list
24
28
 
25
- def get_knowledge_space(self):
29
+ def get_knowledge_space(self, override: bool = False) -> npt.NDArray[np.int_]:
26
30
  """
27
31
  Returns the knowledge space described by the quasiorder as a numpy matrix\n
28
32
  In the output matrix, the rows represent the elements of the knowledge space,
29
33
  and the columns represent the items. An entry is 1 if the item is in the knowledge state, and 0 otherwise.
30
34
  """
31
35
 
36
+ if (self.knowledge_space is not None and not override):
37
+ return self.knowledge_space
38
+
32
39
  n = self.full_matrix.shape[0]
33
40
 
34
41
  bits = 1 << np.arange(n, dtype=object)
@@ -50,9 +57,13 @@ class QuasiOrder:
50
57
 
51
58
  masks = np.array(sorted(knowledge_space_set), dtype=object)
52
59
  knowledge_space_matrix = ((masks[:, None] & bits) != 0).astype(np.int_)
60
+
61
+ if (self.knowledge_space is None or override):
62
+ self.knowledge_space = knowledge_space_matrix
63
+
53
64
  return knowledge_space_matrix
54
65
 
55
- def ind_gen(counterexamples: pd.DataFrame, n: int) -> list[QuasiOrder]:
66
+ def ind_gen(counterexamples: pd.DataFrame) -> list[QuasiOrder]:
56
67
  """
57
68
  Inductively generates quasiorders from counterexample count DataFrame\n
58
69
  """
@@ -83,6 +94,7 @@ def ind_gen(counterexamples: pd.DataFrame, n: int) -> list[QuasiOrder]:
83
94
  queue = np.concat([group, long_queue], axis=0)
84
95
  queue = np.array(sorted(queue.tolist()), dtype=np.int_)
85
96
  allow = np.ones((len(queue)))
97
+ long_queue = np.empty((0, 2), dtype=np.int_)
86
98
 
87
99
  for a, b in queue:
88
100
  new_qo[a][b] = 1
@@ -99,7 +111,7 @@ def ind_gen(counterexamples: pd.DataFrame, n: int) -> list[QuasiOrder]:
99
111
 
100
112
  if (allow.sum() == len(allow)): break
101
113
 
102
- long_queue = queue[np.logical_not(allow)].copy()
114
+ long_queue = np.concat((long_queue, queue[np.logical_not(allow)].copy()), axis=0)
103
115
  queue = queue[allow.astype(np.bool)].copy()
104
116
  allow = allow[allow.astype(np.bool)].copy()
105
117
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iita_python
3
- Version: 1.4.1
3
+ Version: 1.4.3
4
4
  Summary: IITA algorithm in python
5
5
  Author-email: Aliaksei Badnarchuk <alexejbodnarchuk@gmail.com>
6
6
  Requires-Python: >=3.9
@@ -15,4 +15,6 @@ iita_python.egg-info/PKG-INFO
15
15
  iita_python.egg-info/SOURCES.txt
16
16
  iita_python.egg-info/dependency_links.txt
17
17
  iita_python.egg-info/requires.txt
18
+ iita_python.egg-info/scm_file_list.json
19
+ iita_python.egg-info/scm_version.json
18
20
  iita_python.egg-info/top_level.txt
@@ -0,0 +1,16 @@
1
+ {
2
+ "files": [
3
+ "setup.py",
4
+ "pyproject.toml",
5
+ "setuf.cfg",
6
+ "README.md",
7
+ ".gitignore",
8
+ ".github/workflows/release.yaml",
9
+ "iita_python/additional_ce.py",
10
+ "iita_python/dataset.py",
11
+ "iita_python/__init__.py",
12
+ "iita_python/quasiorder.py",
13
+ "iita_python/fit_metrics.py",
14
+ "iita_python/utils.py"
15
+ ]
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.4.3",
3
+ "distance": 0,
4
+ "node": "ga518a2db6bdbd215b3d1352398055be33865e318",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-08-05"
8
+ }
File without changes
File without changes
File without changes
File without changes
File without changes