Skip to content

Commit be22769

Browse files
committed
A notebook example.
1 parent a1e65bb commit be22769

File tree

7 files changed

+725
-5
lines changed

7 files changed

+725
-5
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

cmipld/tests/jsonld/experiment/__init__.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,26 @@ def tier_val(cls, value):
3232
assert value in [1, 2, 3], 'tier should be 1,2, or 3'
3333
return value
3434

35-
@field_validator('start_date', mode='after')
35+
# @field_validator('start_date', mode='after')
36+
# @classmethod
37+
# def s_date(cls, value):
38+
# if value != 'none':
39+
# validate_date(value)
40+
# return value
41+
42+
43+
@model_validator(mode='after')
3644
@classmethod
37-
def s_date(cls, value):
38-
if value != 'none':
39-
validate_date(value)
40-
return value
45+
def s_date(cls, values):
46+
47+
if values['start-date'] != 'none':
48+
validate_date(values['start-date'])
49+
else:
50+
if values["minimum-number-of-years"] > 0:
51+
raise ValueError('If no start date is provided, a minimum number of years entry must be supplied.')
52+
53+
return values
54+
4155

4256
# @field_validator('branch_date', mode='after')
4357
# @classmethod
File renamed without changes.

0 commit comments

Comments
 (0)