You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When you try to run fre pp validate with history_segment: P1M and pp_chunk_a: P1Y, you'll get an error that says that pp_chunk_a should be evenly divisible by the size of the history segment
To Reproduce
Add the above key value pairs to your pp yaml
Expected behavior
The validator should recognize months as being divisible by years and accept PXM as a history segment for any pp chunk of the form PNY if 12*N is divisible by X.
Additional context
This issue seems to stem from how the metomi.isodatetime.parser interprets months - it assumes all months are 30 days long, so when we try to check if a year (which metomi interprets as 365 days) is divisible by months, we get false in the following function:
'''Takes in chunk value e.g P1Y and the chunk reference value from HISTORY_SEGMENT, returns True or False based on the validation to check if the former is a multiple of the latter'''
Describe the bug
When you try to run
fre pp validate
withhistory_segment: P1M
andpp_chunk_a: P1Y
, you'll get an error that says thatpp_chunk_a
should be evenly divisible by the size of the history segmentTo Reproduce
Add the above key value pairs to your pp yaml
Expected behavior
The validator should recognize months as being divisible by years and accept
PXM
as a history segment for any pp chunk of the formPNY
if 12*N is divisible by X.Additional context
This issue seems to stem from how the
metomi.isodatetime.parser
interprets months - it assumes all months are 30 days long, so when we try to check if a year (which metomi interprets as 365 days) is divisible by months, we get false in the following function:fre-workflows/meta/lib/python/macros/chunkcheck.py
Lines 23 to 31 in c18dedd
The text was updated successfully, but these errors were encountered: