Description was changed from ========== Simulation controller (shell arguments parser and simulation runner) and libraries ...
3 years, 10 months ago
(2017-02-24 12:46:43 UTC)
#1
Description was changed from
==========
Simulation controller (shell arguments parser and simulation runner) and
libraries (data access, noise generators, evaluation scores).
Execution flag added to the .py and .sh scripts.
BUILD.gn files adapted (see :lib), APM config files moved.
BUG=webrtc:7218
==========
to
==========
Simulation controller (shell arguments parser and simulation runner) and
libraries (data access, noise generators, evaluation scores).
Execution flag added to the .py and .sh scripts.
BUILD.gn files adapted (see :lib), APM config files moved.
BUG=webrtc:7218
==========
Simulation controller (shell arguments parser and simulation runner) and libraries (data access, noise generators, evaluation ...
3 years, 10 months ago
(2017-02-24 12:52:42 UTC)
#3
Simulation controller (shell arguments parser and simulation runner) and
libraries (data access, noise generators, evaluation scores).
Everything starts with the apm_quality_assessment.sh bash script which calls
apm_quality_assessment.py (the new entry).
The latter parses the command line arguments and runs the simulator, which
iterates over a number of parameter sets (e.g., noise generators, APM
configurations).
The list of noise generators and evaluation scores is generated by a decorator
that register each class.
This is used to know the command line argument values for the corresponding
options.
Note that I added TODO comments for the part that are not implemented.
Ignore presubmit message with type "missing-super-argument", they are raised
only because I'm using Python 3 (while the linter is tuned for Python 2).
ivoc
Very nice! I don't write/review python code very often, so there were some points that ...
3 years, 10 months ago
(2017-02-24 14:41:48 UTC)
#4
Thanks a lot for your comments. @Ivo: yes, I should definitely start writing unit tests, ...
3 years, 9 months ago
(2017-02-27 14:23:47 UTC)
#6
Thanks a lot for your comments.
@Ivo: yes, I should definitely start writing unit tests, at least for those
parts that can easily break :)
As for having multiple classes in a single file, consider that in Python files
(not only directories) are seen as modules.
In fact the linter never complained.
On 2017/03/01 23:48:09, aleloi2 wrote: > On 2017/03/01 22:51:29, ivoc wrote: > > Nice work, ...
3 years, 9 months ago
(2017-03-02 00:25:58 UTC)
#12
On 2017/03/01 23:48:09, aleloi2 wrote:
> On 2017/03/01 22:51:29, ivoc wrote:
> > Nice work, lgtm. You will need to get a lgtm from one of the
audio_processing
> > owners before you can land this.
> >
> >
>
https://codereview.webrtc.org/2715943002/diff/1/webrtc/modules/audio_processi...
> > File
> >
>
webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
> > (right):
> >
> >
>
https://codereview.webrtc.org/2715943002/diff/1/webrtc/modules/audio_processi...
> >
>
webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py:1:
> > #!/usr/bin/env python3
> > On 2017/03/01 09:07:12, AleBzk wrote:
> > > On 2017/02/24 14:41:47, ivoc wrote:
> > > > Why is this is some python files but not in some others?
> > >
> > > Thanks for asking. As documented in our style guide
> > >
> >
>
(https://google.github.io/styleguide/pyguide.html?showone=Shebang_Line#Shebang...),
> > > it's only needed for those script that run from shell. That's why you
don't
> > find
> > > that line in the quality_assessment package.
> >
> > Acknowledged.
>
> The tests can be added to PRESUBMIT.py so that they are run every time
something
> changes. Here's how to do that:
> https://codereview.webrtc.org/1999113002/diff/460001/PRESUBMIT.py
Can you rebase this on top of https://codereview.webrtc.org/2711923002/? It must
be done in order to land this CL anyway, and it's easier to see what has changed
this way.
ivoc
On 2017/03/02 00:25:58, aleloi2 wrote: > On 2017/03/01 23:48:09, aleloi2 wrote: > > On 2017/03/01 ...
3 years, 9 months ago
(2017-03-02 00:36:48 UTC)
#13
On 2017/03/02 00:25:58, aleloi2 wrote:
> On 2017/03/01 23:48:09, aleloi2 wrote:
> > On 2017/03/01 22:51:29, ivoc wrote:
> > > Nice work, lgtm. You will need to get a lgtm from one of the
> audio_processing
> > > owners before you can land this.
> > >
> > >
> >
>
https://codereview.webrtc.org/2715943002/diff/1/webrtc/modules/audio_processi...
> > > File
> > >
> >
>
webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
> > > (right):
> > >
> > >
> >
>
https://codereview.webrtc.org/2715943002/diff/1/webrtc/modules/audio_processi...
> > >
> >
>
webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py:1:
> > > #!/usr/bin/env python3
> > > On 2017/03/01 09:07:12, AleBzk wrote:
> > > > On 2017/02/24 14:41:47, ivoc wrote:
> > > > > Why is this is some python files but not in some others?
> > > >
> > > > Thanks for asking. As documented in our style guide
> > > >
> > >
> >
>
(https://google.github.io/styleguide/pyguide.html?showone=Shebang_Line#Shebang...),
> > > > it's only needed for those script that run from shell. That's why you
> don't
> > > find
> > > > that line in the quality_assessment package.
> > >
> > > Acknowledged.
> >
> > The tests can be added to PRESUBMIT.py so that they are run every time
> something
> > changes. Here's how to do that:
> > https://codereview.webrtc.org/1999113002/diff/460001/PRESUBMIT.py
>
> Can you rebase this on top of https://codereview.webrtc.org/2711923002/ It
must
> be done in order to land this CL anyway, and it's easier to see what has
changed
> this way.
One extra comment that applies to this and your other CLs as well, please add a
one-line summary at the top of your CL description, with a blank line to
separate it from the summary.
Hi, thanks to both of you for your comments. Everything has been addressed. You can ...
3 years, 9 months ago
(2017-03-02 09:58:38 UTC)
#16
Hi, thanks to both of you for your comments.
Everything has been addressed. You can see my replies to each comment below.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
File
webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
(right):
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py:70:
logging.basicConfig(level=logging.DEBUG)
On 2017/03/02 01:14:03, aleloi2 wrote:
> Interesting! I didn't know about the logging system.
Done.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
File webrtc/modules/audio_processing/test/py_quality_assessment/output/README.md
(right):
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/output/README.md:1:
You can use this folder for the output generated by the apm_quality_assessment
scripts.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Perhaps this should be made the default output folder then? In the latest
> version, argparse has a required argument for the output folder.
Nice idea! Thanks!
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/output/README.md:1:
You can use this folder for the output generated by the apm_quality_assessment
scripts.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Perhaps this should be made the default output folder then? In the latest
> version, argparse has a required argument for the output folder.
Done.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
File
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py
(right):
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py:13:
Makes a directory (recursively) and hides OSError exceptions.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Why should OSError be hidden? I can't understand this from the usage in
> simulation.py
Premise: in my tool I implicitly implemented checkpoints and cache, so a run may
reuse data from a previous one.
Answer: the directory might already exist, just wanted to avoid code duplication
every time I add directories.
To improve readability and avoid issues with missing write permissions, I
explicitly check if the directory already exists and just return if so.
Thanks for this comment!
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py:13:
Makes a directory (recursively) and hides OSError exceptions.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Why should OSError be hidden? I can't understand this from the usage in
> simulation.py
Done.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
File
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py
(right):
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py:45:
Compute the POLQA score. It requires that the POLQA_PATH environment variable
On 2017/03/02 01:14:03, aleloi2 wrote:
> Can it be checked at construction that POLQUA_PATH is defined and perhaps that
> it's a valid path? Following a guideline that errors should be detected as
early
> as possible. It's just a suggestion, doesn't have to be like that.
Reminding best practices is always appreciated. Thanks!
The code is not there yet, I have another CL which implements the POLQA score.
I will do the check you suggest in there.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py:45:
Compute the POLQA score. It requires that the POLQA_PATH environment variable
On 2017/03/02 01:14:03, aleloi2 wrote:
> Can it be checked at construction that POLQUA_PATH is defined and perhaps that
> it's a valid path? Following a guideline that errors should be detected as
early
> as possible. It's just a suggestion, doesn't have to be like that.
Acknowledged.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
File
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py
(right):
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:22:
# TODO(alessio): instance when implementation is ready.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Sorry, I don't understand this comment. Does it mean to fix the '=None' below?
> They are initialized in '.run()', right?
Sorry for not being clear here.
This CL still misses two classes that will come in separate CLs.
The two members should be initialized in the constructor, but for now I set them
to None.
If you check, they're not used (yet).
I won't change the comment to keep it compact and because it is removed in
another CL.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:22:
# TODO(alessio): instance when implementation is ready.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Sorry, I don't understand this comment. Does it mean to fix the '=None' below?
> They are initialized in '.run()', right?
Acknowledged.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:35:
Initializes paths and required instances before running all the simulations.
On 2017/03/02 01:14:03, aleloi2 wrote:
> Perhaps add 'Then runs the simulations.'
Done.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:41:
self._NOISE_GENERATOR_CLASSES[name]() for name in noise_generator_names]
On 2017/03/02 01:14:03, aleloi2 wrote:
> A key error happens if a user passes a wrong name, right? Is that the
intention?
Yes and no :)
The client code should handle the exception.
But if you look in apm_quality_assessment.py there is not try/except.
That's because argparse is already taking care of accepting only valid input.
If there is any best practice I should follow (e.g., handling the KeyError
exception anyways), just let me know and I'll patch in a separate CL.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:41:
self._NOISE_GENERATOR_CLASSES[name]() for name in noise_generator_names]
On 2017/03/02 01:14:03, aleloi2 wrote:
> A key error happens if a user passes a wrong name, right? Is that the
intention?
Acknowledged.
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:72:
On 2017/03/02 01:14:03, aleloi2 wrote:
> I think we can consider using itertools.product here to have less layers of
> nesting. Less nesting makes it simpler to read and easier to spot bugs.
True. I usually go for that option, I hate 45 degrees coding.
I took note of this and will write a separate CL to rewrite all the nested
loops.
Thanks!
https://codereview.webrtc.org/2715943002/diff/100001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py:72:
On 2017/03/02 01:14:03, aleloi2 wrote:
> I think we can consider using itertools.product here to have less layers of
> nesting. Less nesting makes it simpler to read and easier to spot bugs.
Acknowledged.
AleBzk
Description was changed from ========== Simulation controller (shell arguments parser and simulation runner) and libraries ...
3 years, 9 months ago
(2017-03-02 10:00:20 UTC)
#17
Description was changed from
==========
Simulation controller (shell arguments parser and simulation runner) and
libraries (data access, noise generators, evaluation scores).
Execution flag added to the .py and .sh scripts.
BUILD.gn files adapted (see :lib), APM config files moved.
BUG=webrtc:7218
==========
to
==========
Simulation controller (shell arguments parser and simulation runner) and
libraries (data access, noise generators, evaluation scores).
Execution flag added to the .py and .sh scripts.
BUILD.gn files adapted (see :lib), APM config files moved.
BUG=webrtc:7218
NOTRY=True
==========
AleBzk
The CQ bit was checked by alessiob@webrtc.org
3 years, 9 months ago
(2017-03-02 13:44:38 UTC)
#18
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/14371)
3 years, 9 months ago
(2017-03-02 13:47:56 UTC)
#22
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/14376)
3 years, 9 months ago
(2017-03-02 14:41:04 UTC)
#27
Issue 2715943002: APM Quality Assessment, simulation controller and libraries
(Closed)
Created 3 years, 10 months ago by AleBzk
Modified 3 years, 9 months ago
Reviewers: ivoc, aleloi2
Base URL:
Comments: 35