added code
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
def get_ovulation_day(cycle: dict) -> int:
|
||||
"""
|
||||
Get the ovulation day of a cycle.
|
||||
:param cycle: cycle dict
|
||||
:return: ovulation day
|
||||
"""
|
||||
try:
|
||||
is_biphasic = "classification_results" in cycle and cycle["classification_results"][0]["results"][
|
||||
"predicted_class"] == "biphasic"
|
||||
if not is_biphasic:
|
||||
return None
|
||||
|
||||
has_ov_detection = "ov_detection_results" in cycle
|
||||
if not has_ov_detection:
|
||||
return None
|
||||
|
||||
ov_detection_results = cycle["ov_detection_results"][0]["results"]["ovulation_day"]
|
||||
return ov_detection_results
|
||||
except Exception as e:
|
||||
# print(e)
|
||||
return None
|
||||
Reference in New Issue
Block a user