Skip to content

Expose jackhammer function to programmatic use - #514

Open
tristpinsm wants to merge 4 commits into
masterfrom
tpm/hammer-ocs
Open

Expose jackhammer function to programmatic use#514
tristpinsm wants to merge 4 commits into
masterfrom
tpm/hammer-ocs

Conversation

@tristpinsm

Copy link
Copy Markdown
Contributor

Needed for the socs jackhammer agent.

Allows the script to complete even if individual slots fail.

tristpinsm and others added 2 commits July 21, 2026 13:54
Refactor hammer_func into a standalone hammer() function with explicit
keyword args, so it can be called without argparse or interactive prompts.
The CLI entrypoint now delegates to hammer() after confirmation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add timeouts to per-slot operations (carrier ping, EPICS connection,
pysmurf setup) so that a single failing slot no longer blocks or
aborts the remaining slots. hammer() now returns a dict of
succeeded/failed slots with error messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tristpinsm
tristpinsm marked this pull request as draft July 22, 2026 16:12
tristpinsm and others added 2 commits July 23, 2026 15:36
Tests exercise the three failure isolation points (carrier ping,
EPICS connection, pysmurf setup) with mocked external dependencies,
verifying that individual slot failures are recorded while surviving
slots complete successfully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tristpinsm
tristpinsm marked this pull request as ready for review July 23, 2026 19:45
@tristpinsm

Copy link
Copy Markdown
Contributor Author

Ready for review, and unit tests suggest the changes work, but I can try to test on the LAT when there is downtime this week.

@msilvafe msilvafe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, and you added tests! Let me know how the LAT testing goes.

@tristpinsm

Copy link
Copy Markdown
Contributor Author

I just ran the updated script on the LAT crate 1 and it behaved as expected. I didn't do an exhaustive test, but I was able to run the commands pysmurf, util, hammer both with and without the --soft option with no issues. The hammer actually failed on setup because I had forgotten to disable the controllers, and it reported the failed slots the way it was intended.

@msilvafe

Copy link
Copy Markdown
Contributor

I just ran the updated script on the LAT crate 1 and it behaved as expected. I didn't do an exhaustive test, but I was able to run the commands pysmurf, util, hammer both with and without the --soft option with no issues. The hammer actually failed on setup because I had forgotten to disable the controllers, and it reported the failed slots the way it was intended.

Great news! Can you link me to the SOCS partner PR I'd like to look at that one too but this looks good to merge to me.

@tristpinsm

Copy link
Copy Markdown
Contributor Author

Great news! Can you link me to the SOCS partner PR I'd like to look at that one too but this looks good to merge to me.

Ok, thanks! The other PR is simonsobs/socs#1092 and I just marked it ready for review, but that one probably still needs work / testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants