simonsobs / simonsobs/sorunlib
Add `duration` kwarg to `smurf.stream`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 17h 32m
- Merged PRs (30d)
- 1
Description
duration is a kwarg that isn't passed through the kwargs argument in the controller/sodetlib function, so it needs to be handled separately.
This was found when passing duration was attempted recently in a stimulator test:
Failed to start stream on OCSClient('det-controller-c4s7'), removing from targets list.
Operation stream in Agent det-controller-c4s7 is not 'running'.
Current OpCode: 6
OCSReply: OK : Session active.
stream[session=223]; status=done with ERROR 2.1 mins ago, took 0.356534 s
messages (4 of 4):
1756868183.101 Status is now "starting".
1756868183.103 Status is now "running".
1756868183.453 CRASH: [Failure instance: Traceback: <class 'TypeError'>: stream_g3_on() got an unexpected keyword argument 'duration'
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:269:inContext
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:285:<lambda>
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:117:callWithContext
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:82:callWithContext
/usr/local/lib/python3.8/dist-packages/ocs/ocs_agent.py:984:_running_wrapper
/usr/local/lib/python3.8/dist-packages/socs/agents/pysmurf_controller/agent.py:460:stream
/usr/local/src/pysmurf/python/pysmurf/client/util/pub.py:50:wrapper
]
1756868183.458 Status is now "done".
other keys in .session: op_code, degraded, data
We'll need to just add a new kwarg in stream:
https://github.com/simonsobs/sorunlib/blob/12158db5a90a47c1e1c51abb6d155093baea6803/src/sorunlib/smurf.py#L368.
Contributor 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.
Research direction
Open src/sorunlib/smurf.py around line 368 and inspect the stream function's keyword arguments. Compare it with the controller/sodetlib call path linked in the issue, then reproduce or review the stimulator failure involving duration. Done means stream accepts duration and passes it without causing the unexpected-keyword error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100