-
Notifications
You must be signed in to change notification settings - Fork 14
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
First try at fixing col setup without start stop. Model validator for… #1212
base: main-dev
Are you sure you want to change the base?
Conversation
… pydating is also removed
raise ValueError("Both start and stop need to be provided or both not provided.") | ||
return self | ||
|
||
# @model_validator(mode="after") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not just leave this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can. But then we have to remove the return self
above. I'm not sure if this might lead to other strange behavior
Some test do not work due to
part of the colocator code |
@dulte pushing this back until September to match the milestone for the associated PR. This is the type of issue I think we should clarify at the AeroTools backend design retreat, so please keep in mind as an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a few details that can be improved.
Also, not that start
and stop
need to be present I would appreciate tests when one of them is missing in order to ensure that an exception is raised.
if not p.exists(): | ||
p.mkdir(parents=True, exist_ok=True) | ||
return str(p) | ||
return self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why return self
?
if self.start or self.stop: | ||
raise ValueError("Both start and stop need to be provided or both not provided.") | ||
|
||
# return self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the previous validator returns `self, why this one does not?
if not (self.start and self.stop): | ||
if self.start or self.stop: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the nested if
needed?
maybe this could be re-written as
if not (self.start and self.stop) and self.start or self.stop:
or
if bool(self.start) != bool(self.stop):
if not p.exists(): | ||
p.mkdir(parents=True, exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no need for the if
, the exist_ok=True
parameter does the checking.
You can simple write:
p.mkdir(parents=True, exist_ok=True)
… pydating is also removed
Change Summary
Changes how the colocation setup and colocator handles start and stop times
Related issue number
Fix #1211
Checklist