Skip to content

Commit

Permalink
Merge 234c42a into 6cd1a2d
Browse files Browse the repository at this point in the history
  • Loading branch information
aawdls committed Sep 18, 2020
2 parents 6cd1a2d + 234c42a commit eeb0461
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aa/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def get_event_at(self, pv, instant, request_params=None):
try:
return self.get_values(pv, instant, instant, 1,
request_params).get_event(0)
except IndexError:
except IndexError as e:
error_msg = 'No data found for pv {} at timestamp {}'
raise ValueError(error_msg.format(pv, instant))
raise ValueError(error_msg.format(pv, instant)) from e


class AaFetcher(Fetcher):
Expand Down
3 changes: 3 additions & 0 deletions aa/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def archive_pv(self, pv, samplingperiod, samplingmethod=aa.SCAN):
def pause_archiving_pv(self, pv):
return self._rest_get('pauseArchivingPV', pv=pv)

def resume_archiving_pv(self, pv):
return self._rest_get('resumeArchivingPV', pv=pv)

def delete_pv(self, pv):
return self._rest_get('deletePV', pv=pv)

Expand Down
1 change: 1 addition & 0 deletions test/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_AaRestClient_construct_url(kwargs, aa_client):
('getCurrentlyDisconnectedPVs', 'get_currently_disconnected_pvs', {}),
('archivePV', 'archive_pv', {'pv': 'dummy', 'samplingperiod': 10, 'samplingmethod': MONITOR}),
('pauseArchivingPV', 'pause_archiving_pv', {'pv': 'dummy'}),
('resumeArchivingPV', 'resume_archiving_pv', {'pv': 'dummy'}),
('deletePV', 'delete_pv', {'pv': 'dummy'}),
('abortArchivingPV', 'abort_archiving_pv', {'pv': 'dummy'})
])
Expand Down

0 comments on commit eeb0461

Please sign in to comment.