Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 20, 2024
1 parent 04999b4 commit 735850d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions socs/agents/starcam_lat/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def pack_and_send_cmds(self):
**Process**
<<<<<<< HEAD
packs commands and parameters to be sent to starcamera and sends
=======
packs commands and parameters to be sent to star camera and sends
Expand Down Expand Up @@ -94,7 +94,7 @@ def pack_and_send_cmds(self):
n_sigma_value,
star_spacing_value]
# Pack values into the command for the camera
self.cmds_for_camera = struct.pack('ddddddfiiiiiiiiiifffffffff',
self.cmds_for_camera = struct.pack('ddddddfiiiiiiiiiifffffffff',
*values)
# send commands to the camera
self.comm.sendto(self.cmds_for_camera, (self.ip, self.port))
Expand Down Expand Up @@ -153,7 +153,7 @@ def __init__(self, agent, ip_address, port):
self.take_data = False
self.lock = TimeoutLock()
agg_params = {'frame_length': 60}
self.agent.register_feed("starcamera", record=True,
self.agent.register_feed("starcamera", record=True,
agg_params=agg_params, buffer_time=1)
try:
self.StarcamHelper = StarcamHelper(ip_address, port)
Expand Down Expand Up @@ -192,9 +192,9 @@ def acq(self, session, params=None):
**Return**
<<<<<<< HEAD
once the acq() loop exits (wherein data is retrieved from
the camera and pulished), a touple with True/False and a string
describing whether or not the loop was exited after the end of
once the acq() loop exits (wherein data is retrieved from
the camera and pulished), a touple with True/False and a string
describing whether or not the loop was exited after the end of
an acquisition.
=======
once the acq() loop exits (wherein data is retrieved from the camera and pulished),
Expand All @@ -206,7 +206,7 @@ def acq(self, session, params=None):
params = {}
with self.lock.acquire_timeout(timeout=100, job='acq') as acquired:
if not acquired:
self.log.warn("Could not start init because {} is already
self.log.warn("Could not start init because {} is already
running".format(self.lock.job))
return False, "Could not acquire lock"
session.set_status('running')
Expand All @@ -222,7 +222,7 @@ def acq(self, session, params=None):
astrom_data = self.StarcamHelper.get_astrom_data()
<<<<<<< HEAD
# update the data dictionary+session and publish
data['data'].update(astrom_data_dict)
data['data'].update(astrom_data_dict)
=======
# update the data dictionary, update the session, and publish
data['data'].update(astrom_data_dict)
Expand All @@ -239,17 +239,17 @@ def _stop_acq(self, session, params):
self.take_data = False
ok = True
# self.StarcamHelper.close()
return (ok, {True: 'Requested process to stop',
return (ok, {True: 'Requested process to stop',
False: 'Failed to request process stop.'}[ok])


def add_agent_args(parser=None):
if parser is None:
parser = argparse.ArgumentParser()
pgroup = parser.add_argument_group('Agent Options')
pgroup.add_argument("--ip-address", type=str,
pgroup.add_argument("--ip-address", type=str,
help="IP address of starcam computer")
pgroup.add_argument("--port", default="8000", type=int,
pgroup.add_argument("--port", default="8000", type=int,
help="Port of starcam computer")
return parser

Expand All @@ -265,9 +265,9 @@ def main(args=None):
parser = add_agent_args()
args = site_config.parse_args(agent_class="StarcamAgent", parser=parser)
agent, runner = ocs_agent.init_site_agent(args)
starcam_agent = StarcamAgent(agent, ip_address=args.ip_address,
starcam_agent = StarcamAgent(agent, ip_address=args.ip_address,
port=args.port)
agent.register_task('send_commands', starcam_agent.send_commands,
agent.register_task('send_commands', starcam_agent.send_commands,
startup=True)
agent.register_process('acq', starcam_agent.acq, starcam_agent._stop_acq)
runner.run(agent, auto_reconnect=False)
Expand Down

0 comments on commit 735850d

Please sign in to comment.