-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ignored attributes added in robula model #196
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -158,6 +158,10 @@ def __init__(self, element, document, config): | |||||||||||
self.element = element | ||||||||||||
self.document = document | ||||||||||||
|
||||||||||||
if config["ignored_attributes"] is not None and len(config["ignored_attributes"]) != 0: | ||||||||||||
self.attribute_black_list.extend(config["ignored_attributes"]) | ||||||||||||
self.attribute_black_list = list(dict.fromkeys(self.attribute_black_list)) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be just
Suggested change
Pydantic guarantees us that And this line changes nothing self.attribute_black_list = list(dict.fromkeys(self.attribute_black_list)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In such cases it's better to leave comment explaining this, because as you can see, it was really not obvious :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can do it with the set too. But in this way we will keep the order of the elements. I will add a comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does it matter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well in this case it actually doesn't :) |
||||||||||||
|
||||||||||||
def check_for_time_limit(self, start_time): | ||||||||||||
evaluation_time_in_seconds = ( | ||||||||||||
datetime.datetime.now() - start_time | ||||||||||||
|
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 not just
?