Skip to content

Commit

Permalink
bypass time_definition.adj.years validation check if single year (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
ollie-bell authored Jan 8, 2025
1 parent e21bf96 commit 54d1725
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tz/osemosys/schemas/validation/timedefinition_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ def validate_adjacency_keys(
set(list(adj["timeslices"].keys()) + list(adj["timeslices"].values())) != set(timeslices)
):
raise ValueError("provided 'timeslices' do not match keys or values of 'adj.timeslices'")
if {int(yr) for yr in list(adj["years"].keys()) + list(adj["years"].values())} != set(years):
if len(years) > 1 and {
int(yr) for yr in list(adj["years"].keys()) + list(adj["years"].values())
} != set(years):
raise ValueError("provided 'years' do not match keys or values of 'adj.years'")
if seasons is not None and "seasons" in adj.keys():
if adj["seasons"] != {}:
Expand Down

0 comments on commit 54d1725

Please sign in to comment.