ommx-openjij-adapter 2.0.0b3__tar.gz → 2.0.0rc1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ommx_openjij_adapter
3
- Version: 2.0.0b3
3
+ Version: 2.0.0rc1
4
4
  Summary: OMMX Adapter for OpenJij.
5
5
  Author-email: "Jij Inc." <info@j-ij.com>
6
6
  Project-URL: Repository, https://github.com/Jij-Inc/ommx
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: MIT License
15
15
  Requires-Python: <3.13,>=3.9
16
16
  Description-Content-Type: text/markdown
17
17
  Requires-Dist: ommx<3.0.0,>=2.0.0b3
18
- Requires-Dist: openjij>=0.9.2
18
+ Requires-Dist: openjij<0.10.0,>=0.9.2
19
19
 
20
20
  OMMX Adapter for OpenJij
21
21
  =========================
@@ -177,23 +177,24 @@ def decode_to_samples(response: oj.Response) -> Samples:
177
177
  """
178
178
  Convert `openjij.Response <https://openjij.github.io/OpenJij/reference/openjij/index.html#openjij.Response>`_ to :class:`Samples`
179
179
  """
180
- # Filling into ommx.v1.Samples
180
+ # Create empty samples and append each state with its sample IDs
181
181
  # Since OpenJij does not issue the sample ID, we need to generate it in the responsibility of this OMMX Adapter
182
+ samples = Samples({}) # Create empty samples
182
183
  sample_id = 0
183
- entries = []
184
184
 
185
185
  num_reads = len(response.record.num_occurrences)
186
186
  for i in range(num_reads):
187
187
  sample = response.record.sample[i]
188
- state = State(entries=zip(response.variables, sample)) # type: ignore
188
+ state = State(entries=zip(response.variables, sample))
189
189
  # `num_occurrences` is encoded into sample ID list.
190
190
  # For example, if `num_occurrences` is 2, there are two samples with the same state, thus two sample IDs are generated.
191
191
  ids = []
192
192
  for _ in range(response.record.num_occurrences[i]):
193
193
  ids.append(sample_id)
194
194
  sample_id += 1
195
- entries.append(Samples.SamplesEntry(state=state, ids=ids))
196
- return Samples(entries=entries)
195
+ samples.append(ids, state)
196
+
197
+ return samples
197
198
 
198
199
 
199
200
  @deprecated("Use `OMMXOpenJijSAAdapter.sample` instead")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ommx_openjij_adapter
3
- Version: 2.0.0b3
3
+ Version: 2.0.0rc1
4
4
  Summary: OMMX Adapter for OpenJij.
5
5
  Author-email: "Jij Inc." <info@j-ij.com>
6
6
  Project-URL: Repository, https://github.com/Jij-Inc/ommx
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: MIT License
15
15
  Requires-Python: <3.13,>=3.9
16
16
  Description-Content-Type: text/markdown
17
17
  Requires-Dist: ommx<3.0.0,>=2.0.0b3
18
- Requires-Dist: openjij>=0.9.2
18
+ Requires-Dist: openjij<0.10.0,>=0.9.2
19
19
 
20
20
  OMMX Adapter for OpenJij
21
21
  =========================
@@ -0,0 +1,2 @@
1
+ ommx<3.0.0,>=2.0.0b3
2
+ openjij<0.10.0,>=0.9.2
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ommx_openjij_adapter"
7
- version = "2.0.0b3"
7
+ version = "2.0.0rc1"
8
8
 
9
9
  description = "OMMX Adapter for OpenJij."
10
10
  authors = [{ name = "Jij Inc.", email = "info@j-ij.com" }]
@@ -22,7 +22,7 @@ classifiers = [
22
22
  "License :: OSI Approved :: Apache Software License",
23
23
  "License :: OSI Approved :: MIT License",
24
24
  ]
25
- dependencies = ["ommx >= 2.0.0b3, < 3.0.0", "openjij >= 0.9.2"]
25
+ dependencies = ["ommx >= 2.0.0b3, < 3.0.0", "openjij >= 0.9.2, < 0.10.0"]
26
26
 
27
27
  [project.urls]
28
28
  Repository = "https://github.com/Jij-Inc/ommx"
@@ -1,2 +0,0 @@
1
- ommx<3.0.0,>=2.0.0b3
2
- openjij>=0.9.2