Skip to content

Releases: dwavesystems/dwave-cloud-client

0.14.3

05 Nov 04:28
e420d2b

Choose a tag to compare

Bug Fixes

  • Fix answer retrieval for problems with null for solver version (as returned by SAPI). See #736.

0.14.2

05 Nov 01:17
7f2eb0c

Choose a tag to compare

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_home configuration parameters and DWAVE_CACHE_ENABLED/DWAVE_CACHE_HOME environment variables.

    Caching is disabled by default in the low-level interfaces (ClientConfig configuration model, dwave.cloud.api.* models, clients and resources, e.g. api.Solvers, api.Regions, etc.), but enabled in the high-level Client interface.

    See #614.

0.14.1

24 Oct 18:58
087a77b

Choose a tag to compare

New Features

  • Add Python 3.14 support. See #730.
  • Implement close() method and context protocol support on AuthFlow and LeapAuthFlow classes.

Upgrade Notes

  • Upgrade your Python to 3.10+. We no longer support Python 3.9 and below. See #726.

Deprecation Notes

  • Solver.is_vfyc property 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 the vfyc (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 with graph_id missing, we fall back to a partial solver match (based on name only). See #727.
  • Fix resource leaks during diskcache/sqlite database use in CachingSessionMixin, LeapAuthFlow and @cached. See #731.

0.14.0

10 Sep 12:54
7a7e312

Choose a tag to compare

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 solver to 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=01dae5a273
    

    environment variable:

    DWAVE_API_SOLVER='Advantage_system6.4;graph_id=01dae5a273'
    

    as an argument to the dwave CLI:

    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.BaseUrlSessionMixin constructor. This enables mixing with session mixins from dwave.cloud.api.client in any order.
  • Enable DWaveAPIClient to 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 SolverIdentity string 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.identity instead of Solver.id to uniquely reference a specific solver and its version.

    See #696.

  • Feature-based solver filtering via Client.get_solver() and Client.get_solvers() has been extended to support the new identity field (dict), version (dict) and graph_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 SolverVersion and SolverIdentity to dwave.cloud.api.models. They both compare with a dict, and serialize with .dict() for convenience.
  • Speed-up StructuredSolver construction by deferring initialization of large data members. nodes, edges and undirected_edges are now cached properties, constructed on first access. See #706.
  • Add dwave cache group 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.Client and dwave.cloud.api.client.DWaveAPIClient.

    Deprecation messages received are raised as Python warnings using a new category, dwave.cloud.api.exceptions.ResourceDeprecationWarning and logged using the WARNING log 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 wait argument to false: Client.close(wait=False).

    See #712.

Upgrade Notes

  • Switch to using solver's identity structure in place of the legacy string id.
  • Solver.data type changed from a raw dict (as returned by SAPI) to the dwave.cloud.api.models.SolverConfiguration model. This is mostly a backwards-compatible change, since getter/setter interface is supported.
  • The type of solver argument to dwave.cloud.api.resources.Problems methods (submit_problem and list_problems) changed from a string, to a SolverIdentity model.
  • dwave.cloud.Client.get_regions() which has been deprecated since cloud-client 0.11.0, is now removed in favor of dwave.cloud.regions.get_regions(). Usage example available in the docs.

    The main benefit of get_regions as a stand-alone function is that Client doesn'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 Client imports from dwave.cloud.{type} with imports from dwave.cloud.client.{type} (type being qpu, sw or hybrid).

  • Remove API constants deprecated in 0.13.1 and moved to dwave.cloud.config.constants from dwave.cloud.api.constants: DEFAULT_METADATA_API_ENDPOINT, DEFAULT_REGION, DEFAULT_SOLVER_API_ENDPOINT, DEFAULT_LEAP_API_ENDPOINT.
  • dwave.cloud.utils.coders.NumpyEncoder is now removed in favor of orjson.dumps() used with the OPT_SERIALIZE_NUMPY flag. We first deprecated NumpyEncoder in dwave-cloud-client 0.12.2.

Deprecation Notes

  • Solver.id is deprecated in favor of Solver.identity. Solver "ID" is not available anymore, so it's constructed on the fly from the identity field, with the uniqueness assumption preserved.
  • solver_id argument in dwave.cloud.api.resources.Solvers.get_solver() is deprecated in favor of solver_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.ProblemInfo model in order to support problems not completed (e.g. pending or failed). See #703.
  • Preserve Content-Type of a response cached with CachingSessionMixin.

0.14.0rc1

26 Aug 14:09

Choose a tag to compare

0.14.0rc1 Pre-release
Pre-release

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 solver to 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=01dae5a273
    

    environment variable:

    DWAVE_API_SOLVER='Advantage_system6.4;graph_id=01dae5a273'
    

    as an argument to the dwave CLI:

    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.BaseUrlSessionMixin constructor. This enables mixing with session mixins from dwave.cloud.api.client in any order.
  • Enable DWaveAPIClient to 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.Session subclasses in dwave.cloud.api.client to mixins. BaseUrlSessionMixin, LoggingSessionMixin, PayloadCompressingSessionMixin, VersionedAPISessionMixin and CachingSessionMixin can 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 InvalidAPIResponseError exception is raised.
  • Make SolverIdentity string 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.identity instead of Solver.id to uniquely reference a specific solver and its version.

    See #696.

  • Feature-based solver filtering via Client.get_solver() and Client.get_solvers() has been extended to support the new identity field (dict), version (dict) and graph_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 SolverVersion and SolverIdentity to dwave.cloud.api.models. They both compare with a dict, and serialize with .dict() for convenience.
  • Speed-up StructuredSolver construction by deferring initialization of large data members. nodes, edges and undirected_edges are now cached properties, constructed on first access. See #706.

Upgrade Notes

  • Switch to using solver's identity structure in place of the legacy string id.
  • Solver.data type changed from a raw dict (as returned by SAPI) to the dwave.cloud.api.models.SolverConfiguration model. This is mostly a backwards-compatible change, since getter/setter interface is supported.
  • The type of solver argument to dwave.cloud.api.resources.Problems methods (submit_problem and list_problems) changed from a string, to a SolverIdentity model.
  • dwave.cloud.Client.get_regions() which has been deprecated since cloud-client 0.11.0, is now removed in favor of dwave.cloud.regions.get_regions(). Usage example available in the docs.

    The main benefit of get_regions as a stand-alone function is that Client doesn'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 Client imports from dwave.cloud.{type} with imports from dwave.cloud.client.{type} (type being qpu, sw or hybrid).

  • Remove API constants deprecated in 0.13.1 and moved to dwave.cloud.config.constants from dwave.cloud.api.constants: DEFAULT_METADATA_API_ENDPOINT, DEFAULT_REGION, DEFAULT_SOLVER_API_ENDPOINT, DEFAULT_LEAP_API_ENDPOINT.
  • dwave.cloud.utils.coders.NumpyEncoder is now removed in favor of orjson.dumps() used with the OPT_SERIALIZE_NUMPY flag. We first deprecated NumpyEncoder in 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.Session subclasses are deprecated in favor of their mixin variants: LoggingSession, PayloadCompressingSession, VersionedAPISession, CachingSession. They'll be removed in dwave-cloud-client 0.15.0.
  • Solver.id is deprecated in favor of Solver.identity. Solver "ID" is not available anymore, so it's constructed on the fly from the identity field, with the uniqueness assumption preserved.
  • solver_id argument in dwave.cloud.api.resources.Solvers.get_solver() is deprecated in favor of solver_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.ProblemInfo model in order to support problems not completed (e.g. pending or failed). See #703.
  • Preserve Content-Type of a response cached with CachingSessionMixin.

0.13.6

12 Jun 21:50
8718362

Choose a tag to compare

New Features

  • Convert requests.Session subclasses in dwave.cloud.api.client to mixins. BaseUrlSessionMixin, LoggingSessionMixin, PayloadCompressingSessionMixin, VersionedAPISessionMixin and CachingSessionMixin can 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 InvalidAPIResponseError exception 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.Session subclasses 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

16 Apr 13:27
6de15ef

Choose a tag to compare

New Features

  • Return uploaded problem data id as part of Sampleset.info (the problem_data_id key). See #466.

Bug Fixes

  • Handle inconsistent cache in CachingSession (partial eviction edge case). See #691.

0.13.4

25 Mar 23:52
a464a5d

Choose a tag to compare

New Features

  • Add output_file parameter to dwave.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 a ProblemJob model, with individual attributes optionally modified by keyword arguments.

0.13.3

24 Feb 15:25
f4414d5

Choose a tag to compare

New Features

  • Add PayloadCompressingSession, a requests.Session subclass that adds support for payload compression on the fly to dwave.cloud.api.client.DWaveAPIClient.

    See #654.

  • Support compression of QPU problem data on upload in SolverAPIClient and api.Problems via compress_qpu_problem_data config 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 UseAfterCloseError exception.

    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 with UseAfterCloseError. 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 with Client.create_session().

0.13.2

26 Nov 15:12
90de738

Choose a tag to compare

New Features

  • Add Python 3.13 support.
  • Add --raw output 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 of dimod.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.Future to support dimod 0.12.18+. Previously, wait_id() method used to be added to the from_future-created sample sets in the cloud-client, and now the SampleSet interface propagates wait_id from the future by default. See dimod#1392 and dwave-system#540.