Releases: dwavesystems/dwave-cloud-client
0.14.3
0.14.2
New Features
-
Implement minimal cache control through Ocean config interface (config files, environment variables, constructor keyword arguments).
Client caching is now controlled with
cache_enabled/cache_homeconfiguration parameters andDWAVE_CACHE_ENABLED/DWAVE_CACHE_HOMEenvironment variables.Caching is disabled by default in the low-level interfaces (
ClientConfigconfiguration model,dwave.cloud.api.*models, clients and resources, e.g.api.Solvers,api.Regions, etc.), but enabled in the high-levelClientinterface.See #614.
0.14.1
New Features
- Add Python 3.14 support. See #730.
- Implement
close()method and context protocol support onAuthFlowandLeapAuthFlowclasses.
Upgrade Notes
- Upgrade your Python to 3.10+. We no longer support Python 3.9 and below. See #726.
Deprecation Notes
Solver.is_vfycproperty is deprecated since dwave-cloud-client 0.14.1 and will be removed in 0.15.0. Note that Leap QPU solvers in general don't support thevfyc(virtual full-yield chip) property anymore. See #725.
Bug Fixes
- Workaround for SAPI returning invalid v3 solver representation of problems submitted using v2 representation (with Ocean < 9). When
Client.retrieve_answer()receives a solver identity withgraph_idmissing, we fall back to a partial solver match (based on name only). See #727.
- Fix resource leaks during diskcache/sqlite database use in
CachingSessionMixin,LeapAuthFlowand@cached. See #731.
0.14.0
Prelude
Solver identification has changed with SAPI solver representation v3. Instead of a unique string id, each solver is now uniquely referenced by a more descriptive identity dictionary. Each solver still has a name, but to uniquely identify a specific working graph of a structured solver (QPU), graph_id has to be used. Hybrid (unstructured) solvers are still uniquely identified by their name.
New Features
-
Allow
solverto be specified using the new solver identity string representation.The new format is supported in a config file:
[my-experiment] solver = Advantage_system6.4;graph_id=01dae5a273environment variable:
DWAVE_API_SOLVER='Advantage_system6.4;graph_id=01dae5a273'as an argument to the
dwaveCLI:dwave solvers -s 'Advantage_system6.4;graph_id=01dae5a273'or as the client constructor argument:
from dwave.cloud import Client with Client.from_config(solver='Advantage_system6.4;graph_id=01dae5a273') as client: solver = client.get_solver() assert(solver.name == 'Advantage_system6.4') assert(solver.graph_id == '01dae5a273')Note: specifying your solver via name only is still possible. In that case, working graph version is not constrained.
See #714.
- Pass-through unused keyword arguments in
dwave.cloud.utils.http.BaseUrlSessionMixinconstructor. This enables mixing with session mixins fromdwave.cloud.api.clientin any order.
- Enable
DWaveAPIClientto properly cache different API response representation versions by reordering session mixins. Caching layer is now below the API version handling, hence capturing changes from the versioning layer.
- Facilitate cached content validation and parsing by caching the response content type as part of metadata in
dwave.cloud.api.client.CachingSessionMixin.
-
Make
SolverIdentitystring representation more explicit. Version components are now clearly identified, avoiding ambiguity and enabling reverse lookups (i.e. conversion between string representation and solver identity structure).Add
SolverIdentity.from_id()factory that creates solver identity model off its string representation.See #713.
-
Implement support for SAPI v3 solver representation format. Use it by default.
Use
Solver.identityinstead ofSolver.idto uniquely reference a specific solver and its version.See #696.
-
Feature-based solver filtering via
Client.get_solver()andClient.get_solvers()has been extended to support the newidentityfield (dict),version(dict) andgraph_id(string). For example:client.get_solvers(name='Advantage_system6.4', graph_id='01dae5a273') client.get_solvers(graph_id='01dae5a273') client.get_solvers(version__graph_id='01dae5a273') client.get_solvers(identity__version={'graph_id': '01dae5a273'}) client.get_solvers(category='qpu', order_by='graph_id') client.get_solver(id='Advantage_system6.4;graph_id=01dae5a273')
- Add
SolverVersionandSolverIdentitytodwave.cloud.api.models. They both compare with adict, and serialize with.dict()for convenience.
- Speed-up
StructuredSolverconstruction by deferring initialization of large data members.nodes,edgesandundirected_edgesare now cached properties, constructed on first access. See #706.
- Add
dwave cachegroup of commands for listing cache directories used by the cloud-client, displaying additional information about the cache, as well as purging it. See #719.
-
Add support for Leap deprecation messages to
dwave.cloud.client.Clientanddwave.cloud.api.client.DWaveAPIClient.Deprecation messages received are raised as Python warnings using a new category,
dwave.cloud.api.exceptions.ResourceDeprecationWarningand logged using theWARNINGlog level.See #721.
-
Enable the previous client close behavior to wait for all remote jobs to finish.
Waiting for all jobs to finish and their results to be downloaded before shutting down the client is now the new default. To close the client as fast as possible (immediately preventing status polls and answer downloads), set the
waitargument to false:Client.close(wait=False).See #712.
Upgrade Notes
- Switch to using solver's
identitystructure in place of the legacy stringid.
Solver.datatype changed from a raw dict (as returned by SAPI) to thedwave.cloud.api.models.SolverConfigurationmodel. This is mostly a backwards-compatible change, since getter/setter interface is supported.
- The type of
solverargument todwave.cloud.api.resources.Problemsmethods (submit_problemandlist_problems) changed from a string, to aSolverIdentitymodel.
-
dwave.cloud.Client.get_regions()which has been deprecated since cloud-client 0.11.0, is now removed in favor ofdwave.cloud.regions.get_regions(). Usage example available in the docs.The main benefit of
get_regionsas a stand-alone function is thatClientdoesn't have to be instantiated (and configured to use the default region), just to be able to fetch the list of regions.
-
We removed (previously deprecated) aliases for client types.
Replace your
Clientimports fromdwave.cloud.{type}with imports fromdwave.cloud.client.{type}(typebeingqpu,sworhybrid).
- Remove API constants deprecated in 0.13.1 and moved to
dwave.cloud.config.constantsfromdwave.cloud.api.constants:DEFAULT_METADATA_API_ENDPOINT,DEFAULT_REGION,DEFAULT_SOLVER_API_ENDPOINT,DEFAULT_LEAP_API_ENDPOINT.
dwave.cloud.utils.coders.NumpyEncoderis now removed in favor oforjson.dumps()used with theOPT_SERIALIZE_NUMPYflag. We first deprecatedNumpyEncoderin dwave-cloud-client 0.12.2.
Deprecation Notes
Solver.idis deprecated in favor ofSolver.identity. Solver "ID" is not available anymore, so it's constructed on the fly from theidentityfield, with the uniqueness assumption preserved.
solver_idargument indwave.cloud.api.resources.Solvers.get_solver()is deprecated in favor ofsolver_name.
Bug Fixes
- Fix tests to never (accidentally) contact 3rd-party mock sites nor depend on their functionality. See #707.
- Make answer field optional on the
dwave.cloud.api.models.ProblemInfomodel in order to support problems not completed (e.g. pending or failed). See #703.
- Preserve
Content-Typeof a response cached withCachingSessionMixin.
0.14.0rc1
Prelude
Solver identification has changed with SAPI solver representation v3. Instead of a unique string id, each solver is now uniquely referenced by a more descriptive identity dictionary. Each solver still has a name, but to uniquely identify a specific working graph of a structured solver (QPU), graph_id has to be used. Hybrid (unstructured) solvers are still uniquely identified by their name.
New Features
-
Allow
solverto be specified using the new solver identity string representation.The new format is supported in a config file:
[my-experiment] solver = Advantage_system6.4;graph_id=01dae5a273environment variable:
DWAVE_API_SOLVER='Advantage_system6.4;graph_id=01dae5a273'as an argument to the
dwaveCLI:dwave solvers -s 'Advantage_system6.4;graph_id=01dae5a273'or as the client constructor argument:
from dwave.cloud import Client with Client.from_config(solver='Advantage_system6.4;graph_id=01dae5a273') as client: solver = client.get_solver() assert(solver.name == 'Advantage_system6.4') assert(solver.graph_id == '01dae5a273')Note: specifying your solver via name only is still possible. In that case, working graph version is not constrained.
See #714.
- Pass-through unused keyword arguments in
dwave.cloud.utils.http.BaseUrlSessionMixinconstructor. This enables mixing with session mixins fromdwave.cloud.api.clientin any order.
- Enable
DWaveAPIClientto properly cache different API response representation versions by reordering session mixins. Caching layer is now below the API version handling, hence capturing changes from the versioning layer.
- Facilitate cached content validation and parsing by caching the response content type as part of metadata in
dwave.cloud.api.client.CachingSessionMixin.
- Convert
requests.Sessionsubclasses indwave.cloud.api.clientto mixins.BaseUrlSessionMixin,LoggingSessionMixin,PayloadCompressingSessionMixin,VersionedAPISessionMixinandCachingSessionMixincan now be combined and used independently of each other.
- Enforce supported API response version on base client methods (problem submit, status poll, problem cancel, answer download). In case of unsupported API response, an
InvalidAPIResponseErrorexception is raised.
-
Make
SolverIdentitystring representation more explicit. Version components are now clearly identified, avoiding ambiguity and enabling reverse lookups (i.e. conversion between string representation and solver identity structure).Add
SolverIdentity.from_id()factory that creates solver identity model off its string representation.See #713.
-
Implement support for SAPI v3 solver representation format. Use it by default.
Use
Solver.identityinstead ofSolver.idto uniquely reference a specific solver and its version.See #696.
-
Feature-based solver filtering via
Client.get_solver()andClient.get_solvers()has been extended to support the newidentityfield (dict),version(dict) andgraph_id(string). For example:client.get_solvers(name='Advantage_system6.4', graph_id='01dae5a273') client.get_solvers(graph_id='01dae5a273') client.get_solvers(version__graph_id='01dae5a273') client.get_solvers(identity__version={'graph_id': '01dae5a273'}) client.get_solvers(category='qpu', order_by='graph_id') client.get_solver(id='Advantage_system6.4:01dae5a273')
- Add
SolverVersionandSolverIdentitytodwave.cloud.api.models. They both compare with adict, and serialize with.dict()for convenience.
- Speed-up
StructuredSolverconstruction by deferring initialization of large data members.nodes,edgesandundirected_edgesare now cached properties, constructed on first access. See #706.
Upgrade Notes
- Switch to using solver's
identitystructure in place of the legacy stringid.
Solver.datatype changed from a raw dict (as returned by SAPI) to thedwave.cloud.api.models.SolverConfigurationmodel. This is mostly a backwards-compatible change, since getter/setter interface is supported.
- The type of
solverargument todwave.cloud.api.resources.Problemsmethods (submit_problemandlist_problems) changed from a string, to aSolverIdentitymodel.
-
dwave.cloud.Client.get_regions()which has been deprecated since cloud-client 0.11.0, is now removed in favor ofdwave.cloud.regions.get_regions(). Usage example available in the docs.The main benefit of
get_regionsas a stand-alone function is thatClientdoesn't have to be instantiated (and configured to use the default region), just to be able to fetch the list of regions.
-
We removed (previously deprecated) aliases for client types.
Replace your
Clientimports fromdwave.cloud.{type}with imports fromdwave.cloud.client.{type}(typebeingqpu,sworhybrid).
- Remove API constants deprecated in 0.13.1 and moved to
dwave.cloud.config.constantsfromdwave.cloud.api.constants:DEFAULT_METADATA_API_ENDPOINT,DEFAULT_REGION,DEFAULT_SOLVER_API_ENDPOINT,DEFAULT_LEAP_API_ENDPOINT.
dwave.cloud.utils.coders.NumpyEncoderis now removed in favor oforjson.dumps()used with theOPT_SERIALIZE_NUMPYflag. We first deprecatedNumpyEncoderin dwave-cloud-client 0.12.2.
- Switch from pkgutil-style namespace package to native namespace package (PEP 420). While native namespace packages and pkgutil-style namespace packages are largely compatible, we recommend using only native ones going forward.
Deprecation Notes
- The following
requests.Sessionsubclasses are deprecated in favor of their mixin variants:LoggingSession,PayloadCompressingSession,VersionedAPISession,CachingSession. They'll be removed in dwave-cloud-client 0.15.0.
Solver.idis deprecated in favor ofSolver.identity. Solver "ID" is not available anymore, so it's constructed on the fly from theidentityfield, with the uniqueness assumption preserved.
solver_idargument indwave.cloud.api.resources.Solvers.get_solver()is deprecated in favor ofsolver_name.
Bug Fixes
- Fix tests to never (accidentally) contact 3rd-party mock sites nor depend on their functionality. See #707.
- Make answer field optional on the
dwave.cloud.api.models.ProblemInfomodel in order to support problems not completed (e.g. pending or failed). See #703.
- Preserve
Content-Typeof a response cached withCachingSessionMixin.
0.13.6
New Features
- Convert
requests.Sessionsubclasses indwave.cloud.api.clientto mixins.BaseUrlSessionMixin,LoggingSessionMixin,PayloadCompressingSessionMixin,VersionedAPISessionMixinandCachingSessionMixincan now be combined and used independently of each other.
- Enforce supported API response version on base client methods (problem submit, status poll, problem cancel, answer download). In case of unsupported API response, an
InvalidAPIResponseErrorexception is raised.
Upgrade Notes
- Switch from pkgutil-style namespace package to native namespace package (PEP 420). While native namespace packages and pkgutil-style namespace packages are largely compatible, we recommend using only native ones going forward.
Deprecation Notes
- The following
requests.Sessionsubclasses are deprecated in favor of their mixin variants:LoggingSession,PayloadCompressingSession,VersionedAPISession,CachingSession. They'll be removed in dwave-cloud-client 0.15.0.
0.13.5
0.13.4
New Features
-
Add
output_fileparameter todwave.cloud.utils.logging.configure_logging()to simplify logging to a file. -
Add
dwave.cloud.api.models.ProblemJob.from_info()helper factory method that constructs a problem job model from problem info model. -
Allow
dwave.cloud.api.resources.Problems.submit_problem()to accept a problem described by aProblemJobmodel, with individual attributes optionally modified by keyword arguments.
0.13.3
New Features
-
Add
PayloadCompressingSession, arequests.Sessionsubclass that adds support for payload compression on the fly todwave.cloud.api.client.DWaveAPIClient.See #654.
- Support compression of QPU problem data on upload in
SolverAPIClientandapi.Problemsviacompress_qpu_problem_dataconfig option.
-
More robust
Client.close().Client use after close is now disabled. An attempt to submit a problem, poll for a status, or download an answer will now result in an
UseAfterCloseErrorexception.Also, solvers and computations now only weakly reference the client, so they don't block client resources cleanup.
See #217.
-
Disable client use while
Client.close()is in progress by failing withUseAfterCloseError. Also, make sure the close operation is thread-safe.A follow-up to #680.
Upgrade Notes
- Remove
Client.session, an undocumented and unused client attribute. If still needed, can be replaced withClient.create_session().
0.13.2
New Features
- Add Python 3.13 support.
- Add
--rawoutput mode to get-token CLI commands. See #598.
Upgrade Notes
- Remove support for dimod 0.9.x. Upgrade dimod to 0.10.0+. See #595.
- Upgrade your python to 3.9+. We no longer support python 3.8 and below.
Deprecation Notes
- Client utility function
dwave.cloud.coders.bqm_as_file()is deprecated in favor ofdimod.BQM.to_file()(available in dimod 0.10.0+) and will be removed in dwave-cloud-client 0.15.0.
Bug Fixes
- Update sample set creation in
dwave.cloud.computation.Futureto support dimod 0.12.18+. Previously,wait_id()method used to be added to thefrom_future-created sample sets in the cloud-client, and now theSampleSetinterface propagateswait_idfrom the future by default. See dimod#1392 and dwave-system#540.