dwave-preprocessing 0.6.10__tar.gz → 0.6.11__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.
- {dwave-preprocessing-0.6.10/dwave_preprocessing.egg-info → dwave_preprocessing-0.6.11}/PKG-INFO +10 -8
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/__init__.py +1 -1
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/cyfix_variables.cpp +16 -16
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/cypresolve.cpp +7 -7
- dwave_preprocessing-0.6.11/dwave/preprocessing/presolve/cypresolve.pyi +50 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11/dwave_preprocessing.egg-info}/PKG-INFO +10 -8
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave_preprocessing.egg-info/SOURCES.txt +10 -1
- dwave_preprocessing-0.6.11/dwave_preprocessing.egg-info/requires.txt +2 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/pyproject.toml +1 -1
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/setup.cfg +2 -2
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/setup.py +2 -2
- dwave_preprocessing-0.6.11/tests/test_clip.py +104 -0
- dwave_preprocessing-0.6.11/tests/test_composites_common.py +68 -0
- dwave_preprocessing-0.6.11/tests/test_connected_components.py +83 -0
- dwave_preprocessing-0.6.11/tests/test_fix_variables.py +100 -0
- dwave_preprocessing-0.6.11/tests/test_presolve.py +632 -0
- dwave_preprocessing-0.6.11/tests/test_roof_duality.py +56 -0
- dwave_preprocessing-0.6.11/tests/test_scale.py +119 -0
- dwave_preprocessing-0.6.11/tests/test_spin_reversal_transform.py +273 -0
- dwave-preprocessing-0.6.10/dwave_preprocessing.egg-info/requires.txt +0 -2
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/LICENSE +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/MANIFEST.in +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/README.rst +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/composites/__init__.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/composites/clip.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/composites/connected_components.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/composites/fix_variables.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/composites/scale.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/composites/spin_reversal_transform.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/cyfix_variables.pyx +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave/exceptions.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave/flags.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave/presolve.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/fix_variables.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/helper_data_structures.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/helper_graph_algorithms.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/implication_network.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/mapping_policy.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/posiform_info.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/include/dwave-preprocessing/push_relabel.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/libcpp.pxd +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/lower_bounds.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/__init__.pxd +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/__init__.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/cypresolve.pxd +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/cypresolve.pyx +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/exceptions.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/presolve/pypresolve.py +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/src/exceptions.cpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/src/presolve.cpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/src/presolveimpl.hpp +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave_preprocessing.egg-info/dependency_links.txt +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave_preprocessing.egg-info/not-zip-safe +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave_preprocessing.egg-info/top_level.txt +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/LICENSE +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/async.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/async_logger-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/async_logger.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/cfg/argv.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/cfg/env.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/cfg/helpers-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/cfg/helpers.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/common-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/common.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/backtracer-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/backtracer.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/circular_q.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/console_globals.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/file_helper-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/file_helper.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/fmt_helper.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/log_msg-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/log_msg.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/log_msg_buffer-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/log_msg_buffer.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/mpmc_blocking_q.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/null_mutex.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/os-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/os.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/periodic_worker-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/periodic_worker.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/registry-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/registry.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/synchronous_factory.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/tcp_client-windows.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/tcp_client.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/thread_pool-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/thread_pool.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/udp_client-windows.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/udp_client.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/details/windows_include.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bin_to_hex.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/args.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/chrono.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/color.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/compile.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/core.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/fmt.license.rst +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/format-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/format.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/locale.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/os.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/ostream.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/printf.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/ranges.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/bundled/xchar.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/chrono.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/compile.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/fmt.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/ostr.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/ranges.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fmt/xchar.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/formatter.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/fwd.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/logger-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/logger.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/pattern_formatter-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/pattern_formatter.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/android_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/ansicolor_sink-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/ansicolor_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/base_sink-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/base_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/basic_file_sink-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/basic_file_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/daily_file_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/dist_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/dup_filter_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/hourly_file_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/mongo_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/msvc_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/null_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/ostream_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/qt_sinks.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/ringbuffer_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/rotating_file_sink-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/rotating_file_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/sink-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/stdout_color_sinks-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/stdout_color_sinks.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/stdout_sinks-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/stdout_sinks.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/syslog_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/systemd_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/tcp_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/udp_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/win_eventlog_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/wincolor_sink-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/sinks/wincolor_sink.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/spdlog-inl.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/spdlog.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/stopwatch.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/tweakme.h +0 -0
- {dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/extern/spdlog/include/spdlog/version.h +0 -0
{dwave-preprocessing-0.6.10/dwave_preprocessing.egg-info → dwave_preprocessing-0.6.11}/PKG-INFO
RENAMED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dwave-preprocessing
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.11
|
|
4
4
|
Summary: An API for preprocessing tools
|
|
5
5
|
Home-page: https://github.com/dwavesystems/dwave-preprocessing
|
|
6
|
+
Download-URL: https://github.com/dwavesystems/dwave-preprocessing/releases
|
|
6
7
|
Author: D-Wave Systems Inc.
|
|
7
8
|
Author-email: tools@dwavesys.com
|
|
8
9
|
License: Apache 2.0
|
|
9
|
-
Download-URL: https://github.com/dwavesystems/dwave-preprocessing/releases
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
11
|
Classifier: Operating System :: Microsoft :: Windows
|
|
13
12
|
Classifier: Operating System :: POSIX
|
|
@@ -15,14 +14,19 @@ Classifier: Operating System :: Unix
|
|
|
15
14
|
Classifier: Operating System :: MacOS
|
|
16
15
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
-
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Requires-Python: >=3.10
|
|
24
23
|
Description-Content-Type: text/x-rst
|
|
25
24
|
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy<3.0.0,>=1.21.6
|
|
26
|
+
Requires-Dist: dimod<0.13.0,>=0.12.21
|
|
27
|
+
Dynamic: download-url
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: requires-dist
|
|
26
30
|
|
|
27
31
|
.. image:: https://circleci.com/gh/dwavesystems/dwave-preprocessing.svg?style=svg
|
|
28
32
|
:target: https://circleci.com/gh/dwavesystems/dwave-preprocessing
|
|
@@ -102,5 +106,3 @@ create a new release note file by running
|
|
|
102
106
|
You can then edit the file created under ``releasenotes/notes/``.
|
|
103
107
|
Remove any sections not relevant to your changes.
|
|
104
108
|
Commit the file along with your changes.
|
|
105
|
-
|
|
106
|
-
|
{dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave/preprocessing/cyfix_variables.cpp
RENAMED
|
@@ -1532,13 +1532,13 @@ static const char *__pyx_filename;
|
|
|
1532
1532
|
static const char *__pyx_f[] = {
|
|
1533
1533
|
"dwave/preprocessing/cyfix_variables.pyx",
|
|
1534
1534
|
"<stringsource>",
|
|
1535
|
-
"env/lib/python3.
|
|
1536
|
-
"env/lib/python3.
|
|
1537
|
-
"env/lib/python3.
|
|
1538
|
-
"env/lib/python3.
|
|
1539
|
-
"env/lib/python3.
|
|
1540
|
-
"env/lib/python3.
|
|
1541
|
-
"env/lib/python3.
|
|
1535
|
+
"env/lib/python3.12/site-packages/dimod/cyvariables.pxd",
|
|
1536
|
+
"env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi",
|
|
1537
|
+
"env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_float32.pxd",
|
|
1538
|
+
"env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_template.pxd.pxi",
|
|
1539
|
+
"env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_float32.pxd",
|
|
1540
|
+
"env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_float64.pxd",
|
|
1541
|
+
"env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_float64.pxd",
|
|
1542
1542
|
};
|
|
1543
1543
|
/* #### Code section: utility_code_proto_before_types ### */
|
|
1544
1544
|
/* ForceInitThreads.proto */
|
|
@@ -1797,7 +1797,7 @@ struct __pyx_opt_args_5dimod_11cyvariables_11cyVariables_index {
|
|
|
1797
1797
|
};
|
|
1798
1798
|
struct __pyx_opt_args_5dimod_6binary_5cybqm_13cybqm_float32_14cyBQM_template__index;
|
|
1799
1799
|
|
|
1800
|
-
/* "env/lib/python3.
|
|
1800
|
+
/* "env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_template.pxd.pxi":28
|
|
1801
1801
|
* # likes to use
|
|
1802
1802
|
*
|
|
1803
1803
|
* cdef Py_ssize_t _index(self, object, bint permissive=*) except -1 # <<<<<<<<<<<<<<
|
|
@@ -1830,7 +1830,7 @@ struct __pyx_obj_5dimod_11cyvariables_cyVariables {
|
|
|
1830
1830
|
};
|
|
1831
1831
|
|
|
1832
1832
|
|
|
1833
|
-
/* "env/lib/python3.
|
|
1833
|
+
/* "env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi":22
|
|
1834
1834
|
*
|
|
1835
1835
|
*
|
|
1836
1836
|
* cdef class cyQMBase_template: # <<<<<<<<<<<<<<
|
|
@@ -1858,7 +1858,7 @@ struct __pyx_obj_5dimod_8cyqmbase_16cyqmbase_float32_cyQMBase_float32 {
|
|
|
1858
1858
|
};
|
|
1859
1859
|
|
|
1860
1860
|
|
|
1861
|
-
/* "env/lib/python3.
|
|
1861
|
+
/* "env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_template.pxd.pxi":21
|
|
1862
1862
|
*
|
|
1863
1863
|
*
|
|
1864
1864
|
* cdef class cyBQM_template(cyQMBase): # <<<<<<<<<<<<<<
|
|
@@ -1882,7 +1882,7 @@ struct __pyx_obj_5dimod_6binary_5cybqm_13cybqm_float32_cyBQM_float32 {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
|
|
1884
1884
|
|
|
1885
|
-
/* "env/lib/python3.
|
|
1885
|
+
/* "env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi":22
|
|
1886
1886
|
*
|
|
1887
1887
|
*
|
|
1888
1888
|
* cdef class cyQMBase_template: # <<<<<<<<<<<<<<
|
|
@@ -1910,7 +1910,7 @@ struct __pyx_obj_5dimod_8cyqmbase_16cyqmbase_float64_cyQMBase_float64 {
|
|
|
1910
1910
|
};
|
|
1911
1911
|
|
|
1912
1912
|
|
|
1913
|
-
/* "env/lib/python3.
|
|
1913
|
+
/* "env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_template.pxd.pxi":21
|
|
1914
1914
|
*
|
|
1915
1915
|
*
|
|
1916
1916
|
* cdef class cyBQM_template(cyQMBase): # <<<<<<<<<<<<<<
|
|
@@ -2064,7 +2064,7 @@ struct __pyx_vtabstruct_5dimod_11cyvariables_cyVariables {
|
|
|
2064
2064
|
static struct __pyx_vtabstruct_5dimod_11cyvariables_cyVariables *__pyx_vtabptr_5dimod_11cyvariables_cyVariables;
|
|
2065
2065
|
|
|
2066
2066
|
|
|
2067
|
-
/* "env/lib/python3.
|
|
2067
|
+
/* "env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi":22
|
|
2068
2068
|
*
|
|
2069
2069
|
*
|
|
2070
2070
|
* cdef class cyQMBase_template: # <<<<<<<<<<<<<<
|
|
@@ -2093,7 +2093,7 @@ struct __pyx_vtabstruct_5dimod_8cyqmbase_16cyqmbase_float32_cyQMBase_float32 {
|
|
|
2093
2093
|
static struct __pyx_vtabstruct_5dimod_8cyqmbase_16cyqmbase_float32_cyQMBase_float32 *__pyx_vtabptr_5dimod_8cyqmbase_16cyqmbase_float32_cyQMBase_float32;
|
|
2094
2094
|
|
|
2095
2095
|
|
|
2096
|
-
/* "env/lib/python3.
|
|
2096
|
+
/* "env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_template.pxd.pxi":21
|
|
2097
2097
|
*
|
|
2098
2098
|
*
|
|
2099
2099
|
* cdef class cyBQM_template(cyQMBase): # <<<<<<<<<<<<<<
|
|
@@ -2136,7 +2136,7 @@ struct __pyx_vtabstruct_5dimod_6binary_5cybqm_13cybqm_float32_cyBQM_float32 {
|
|
|
2136
2136
|
static struct __pyx_vtabstruct_5dimod_6binary_5cybqm_13cybqm_float32_cyBQM_float32 *__pyx_vtabptr_5dimod_6binary_5cybqm_13cybqm_float32_cyBQM_float32;
|
|
2137
2137
|
|
|
2138
2138
|
|
|
2139
|
-
/* "env/lib/python3.
|
|
2139
|
+
/* "env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi":22
|
|
2140
2140
|
*
|
|
2141
2141
|
*
|
|
2142
2142
|
* cdef class cyQMBase_template: # <<<<<<<<<<<<<<
|
|
@@ -2165,7 +2165,7 @@ struct __pyx_vtabstruct_5dimod_8cyqmbase_16cyqmbase_float64_cyQMBase_float64 {
|
|
|
2165
2165
|
static struct __pyx_vtabstruct_5dimod_8cyqmbase_16cyqmbase_float64_cyQMBase_float64 *__pyx_vtabptr_5dimod_8cyqmbase_16cyqmbase_float64_cyQMBase_float64;
|
|
2166
2166
|
|
|
2167
2167
|
|
|
2168
|
-
/* "env/lib/python3.
|
|
2168
|
+
/* "env/lib/python3.12/site-packages/dimod/binary/cybqm/cybqm_template.pxd.pxi":21
|
|
2169
2169
|
*
|
|
2170
2170
|
*
|
|
2171
2171
|
* cdef class cyBQM_template(cyQMBase): # <<<<<<<<<<<<<<
|
|
@@ -1543,11 +1543,11 @@ static const char *__pyx_filename;
|
|
|
1543
1543
|
static const char *__pyx_f[] = {
|
|
1544
1544
|
"dwave/preprocessing/presolve/cypresolve.pyx",
|
|
1545
1545
|
"<stringsource>",
|
|
1546
|
-
"env/lib/python3.
|
|
1547
|
-
"env/lib/python3.
|
|
1548
|
-
"env/lib/python3.
|
|
1549
|
-
"env/lib/python3.
|
|
1550
|
-
"env/lib/python3.
|
|
1546
|
+
"env/lib/python3.12/site-packages/dimod/cyvariables.pxd",
|
|
1547
|
+
"env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi",
|
|
1548
|
+
"env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_float64.pxd",
|
|
1549
|
+
"env/lib/python3.12/site-packages/dimod/constrained/cyexpression.pxd",
|
|
1550
|
+
"env/lib/python3.12/site-packages/dimod/constrained/cyconstrained.pxd",
|
|
1551
1551
|
};
|
|
1552
1552
|
/* #### Code section: utility_code_proto_before_types ### */
|
|
1553
1553
|
/* ForceInitThreads.proto */
|
|
@@ -1813,7 +1813,7 @@ struct __pyx_obj_5dimod_11cyvariables_cyVariables {
|
|
|
1813
1813
|
};
|
|
1814
1814
|
|
|
1815
1815
|
|
|
1816
|
-
/* "env/lib/python3.
|
|
1816
|
+
/* "env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi":22
|
|
1817
1817
|
*
|
|
1818
1818
|
*
|
|
1819
1819
|
* cdef class cyQMBase_template: # <<<<<<<<<<<<<<
|
|
@@ -2021,7 +2021,7 @@ struct __pyx_vtabstruct_5dimod_11cyvariables_cyVariables {
|
|
|
2021
2021
|
static struct __pyx_vtabstruct_5dimod_11cyvariables_cyVariables *__pyx_vtabptr_5dimod_11cyvariables_cyVariables;
|
|
2022
2022
|
|
|
2023
2023
|
|
|
2024
|
-
/* "env/lib/python3.
|
|
2024
|
+
/* "env/lib/python3.12/site-packages/dimod/cyqmbase/cyqmbase_template.pxd.pxi":22
|
|
2025
2025
|
*
|
|
2026
2026
|
*
|
|
2027
2027
|
* cdef class cyQMBase_template: # <<<<<<<<<<<<<<
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Copyright 2022 D-Wave Systems Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import enum
|
|
16
|
+
|
|
17
|
+
import dimod
|
|
18
|
+
import numpy as np
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Feasibility(enum.Enum):
|
|
22
|
+
Infeasible = 0
|
|
23
|
+
Feasible = 1
|
|
24
|
+
Unknown = 2
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class TechniqueFlags(enum.IntFlag):
|
|
28
|
+
None_ = 0
|
|
29
|
+
RemoveRedundantConstraints = 1 << 0
|
|
30
|
+
RemoveSmallBiases = 1 << 1
|
|
31
|
+
DomainPropagation = 1 << 2
|
|
32
|
+
All = 0xffffffffffffffff
|
|
33
|
+
Default = All
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class cyPresolver:
|
|
37
|
+
variables: dimod.variables.Variables
|
|
38
|
+
|
|
39
|
+
def __init__(self, cqm: dimod.ConstrainedQuadraticModel, move: bool = ...): ...
|
|
40
|
+
def add_techniques(self, techniques: TechniqueFlags) -> TechniqueFlags: ...
|
|
41
|
+
def apply(self) -> bool: ...
|
|
42
|
+
def clear_model(self) -> None: ...
|
|
43
|
+
def copy_model(self) -> dimod.ConstrainedQuadraticModel: ...
|
|
44
|
+
def detach_model(self) -> dimod.ConstrainedQuadraticModel: ...
|
|
45
|
+
def feasibility(self) -> Feasibility: ...
|
|
46
|
+
def normalize(self) -> bool: ...
|
|
47
|
+
def presolve(self, *, time_limit_s: float = float("inf")) -> bool: ...
|
|
48
|
+
def restore_samples(self, samples_like: dimod.typing.SamplesLike) -> np.ndarray: ...
|
|
49
|
+
def set_techniques(self, techniques: TechniqueFlags) -> TechniqueFlags: ...
|
|
50
|
+
def techniques(self) -> TechniqueFlags: ...
|
{dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11/dwave_preprocessing.egg-info}/PKG-INFO
RENAMED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dwave-preprocessing
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.11
|
|
4
4
|
Summary: An API for preprocessing tools
|
|
5
5
|
Home-page: https://github.com/dwavesystems/dwave-preprocessing
|
|
6
|
+
Download-URL: https://github.com/dwavesystems/dwave-preprocessing/releases
|
|
6
7
|
Author: D-Wave Systems Inc.
|
|
7
8
|
Author-email: tools@dwavesys.com
|
|
8
9
|
License: Apache 2.0
|
|
9
|
-
Download-URL: https://github.com/dwavesystems/dwave-preprocessing/releases
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
11
|
Classifier: Operating System :: Microsoft :: Windows
|
|
13
12
|
Classifier: Operating System :: POSIX
|
|
@@ -15,14 +14,19 @@ Classifier: Operating System :: Unix
|
|
|
15
14
|
Classifier: Operating System :: MacOS
|
|
16
15
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
-
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Requires-Python: >=3.10
|
|
24
23
|
Description-Content-Type: text/x-rst
|
|
25
24
|
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy<3.0.0,>=1.21.6
|
|
26
|
+
Requires-Dist: dimod<0.13.0,>=0.12.21
|
|
27
|
+
Dynamic: download-url
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: requires-dist
|
|
26
30
|
|
|
27
31
|
.. image:: https://circleci.com/gh/dwavesystems/dwave-preprocessing.svg?style=svg
|
|
28
32
|
:target: https://circleci.com/gh/dwavesystems/dwave-preprocessing
|
|
@@ -102,5 +106,3 @@ create a new release note file by running
|
|
|
102
106
|
You can then edit the file created under ``releasenotes/notes/``.
|
|
103
107
|
Remove any sections not relevant to your changes.
|
|
104
108
|
Commit the file along with your changes.
|
|
105
|
-
|
|
106
|
-
|
{dwave-preprocessing-0.6.10 → dwave_preprocessing-0.6.11}/dwave_preprocessing.egg-info/SOURCES.txt
RENAMED
|
@@ -29,6 +29,7 @@ dwave/preprocessing/presolve/__init__.pxd
|
|
|
29
29
|
dwave/preprocessing/presolve/__init__.py
|
|
30
30
|
dwave/preprocessing/presolve/cypresolve.cpp
|
|
31
31
|
dwave/preprocessing/presolve/cypresolve.pxd
|
|
32
|
+
dwave/preprocessing/presolve/cypresolve.pyi
|
|
32
33
|
dwave/preprocessing/presolve/cypresolve.pyx
|
|
33
34
|
dwave/preprocessing/presolve/exceptions.py
|
|
34
35
|
dwave/preprocessing/presolve/pypresolve.py
|
|
@@ -141,4 +142,12 @@ extern/spdlog/include/spdlog/sinks/tcp_sink.h
|
|
|
141
142
|
extern/spdlog/include/spdlog/sinks/udp_sink.h
|
|
142
143
|
extern/spdlog/include/spdlog/sinks/win_eventlog_sink.h
|
|
143
144
|
extern/spdlog/include/spdlog/sinks/wincolor_sink-inl.h
|
|
144
|
-
extern/spdlog/include/spdlog/sinks/wincolor_sink.h
|
|
145
|
+
extern/spdlog/include/spdlog/sinks/wincolor_sink.h
|
|
146
|
+
tests/test_clip.py
|
|
147
|
+
tests/test_composites_common.py
|
|
148
|
+
tests/test_connected_components.py
|
|
149
|
+
tests/test_fix_variables.py
|
|
150
|
+
tests/test_presolve.py
|
|
151
|
+
tests/test_roof_duality.py
|
|
152
|
+
tests/test_scale.py
|
|
153
|
+
tests/test_spin_reversal_transform.py
|
|
@@ -7,11 +7,11 @@ classifiers =
|
|
|
7
7
|
Operating System :: MacOS
|
|
8
8
|
Programming Language :: Python :: Implementation :: CPython
|
|
9
9
|
Programming Language :: Python :: 3 :: Only
|
|
10
|
-
Programming Language :: Python :: 3.9
|
|
11
10
|
Programming Language :: Python :: 3.10
|
|
12
11
|
Programming Language :: Python :: 3.11
|
|
13
12
|
Programming Language :: Python :: 3.12
|
|
14
13
|
Programming Language :: Python :: 3.13
|
|
14
|
+
Programming Language :: Python :: 3.14
|
|
15
15
|
license = Apache 2.0
|
|
16
16
|
long_description = file: README.rst
|
|
17
17
|
long_description_content_type = text/x-rst
|
|
@@ -25,7 +25,7 @@ description = An API for preprocessing tools
|
|
|
25
25
|
[options]
|
|
26
26
|
include_package_data = True
|
|
27
27
|
packages = find_namespace:
|
|
28
|
-
python_requires = >=3.
|
|
28
|
+
python_requires = >=3.10
|
|
29
29
|
zip_safe = False
|
|
30
30
|
|
|
31
31
|
[options.packages.find]
|
|
@@ -65,7 +65,7 @@ setup(
|
|
|
65
65
|
'extern/spdlog/include/',
|
|
66
66
|
],
|
|
67
67
|
install_requires=[
|
|
68
|
-
'numpy>=1.
|
|
69
|
-
'dimod>=0.12.
|
|
68
|
+
'numpy>=1.21.6,<3.0.0', # this is the oldest supported NumPy on Python 3.10
|
|
69
|
+
'dimod>=0.12.21,<0.13.0'
|
|
70
70
|
],
|
|
71
71
|
)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Copyright 2021 D-Wave Systems Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import unittest
|
|
16
|
+
|
|
17
|
+
import dimod
|
|
18
|
+
import dimod.testing as dtest
|
|
19
|
+
from dimod import BinaryQuadraticModel, ExactSolver, NullSampler
|
|
20
|
+
|
|
21
|
+
from dwave.preprocessing.composites import ClipComposite
|
|
22
|
+
|
|
23
|
+
@dtest.load_sampler_bqm_tests(ClipComposite(ExactSolver()))
|
|
24
|
+
@dtest.load_sampler_bqm_tests(ClipComposite(NullSampler()))
|
|
25
|
+
class TestClipCompositeClass(unittest.TestCase):
|
|
26
|
+
def test_instantiation_smoketest(self):
|
|
27
|
+
sampler = ClipComposite(NullSampler())
|
|
28
|
+
dtest.assert_sampler_api(sampler)
|
|
29
|
+
|
|
30
|
+
def test_no_bounds(self):
|
|
31
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
|
|
32
|
+
{(0, 1): -2.0, (0, 2): -5.0, (0, 3): -2.0,
|
|
33
|
+
(0, 4): -2.0, (1, 2): -2.0, (1, 3): -2.0, (1, 4): 4.0,
|
|
34
|
+
(2, 3): -3.0, (2, 4): -5.0, (3, 4): -4.0}, 0, dimod.SPIN)
|
|
35
|
+
sampler = ClipComposite(ExactSolver())
|
|
36
|
+
solver = ExactSolver()
|
|
37
|
+
response = sampler.sample(bqm)
|
|
38
|
+
response_exact = solver.sample(bqm)
|
|
39
|
+
self.assertEqual(response.first.sample, response_exact.first.sample)
|
|
40
|
+
self.assertAlmostEqual(response.first.energy, response_exact.first.energy)
|
|
41
|
+
|
|
42
|
+
def test_lb_only(self):
|
|
43
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
|
|
44
|
+
{(0, 1): -2.0, (0, 2): -5.0, (0, 3): -2.0,
|
|
45
|
+
(0, 4): -2.0, (1, 2): -2.0, (1, 3): -2.0, (1, 4): 4.0,
|
|
46
|
+
(2, 3): -3.0, (2, 4): -5.0, (3, 4): -4.0}, 0, dimod.SPIN)
|
|
47
|
+
sampler = ClipComposite(ExactSolver())
|
|
48
|
+
solver = ExactSolver()
|
|
49
|
+
response = sampler.sample(bqm, lower_bound=-1)
|
|
50
|
+
response_exact = solver.sample(bqm)
|
|
51
|
+
self.assertEqual(response.first.sample, response_exact.first.sample)
|
|
52
|
+
self.assertAlmostEqual(response.first.energy, response_exact.first.energy)
|
|
53
|
+
|
|
54
|
+
def test_ub_only(self):
|
|
55
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
|
|
56
|
+
{(0, 1): -2.0, (0, 2): -5.0, (0, 3): -2.0,
|
|
57
|
+
(0, 4): -2.0, (1, 2): -2.0, (1, 3): -2.0, (1, 4): 4.0,
|
|
58
|
+
(2, 3): -3.0, (2, 4): -5.0, (3, 4): -4.0}, 0, dimod.SPIN)
|
|
59
|
+
sampler = ClipComposite(ExactSolver())
|
|
60
|
+
solver = ExactSolver()
|
|
61
|
+
response = sampler.sample(bqm, upper_bound=1)
|
|
62
|
+
response_exact = solver.sample(bqm)
|
|
63
|
+
self.assertEqual(response.first.sample, response_exact.first.sample)
|
|
64
|
+
self.assertAlmostEqual(response.first.energy, response_exact.first.energy)
|
|
65
|
+
|
|
66
|
+
def test_lb_and_ub(self):
|
|
67
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
|
|
68
|
+
{(0, 1): -2.0, (0, 2): -5.0, (0, 3): -2.0,
|
|
69
|
+
(0, 4): -2.0, (1, 2): -2.0, (1, 3): -2.0, (1, 4): 4.0,
|
|
70
|
+
(2, 3): -3.0, (2, 4): -5.0, (3, 4): -4.0}, 0, dimod.SPIN)
|
|
71
|
+
sampler = ClipComposite(ExactSolver())
|
|
72
|
+
solver = ExactSolver()
|
|
73
|
+
response = sampler.sample(bqm, lower_bound=-1, upper_bound=1)
|
|
74
|
+
response_exact = solver.sample(bqm)
|
|
75
|
+
self.assertEqual(response.first.sample, response_exact.first.sample)
|
|
76
|
+
self.assertAlmostEqual(response.first.energy, response_exact.first.energy)
|
|
77
|
+
|
|
78
|
+
def test_with_labels(self):
|
|
79
|
+
bqm = BinaryQuadraticModel({'a': 0.0, 'b': 0.0, 'c': 0.0, 'd': 0.0, 'e': 0.0},
|
|
80
|
+
{('a', 'b'): -2.0, ('a', 'c'): -5.0, ('a', 'd'): -2.0,
|
|
81
|
+
('a', 'e'): -2.0, ('b', 'c'): -2.0, ('b', 'd'): -2.0, ('b', 'e'): 4.0,
|
|
82
|
+
('c', 'd'): -3.0, ('c', 'e'): -5.0, ('d', 'e'): -4.0}, 0, dimod.SPIN)
|
|
83
|
+
sampler = ClipComposite(ExactSolver())
|
|
84
|
+
solver = ExactSolver()
|
|
85
|
+
response = sampler.sample(bqm, lower_bound=-1, upper_bound=1)
|
|
86
|
+
response_exact = solver.sample(bqm)
|
|
87
|
+
self.assertEqual(response.first.sample, response_exact.first.sample)
|
|
88
|
+
self.assertAlmostEqual(response.first.energy, response_exact.first.energy)
|
|
89
|
+
|
|
90
|
+
def test_empty_bqm(self):
|
|
91
|
+
bqm = BinaryQuadraticModel({}, {}, 0.0, dimod.SPIN)
|
|
92
|
+
sampler = ClipComposite(ExactSolver())
|
|
93
|
+
sampler.sample(bqm, lower_bound=-1, upper_bound=1)
|
|
94
|
+
|
|
95
|
+
def test_info_propagation(self):
|
|
96
|
+
bqm = BinaryQuadraticModel.from_ising({}, {})
|
|
97
|
+
|
|
98
|
+
class MySampler:
|
|
99
|
+
@staticmethod
|
|
100
|
+
def sample(bqm):
|
|
101
|
+
return dimod.SampleSet.from_samples_bqm([], bqm, info=dict(a=1))
|
|
102
|
+
|
|
103
|
+
sampleset = ClipComposite(MySampler).sample(bqm)
|
|
104
|
+
self.assertEqual(sampleset.info, {'a': 1})
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Copyright 2025 D-Wave
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import unittest
|
|
16
|
+
from unittest import mock
|
|
17
|
+
|
|
18
|
+
import dimod
|
|
19
|
+
from parameterized import parameterized_class
|
|
20
|
+
|
|
21
|
+
from dwave.preprocessing.composites import (
|
|
22
|
+
ClipComposite,
|
|
23
|
+
ConnectedComponentsComposite,
|
|
24
|
+
FixVariablesComposite,
|
|
25
|
+
ScaleComposite,
|
|
26
|
+
SpinReversalTransformComposite,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@parameterized_class([
|
|
31
|
+
dict(composite_cls=ClipComposite),
|
|
32
|
+
dict(composite_cls=ConnectedComponentsComposite),
|
|
33
|
+
dict(composite_cls=FixVariablesComposite),
|
|
34
|
+
dict(composite_cls=ScaleComposite),
|
|
35
|
+
dict(composite_cls=SpinReversalTransformComposite),
|
|
36
|
+
])
|
|
37
|
+
class TestScoped(unittest.TestCase):
|
|
38
|
+
"""Test all composites defined in dwave-preprocessing are properly scoped,
|
|
39
|
+
i.e. they propagate `close()` to samplers and they implement the context
|
|
40
|
+
manager protocol.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def get_composite(self) -> tuple[dimod.Sampler, dimod.Composite]:
|
|
44
|
+
params = getattr(self, 'params', None)
|
|
45
|
+
if params is None:
|
|
46
|
+
params = {}
|
|
47
|
+
|
|
48
|
+
sampler = getattr(self, 'sampler_cls', dimod.ExactSolver)()
|
|
49
|
+
sampler.close = mock.MagicMock()
|
|
50
|
+
|
|
51
|
+
composite = self.composite_cls(sampler, **params)
|
|
52
|
+
|
|
53
|
+
return sampler, composite
|
|
54
|
+
|
|
55
|
+
def test_close_propagation(self):
|
|
56
|
+
sampler, composite = self.get_composite()
|
|
57
|
+
|
|
58
|
+
composite.close()
|
|
59
|
+
|
|
60
|
+
sampler.close.assert_called_once()
|
|
61
|
+
|
|
62
|
+
def test_context_manager(self):
|
|
63
|
+
sampler, composite = self.get_composite()
|
|
64
|
+
|
|
65
|
+
with composite:
|
|
66
|
+
...
|
|
67
|
+
|
|
68
|
+
sampler.close.assert_called_once()
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Copyright 2021 D-Wave Systems Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import unittest
|
|
16
|
+
|
|
17
|
+
import dimod.testing as dtest
|
|
18
|
+
from dimod.vartypes import Vartype
|
|
19
|
+
from dimod import BinaryQuadraticModel
|
|
20
|
+
from dimod import ExactSolver, NullSampler
|
|
21
|
+
from dimod import SampleSet
|
|
22
|
+
|
|
23
|
+
from dwave.preprocessing.composites import (ConnectedComponentsComposite,
|
|
24
|
+
FixVariablesComposite)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dtest.load_sampler_bqm_tests(ConnectedComponentsComposite(ExactSolver()))
|
|
28
|
+
@dtest.load_sampler_bqm_tests(ConnectedComponentsComposite(NullSampler()))
|
|
29
|
+
class TestConnectedComponentsComposite(unittest.TestCase):
|
|
30
|
+
def test_instantiation_smoke(self):
|
|
31
|
+
sampler = ConnectedComponentsComposite(ExactSolver())
|
|
32
|
+
|
|
33
|
+
dtest.assert_sampler_api(sampler)
|
|
34
|
+
|
|
35
|
+
def test_sample(self):
|
|
36
|
+
bqm = BinaryQuadraticModel({1: -1.3, 4: -0.5},
|
|
37
|
+
{(1, 4): -0.6},
|
|
38
|
+
0,
|
|
39
|
+
vartype=Vartype.SPIN)
|
|
40
|
+
sampler = ConnectedComponentsComposite(ExactSolver())
|
|
41
|
+
response = sampler.sample(bqm)
|
|
42
|
+
|
|
43
|
+
self.assertEqual(response.first.sample, {4: 1, 1: 1})
|
|
44
|
+
self.assertAlmostEqual(response.first.energy, -2.4)
|
|
45
|
+
|
|
46
|
+
def test_empty_bqm(self):
|
|
47
|
+
bqm = BinaryQuadraticModel({1: -1.3, 4: -0.5},
|
|
48
|
+
{(1, 4): -0.6},
|
|
49
|
+
0,
|
|
50
|
+
vartype=Vartype.SPIN)
|
|
51
|
+
|
|
52
|
+
fixed_variables = {1: -1, 4: -1}
|
|
53
|
+
sampler = FixVariablesComposite(ConnectedComponentsComposite(ExactSolver()))
|
|
54
|
+
response = sampler.sample(bqm, fixed_variables=fixed_variables)
|
|
55
|
+
self.assertIsInstance(response, SampleSet)
|
|
56
|
+
|
|
57
|
+
def test_sample_two_components(self):
|
|
58
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 4.0, 2: -4.0, 3: 0.0}, {(0, 1): -4.0, (2, 3): 4.0}, 0.0, Vartype.BINARY)
|
|
59
|
+
|
|
60
|
+
sampler = ConnectedComponentsComposite(ExactSolver())
|
|
61
|
+
response = sampler.sample(bqm)
|
|
62
|
+
self.assertIsInstance(response, SampleSet)
|
|
63
|
+
self.assertEqual(response.first.sample, {0: 0, 1: 0, 2: 1, 3: 0})
|
|
64
|
+
self.assertAlmostEqual(response.first.energy, bqm.energy({0: 0, 1: 0, 2: 1, 3: 0}))
|
|
65
|
+
|
|
66
|
+
def test_sample_three_components(self):
|
|
67
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 4.0, 2: -4.0, 3: 0.0, 4: 1.0, 5: -1.0},
|
|
68
|
+
{(0, 1): -4.0, (2, 3): 4.0, (4, 5): -2.0}, 0.0, Vartype.BINARY)
|
|
69
|
+
|
|
70
|
+
sampler = ConnectedComponentsComposite(ExactSolver())
|
|
71
|
+
response = sampler.sample(bqm)
|
|
72
|
+
self.assertIsInstance(response, SampleSet)
|
|
73
|
+
self.assertEqual(response.first.sample, {0: 0, 1: 0, 2: 1, 3: 0, 4: 1, 5: 1})
|
|
74
|
+
self.assertAlmostEqual(response.first.energy, bqm.energy({0: 0, 1: 0, 2: 1, 3: 0, 4: 1, 5: 1}))
|
|
75
|
+
|
|
76
|
+
def test_sample_passcomponents(self):
|
|
77
|
+
bqm = BinaryQuadraticModel({0: 0.0, 1: 4.0, 2: -4.0, 3: 0.0}, {(0, 1): -4.0, (2, 3): 4.0}, 0.0, Vartype.BINARY)
|
|
78
|
+
|
|
79
|
+
sampler = ConnectedComponentsComposite(ExactSolver())
|
|
80
|
+
response = sampler.sample(bqm, components=[{0, 1}, {2, 3}])
|
|
81
|
+
self.assertIsInstance(response, SampleSet)
|
|
82
|
+
self.assertEqual(response.first.sample, {0: 0, 1: 0, 2: 1, 3: 0})
|
|
83
|
+
self.assertAlmostEqual(response.first.energy, bqm.energy({0: 0, 1: 0, 2: 1, 3: 0}))
|