dwavesystems / dwave-system

An API for easily incorporating the D-Wave system as a sampler, either directly or through Leap's cloud-based hybrid samplers
https://docs.ocean.dwavesys.com/
Apache License 2.0
87 stars 62 forks source link

Allow config solver override in hybrid samplers #422

Closed randomir closed 2 years ago

randomir commented 3 years ago

Constrain client type to hybrid, but propagate user-specified solver definition (from config file/env/kwargs).

This is a hybrid analogue of #317 (where we applied the same fix to QPU samplers).

Closes #363.

Note

Partial user-supplied solver definition (patch) is not yet possible, as that requires https://github.com/dwavesystems/dwave-cloud-client/issues/426.

User-supplied solver mapping will not be updated to fix accepted problems types (bqm/dqm) or version preference.

So, while this PR fixes the unexpected behavior or user not being able to override the solver in config file/env, it creates a new (less unexpected) gotcha -- whenever user sets solver (on any level above defaults), that solver filter is used verbatim. For example, users wanting to filter-out bulk solvers will have to make sure they specify the BQM or DQM solver explicitly, as the user selection is final.

randomir commented 3 years ago

Not sure why AppVeyor fails.

randomir commented 3 years ago

Alright, purging the cache on AppVeyor resolved that pip._internal error.

Interestingly, unlike CircleCI, AppVeyor provides a way to clear cache via an API. Probably the only +1 over Circle. :laughing:

randomir commented 3 years ago

That's a good idea! It will bridge the gap until we have https://github.com/dwavesystems/dwave-cloud-client/issues/426.

codecov-commenter commented 3 years ago

Codecov Report

Merging #422 (28b205f) into master (d4d8399) will decrease coverage by 1.44%. The diff coverage is 91.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #422      +/-   ##
==========================================
- Coverage   91.87%   90.43%   -1.45%     
==========================================
  Files          22       22              
  Lines        1366     1369       +3     
==========================================
- Hits         1255     1238      -17     
- Misses        111      131      +20     
Impacted Files Coverage Δ
dwave/system/samplers/dwave_sampler.py 84.37% <ø> (-3.13%) :arrow_down:
dwave/system/samplers/leap_hybrid_sampler.py 75.71% <91.30%> (-1.66%) :arrow_down:
dwave/system/samplers/clique.py 77.35% <0.00%> (-6.29%) :arrow_down:
dwave/system/composites/embedding.py 95.85% <0.00%> (-1.19%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d4d8399...28b205f. Read the comment docs.