dwavesystems / dwavesystems/dimod
Transforms on SampleSets with unresolved futures
- Dominant language
- Python
- Stars
- 143
- Forks
- 91
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 3
Description
**Application**
Example:
In #429 if we wish to relabel a sampleset that has not yet been resolved, we need to block on the future before applying the relabelling. This makes sense in the copy case but not in the in-place case.
Example:
https://github.com/dwavesystems/dimod/blob/d60eeb86d3baf9387a4540d0a6697ed1b193298d/dimod/core/sampler.py#L150
which causes it to block in some cases and not in others, depending which `.sample` method was used.
**Proposed Solution**
We can nest futures. This could either be done in the relevant methods (e.g. `SampleSet.relabel_variables`) or we could make a `SampleSet.apply_transform` method or similar.
**Alternatives Considered**
* We could make the SampleSet wait for the future to resolve *on construction* which would simplify things considerably, potentially at the cost of performance.
**Additional Context**
* https://github.com/dwavesystems/dwave-system/issues/91
Contributor guide
Assessment
This issue has not been assessed yet.