-
Notifications
You must be signed in to change notification settings - Fork 57
Final Polishing core.py #396
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
base: develop
Are you sure you want to change the base?
Conversation
This will also address issue #371 |
def test_DeepTrackDataObject(self): | ||
dataobj = core.DeepTrackDataObject() | ||
|
||
# Test storing and validating data. | ||
# Test default inititialization |
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.
initialization
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.
Looks very good! I left a few comments on things that could be made even clearer
>>> child.is_valid((0,)) | ||
True | ||
>>> grandchild.is_valid((0,)) | ||
False | ||
|
||
Setting a value and automatic invalidation: |
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.
When reading this comment, I expect to see something about the automatic invalidation in the example. But it is not obvious to me which data is automatically invalidated
|
||
# Invalidate parent and check child validity. | ||
parent.invalidate() | ||
self.assertFalse(parent.is_valid()) | ||
self.assertFalse(child.is_valid()) | ||
self.assertFalse(grandchild.is_valid()) | ||
|
||
# Validate parent and ensure child is invalid until recomputation. |
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 think that "# Validate child. Parent and grandchild remain invalid until recompute." would be clearer here
child.validate() | ||
self.assertFalse(parent.is_valid()) | ||
self.assertTrue(child.is_valid()) | ||
self.assertFalse(grandchild.is_valid()) | ||
|
||
# Recompute child and check its validity |
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.
Here I would prefer "# Recompute grandchild and check its validity."
" ┌────────────┐ ┌────────────┐\n", | ||
" │ process1_B │ │ process2_B │\n", | ||
" └────────────┘ └────────────┘\n", | ||
" ↓ ↘ ↙ ↓\n", |
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 think that by removing 2 of the arrows in this row the figure would become clearer
No description provided.