Make all `.to_file()` methods into context managers
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Search the repository for all .to_file() methods and inspect their callers, starting with the usage in dwave-cloud-client linked from the issue and checking dwave-system compatibility. Determine which methods and call sites depend on the returned file remaining open; done means all affected methods use context managers and downstream integrations remain compatible.
Written by the indexing model from the issue text.
Description
I.e., change
class Model:
def to_file(self, ...):
file = tempfile.TemporaryFile(...)
...
return file
to
class Model:
@contextlib.contextmanager
def to_file(self, ...):
with tempfile.TemporaryFile(...) as file:
...
yield file
I briefly tried to do this in https://github.com/dwavesystems/dwave-optimization/pull/697, but it has implications for the dwave-cloud-client and dwave-system so marking it for the future instead.
- Dominant language
- C++
- Stars
- 32
- Forks
- 38
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dwavesystems/dwave-optimization
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dwavesystems/dwave-optimization#505 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
dwavesystems/dwave-optimization#673 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
dwavesystems/dwave-optimization#657 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
dwavesystems/dwave-optimization#631 ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dwavesystems/dwave-optimization#629 ·
Maintainers usually reply within 2 days
All issues in dwavesystems/dwave-optimization
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openscad/openscad#7360 · 2 comments ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
connector-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gettakaro/connectors#1067 ·
Maintainers usually reply within 1 day