"Set" classes are not iterable
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Start with the Set classes, including tsp.trace_set.TraceSet, and locate the implementations of ExperimentSet, TraceSet, ConfigurationParameterDescriptorSet, ConfigurationSet, ConfigurationSourceSet, and OutputDescriptorSet. Compare their current collection behavior with the access patterns in the issue and the linked example commit. Done means each class can be iterated directly and reports its size with len(), while indexing remains optional.
Written by the indexing model from the issue text.
Description
The Set classes, ExperimentSet, TraceSet, ConfigurationParameterDescriptorSet, ConfigurationSet, ConfigurationSourceSet and OutputDescriptorSet are not usable by themselves as collections.
This gives you access patterns like:
from tsp.trace_set import TraceSet
traces = TraceSet([{"name": "trace0"}, {"name": "trace1"}])
for trace in traces.traces:
print(t.name)
# trace0
# trace1
print(len(traces.traces))
# 2
This is especially inconvenient when working with experiments, since to loop over traces, you must do:
for t in experiment.traces.traces
We could make the classes easier to work with by making them implement collection interfaces.
This would give you the following access patterns instead:
from tsp.trace_set import TraceSet
traces = TraceSet([{"name": "trace0"}, {"name": "trace1"}])
for trace in traces:
print(t.name)
# trace0
# trace1
print(len(traces))
# 2
See example in this commit.
__getitem__ could be implemented as well to allow indexing with integers (traces[0]), but it is not implemented for Python sets, so it would make the "Set" classes look less like sets.
If this kind of functionality is wanted, I can help provide patches.
- Dominant language
- Python
- Stars
- 6
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
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 eclipse-cdt-cloud/tsp-python-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Support endpoint to update experimentsPossibly taken @bhufmann claimed this 1820 days ago. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
eclipse-cdt-cloud/tsp-python-client#45 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
All issues in eclipse-cdt-cloud/tsp-python-client
Similar issues
-
area:print-dispatch
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Apich-Organization/rssn#295 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
chore claimed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
schuyler/corvidae#1424 · 2 comments ·
Maintainers usually reply within 1 day