Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate month fix #21

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions meta/lib/python/macros/chunkcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class ChunkChecker(metomi.rose.macro.MacroBase):

def is_multiple_of(self, big_chunk, small_chunk):
'''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'''
big_chunk_days = big_chunk.get_days_and_seconds()[0]
small_chunk_days = small_chunk.get_days_and_seconds()[0]
if big_chunk_days % small_chunk_days == 0:
big_chunk_months = big_chunk.years*12 + big_chunk.months
small_chunk_months = small_chunk.years*12 + small_chunk.months
if big_chunk_months % small_chunk_months == 0:
return True
else:
return False
Expand Down