-
Notifications
You must be signed in to change notification settings - Fork 51
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
[MPQEditor] Update MPQCircleSelector for visq processing #1549
Conversation
This commit updates MPQCircleSelector for visq processing. ONE-vscode-DCO-1.0-Signed-off-by: s.malakhov <[email protected]>
|
||
// check whether _visqData pretend to be valid | ||
if (!("error" in this._visqData) || !("meta" in this._visqData)) { | ||
this.onInvalidVISQData(visqPath); |
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.
Q. What to you mean by 'pretend to be valid' here..?
This condition says that there is one "error" or one "meta" or none of them. It only excludes the case that both "error" and "meta" inside the json, so...?
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 condition says, that _visqData
should contain error
section and meta
section, otherwise (doesn't contain error
or doesn't contain meta
) it is treated as invalid.
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 condition was meant to prevent user from loading other file, so it is very simple.
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.
@dayo09
The simplest form for _visqData to be valid is that it contains both "error" and "meta", otherwise it can be treated as invalid.
So negation of
("error" in _visqData) and ("meta" in _visqData)
gives us
("eror" isn't in _visqData) or ("meta" isn't in _visqData)
i.e. if _visqData doesn't contain either "error" or "meta" it can be treated as invalid.
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.
@dayo09
Do i need to remove this condition for now?
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.
Aha... I didn't know that. What I thought was: if it includes 'error', than isn't it 'invalid' itself?
The simplest form for _visqData to be valid is that it contains both "error" and "meta"
If so, I think if you make a function that describes the assumption, it will be easy to understand.!
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.
Aha... I didn't know that. What I thought was: if it includes 'error', than isn't it 'invalid' itself?
No. It's valid. Valid visq.json
file should contain error
along with meta
section at least.
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.
Ah, sorry that now I understand it. So 'Error' is the error ratio. I thought it's a problematic log. Thanks for the explanation.
@seanshpark PTAL :-D |
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.
LGTM
This commit updates MPQCircleSelector for visq processing.
Its correctness is tested in #1543
Fresh draft: #1543
Full draft: #1505
Related: #1491
ONE-vscode-DCO-1.0-Signed-off-by: s.malakhov [email protected]