Skip to content

Commit

Permalink
#34: Update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 29, 2019
1 parent d8156fb commit cbec9d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ def _get_investigations_for_instrument(instrument_id):
def get_facility_cycles_for_instrument(instrument_id, filters):
"""
Given an instrument_id get facility cycles where the instrument has investigations that occur within that cycle
:param filters: The filters to be applied to the query
:param instrument_id: The id of the instrument
:return: A list of facility cycle entities
"""
Expand Down Expand Up @@ -542,9 +543,9 @@ def __init__(self, instrument_id, facility_cycle_id):
self._get_date_filters()

def _get_date_filters(self):
"""
"""
Sets the date filters to be applied to the query
"""
"""
self.start_date_filter = WhereFilter("STARTDATE", self._get_facility_cycle()["STARTDATE"], "gte")
self.end_date_filter = WhereFilter("ENDDATE", self._get_facility_cycle()["ENDDATE"], "lte")

Expand All @@ -555,7 +556,7 @@ def _get_facility_cycle(self):
:return: The facility cycle
"""
facility_cycles = get_facility_cycles_for_instrument(self.instrument_id, filters=[])
try:
try:
# The ID value gets previously converted to str
return [cycle for cycle in facility_cycles if cycle["ID"] == str(self.facility_cycle_id)][0]
except IndexError:
Expand Down

0 comments on commit cbec9d2

Please sign in to comment.