Skip to content

Fix Quality Report reproducibility #562

Merged
vmarkovtsev merged 3 commits intosrc-d:masterfrom
zurk:expected_vnode
Feb 9, 2019
Merged

Fix Quality Report reproducibility #562
vmarkovtsev merged 3 commits intosrc-d:masterfrom
zurk:expected_vnode

Conversation

@zurk
Copy link
Copy Markdown
Contributor

@zurk zurk commented Jan 29, 2019

Based on PR #517.
Closes #557.

@zurk zurk force-pushed the expected_vnode branch 3 times, most recently from 08d6358 to bdee1cc Compare January 30, 2019 16:38
@zurk
Copy link
Copy Markdown
Contributor Author

zurk commented Jan 30, 2019

So, I manage to make it work but I restart bblfshd each time by scripts. Pros: it is automatic. Cons: Can not run inside a regular container (docker is required). I think it is fine for such tools.
I am going to run it for the night on my PC.

@zurk zurk force-pushed the expected_vnode branch 7 times, most recently from ce9531d to f77b802 Compare February 1, 2019 14:37
zurk added a commit to zurk/lookout-sdk-ml that referenced this pull request Feb 1, 2019
I need this fix src-d/lookout#409
to make this PR work: src-d/style-analyzer#562
zurk added a commit to zurk/lookout-sdk-ml that referenced this pull request Feb 1, 2019
I need this fix src-d/lookout#409
to make this PR work: src-d/style-analyzer#562

Signed-off-by: Konstantin Slavnov <konstantin@sourced.tech>
zurk added a commit to zurk/lookout-sdk-ml that referenced this pull request Feb 1, 2019
I need this fix src-d/lookout#409
to make this PR work: src-d/style-analyzer#562

Signed-off-by: Konstantin Slavnov <konstantin@sourced.tech>
@zurk zurk force-pushed the expected_vnode branch 5 times, most recently from 5fd50a6 to 131a01b Compare February 1, 2019 15:37
zurk added a commit to zurk/lookout-sdk-ml that referenced this pull request Feb 1, 2019
I need this fix src-d/lookout#409
to make this PR work: src-d/style-analyzer#562

Signed-off-by: Konstantin Slavnov <konstantin@sourced.tech>
@zurk
Copy link
Copy Markdown
Contributor Author

zurk commented Feb 1, 2019

🎉
ready for review

@zurk zurk changed the title Add utility to collect number of vnodes during training Fix Quality Report reproducibility Feb 5, 2019
@zurk
Copy link
Copy Markdown
Contributor Author

zurk commented Feb 6, 2019

addressed.

def get_vnodes_number(repository: str, from_commit: str, to_commit: str, port: int,
bblfsh: Optional[str]) -> int:
"""
Get expected vnodes number for a repository.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Get expected vnodes number for a repository.
Calculate the number of expected vnodes for a repository.

vnodes_parsed_number = sum(len(vn) for vn, _, _ in parsed_files)
self._log.debug("Parsed %d vnodes", vnodes_parsed_number)
if self.vnodes_number_callback is not None:
self.vnodes_number_callback(vnodes_parsed_number)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to split extract_features into several functions and you will not have to add this callback. Stay tuned.

@vmarkovtsev
Copy link
Copy Markdown
Collaborator

@zurk Once we merge #589 you will be able to

original_files_to_xy = FeatureExtractor._files_to_xy

def hacked_files_to_xy(self, parsed_files):
    vnodes_parsed_number = sum(len(vn) for vn, _, _ in parsed_files)
    # do whatever with it
    return original_files_to_xy(self, parsed_files)

FeatureExtractor._files_to_xy = hacked_files_to_xy

@zurk
Copy link
Copy Markdown
Contributor Author

zurk commented Feb 7, 2019

Good!

zurk added 3 commits February 8, 2019 19:37
Signed-off-by: Konstantin Slavnov <konstantin@sourced.tech>
Signed-off-by: Konstantin Slavnov <konstantin@sourced.tech>
Signed-off-by: Konstantin Slavnov <konstantin@sourced.tech>
@zurk
Copy link
Copy Markdown
Contributor Author

zurk commented Feb 8, 2019

@vmarkovtsev done.

Copy link
Copy Markdown
Collaborator

@vmarkovtsev vmarkovtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool

@vmarkovtsev vmarkovtsev merged commit efabfb7 into src-d:master Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants