You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by Ibrahim Jarif <ja...@gmail.com> on 2016/04/24 22:30:37 UTC

[HELP] OCW - Improving Testing framework

Hello Developers,
I'll be working on improving the existing tests framework for the Apache
Open Climate Workbench over this summer.
My primary aim is to achieve 100% code coverage on unit tests for the OCW
module. The following data shows the current test coverage.

..........................................................................................................................................................................................................................................................................
Name                       Stmts   Miss  Cover   Missing
----------------------------------------------------------------------------------------------------------------------------------
ocw.py                         0      0   100%
ocw/data_source.py             0      0   100%
ocw/data_source/dap.py        22      0   100%
ocw/data_source/esgf.py       41     29    29%   80-105, 109-131, 135-141
ocw/data_source/local.py     248    174    30%   147-176, 231-240,
273, 276-279, 329-352, 378-422, 474-508, 541-572, 604-636
ocw/data_source/rcmed.py     125     12    90%   83, 206-209, 214-216, 242-245
ocw/dataset.py               152     24    84%   126-127, 146-147,
149, 152-162, 181, 191, 209-224, 368-379
ocw/dataset_processor.py     571    316    45%   53-105, 148-165,
194-196, 200-201, 222-229, 243-253, 263, 346-347, 356-363, 370-375,
430-435, 568-631, 644-659, 672-681, 696-699, 718-720, 727-729,
742-751, 875-889, 908-909, 942-952, 971-1068, 1071-1092, 1125-1196,
1215, 1231-1240
ocw/esgf.py                    0      0   100%
ocw/esgf/constants.py          6      0   100%
ocw/esgf/download.py          26     17    35%   35-37, 39, 41, 52-67
ocw/esgf/logon.py             10      5    50%   37-44
ocw/esgf/search.py            27     18    33%   41-47, 55-58, 64, 71, 78-86
ocw/evaluation.py            202     26    87%   120, 151-156,
184-189, 228-230, 259, 265, 338-346, 367-369, 388-390, 408-410,
429-431
ocw/metrics.py                58      0   100%
ocw/utils.py                 153     46    70%   47, 219-220, 227-229,
275, 294, 322-326, 356-362, 373-396, 407-422
-----------------------------------------------------------------------------------------------------------------------------------
TOTAL                       1641    667    59%
-----------------------------------------------------------------------------------------------------------------------------------


I'll be also developing smoke tests for the project.

I would love to have some feedback on what should be improved in the
testing framework and
what kind of tests should be added for smoke testing.

Thanks,
Ibrahim

Re: [HELP] OCW - Improving Testing framework

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Hi Ibrahim,
Thanks for coming on to the list with all of these questions.
Replies below.

On Fri, Apr 29, 2016 at 6:55 AM, Ibrahim Jarif <ja...@gmail.com>
wrote:

>
> I have downloaded the "January 2000 wrf output data" WRF file from here
> <http://www2.mmm.ucar.edu/wrf/users/download/test_data.html>. Is this the
> correct file?
>

I am honestly not sure as you've pointed to a landing page for several
files. Can you please be specific? The function level documentation states
"...containing 2D  fields such as precipitation and surface variables into
a Dataset. \ The dataset can be spatially subset."

If the file(s) you've picked satisfy that function description then it
should be fine. Unless you tell me which file you've picked then it is
impossible for me to tell.

Should I should use this file to test load_WRF function?
>

What file? You pointed to a landing page.


> I tried loading the downloaded WRF file using the load function but got
> `invalidNetCDF` file exception.
>

OK so please post an issue to Jira and we can discuss there. Thanks. Please
also include a link to the test file if appropriate.


>
> The size of this file was above 30mb and there are two more functions that
> require external files for testing. We should create mock datasets and
> objects to test these functions rather than downloading the entire files.
>

I agree.


> Can you or someone else please help me create mock objects to test some
> functions (like the one used in test_rcmed.py)?
>

Yes. Can you log an issue for this in Jira and we can discuss there.


>
> Is there some kind of netCDF viewer that I can use to view the netCDF
> files? I tried using "IDV netCDF viewer" but it was too cryptic for me to
> understand.
>

Yes there is. You can use http://www.giss.nasa.gov/tools/panoply/. It is a
really cool piece of software and will teach you a bunch about these
scientific coverage data formats.


>
> I have created an issue on JIRA
> <https://issues.apache.org/jira/browse/CLIMATE-786> that I found today
> and have a fix ready for it.
>

Yep I saw that . Good work. Thanks.


> I have also setup codecov <http://codecov.io/> to better analyze the
> coverage of unit tests.
>

Excellent. Please think about how these coverage results can be more easily
interpreted by the entire OCW team. Can we publish the results somewhere?
Can these stats fit into a CI scenario? Lets always keep that in mind
throughout the summer.


>
> Should I send the PR(s) right now or wait for the GSoC coding session to
> start and then send the PR(s)?
>

Right now if possible. As I sent you and the rest of the students, we are
in community bonding phase. Your code contributions are greatly appreciated
and we would highly encourage you to submit patches for anything you find.
Thanks.


> These PR(s) could be part of my GSoC project as they fix the unit tests
> and increase the coverage of tests. Will it be wrong if I
>

Nothing will be wrong. The more correspondence, interaction and consensus
you are able to reach with the OCW community the better. EVERYTHING you do
from now until you finish up GSoC will contribute towards your project so
please don;t worry.


>
> I tried accessing builds.apache.org via ssh but I couldn't.
>

No wonder. It is not available to non-admins via SSH.


> Could you please follow this link
> <http://wiki.apache.org/general/Jenkins#How_do_I_get_an_account>
> and grant me the access to ocwJenkins build?
>

DONE


> The configuration on Apache Jenkins might be different from the usual
> Jenkins configuration and I need to have a look. My username: jarifibrahim
> and email: jarifibrahim@gmail.com for Apache Builds.
>

DONE


>
> One last question. Should all these questions be on JIRA and not the
> mailing list? :D
>
>
> Here is fine for project related development conversation. For practical
development issues we typically use Jira however in time you will find what
works best for you.
Thanks
Lewis

Re: [HELP] OCW - Improving Testing framework

Posted by Ibrahim Jarif <ja...@gmail.com>.
Hi Lewis,
Thanks for the reply.

> 1. In ocw/data_source/local.load_WRF_2d_files
> > <
> https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L116
> >,
> > what are WRF files? Where can I download the WRF files to test this
> > function?
> >
> https://en.wikipedia.org/wiki/Weather_Research_and_Forecasting_Model
> You should be able to find something from there I would imagine. If anyone
> on this list is able to provide Ibrahim with a WRF file directly then
> please do.


I have downloaded the "January 2000 wrf output data" WRF file from here
<http://www2.mmm.ucar.edu/wrf/users/download/test_data.html>. Is this the
correct file? Should I should use this file to test load_WRF function? I
tried loading the downloaded WRF file using the load function but got
`invalidNetCDF` file exception.

The size of this file was above 30mb and there are two more functions that
require external files for testing. We should create mock datasets and
objects to test these functions rather than downloading the entire files.
Can you or someone else please help me create mock objects to test some
functions (like the one used in test_rcmed.py)?

Is there some kind of netCDF viewer that I can use to view the netCDF
files? I tried using "IDV netCDF viewer" but it was too cryptic for me to
understand.

I have created an issue on JIRA
<https://issues.apache.org/jira/browse/CLIMATE-786> that I found today and
have a fix ready for it.
I have also setup codecov <http://codecov.io/> to better analyze the
coverage of unit tests.

Should I send the PR(s) right now or wait for the GSoC coding session to
start and then send the PR(s)? These PR(s) could be part of my GSoC project
as they fix the unit tests and increase the coverage of tests. Will it be
wrong if I

I tried accessing builds.apache.org via ssh but I couldn't. Could you
please follow this link
<http://wiki.apache.org/general/Jenkins#How_do_I_get_an_account>
and grant me the access to ocwJenkins build? The configuration on Apache
Jenkins might be different from the usual Jenkins configuration and I need
to have a look. My username: jarifibrahim and email: jarifibrahim@gmail.com
for Apache Builds.

One last question. Should all these questions be on JIRA and not the
mailing list? :D

Thanks,
Ibrahim

On Thu, Apr 28, 2016 at 8:05 PM, Lewis John Mcgibbney <
lewis.mcgibbney@gmail.com> wrote:

> Forgot to CC dev@
>
> ---------- Forwarded message ----------
> From: Lewis John Mcgibbney <le...@gmail.com>
> Date: Thu, Apr 28, 2016 at 7:35 AM
> Subject: Re: [HELP] OCW - Improving Testing framework
> To: Ibrahim Jarif <ja...@gmail.com>
>
>
> Hi Ibrahim,
> CC'ing dev@,
>
> On Thu, Apr 28, 2016 at 12:09 AM, Ibrahim Jarif <ja...@gmail.com>
> wrote:
>
> > Hi Lewis,
> > For the past few days I've been reading the docs at
> > https://cwiki.apache.org/confluence/display/CLIMATE/Home and trying to
> > understand the project better.
> >
>
> Good.
>
>
> > I've figured out much of the stuff related to Continuous Integration but
> > I'm still struggling with the tests.
> >
>
> OK. I think you mean you've fingured out how CI will work but not what kind
> of CI is required right...!
>
>
> > Could you please answer the following questions and provide some
> > references for further reading (wherever possible)?
> >
> > 1. In ocw/data_source/local.load_WRF_2d_files
> > <
> https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L116
> >,
> > what are WRF files? Where can I download the WRF files to test this
> > function?
> >
>
> https://en.wikipedia.org/wiki/Weather_Research_and_Forecasting_Model
> You should be able to find something from there I would imagine. If anyone
> on this list is able to provide Ibrahim with a WRF file directly then
> please do.
>
>
> > 2. In ocw/data_source/local.load_NLDAS_forcingA_files
> > <
> https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L510>,
> what
> > are NLDAS2 forcingAWRF files? Where can I download them?
> >
>
> http://ldas.gsfc.nasa.gov/nldas/NLDAS2forcing.php
> Please do some research on this page. I looked for 2 minutes and can see
> some download links.
>
>
> > 3. In /ocw/data_source/local.load_GPM_IMERG_files
> > <
> https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L574
> >,
> > what are GPM Level 3 IMEGE files? Where can I download them?
> >
>
> http://pmm.nasa.gov/data-access/downloads/gpm
> i looked here for two minutes and there are downloads available from here.
>
>
> >
> > These functions are not covered by the existing Unit Tests and I'll have
> > to fix it. So I need to have a clear understanding of what they are and
> how
> > they work.
> >
> >
> Understood. Thanks. Please open Jira issues for everything you are working
> on. Your pull request commit messages should be exactly the Jira issue
> title this way the automated hooks will ensure all development and
> correspondence is shadowed over to the issue tracker.
> Thanks
> Lewis
>
>
>
> --
> *Lewis*
>

Fwd: [HELP] OCW - Improving Testing framework

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Forgot to CC dev@

---------- Forwarded message ----------
From: Lewis John Mcgibbney <le...@gmail.com>
Date: Thu, Apr 28, 2016 at 7:35 AM
Subject: Re: [HELP] OCW - Improving Testing framework
To: Ibrahim Jarif <ja...@gmail.com>


Hi Ibrahim,
CC'ing dev@,

On Thu, Apr 28, 2016 at 12:09 AM, Ibrahim Jarif <ja...@gmail.com>
wrote:

> Hi Lewis,
> For the past few days I've been reading the docs at
> https://cwiki.apache.org/confluence/display/CLIMATE/Home and trying to
> understand the project better.
>

Good.


> I've figured out much of the stuff related to Continuous Integration but
> I'm still struggling with the tests.
>

OK. I think you mean you've fingured out how CI will work but not what kind
of CI is required right...!


> Could you please answer the following questions and provide some
> references for further reading (wherever possible)?
>
> 1. In ocw/data_source/local.load_WRF_2d_files
> <https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L116>,
> what are WRF files? Where can I download the WRF files to test this
> function?
>

https://en.wikipedia.org/wiki/Weather_Research_and_Forecasting_Model
You should be able to find something from there I would imagine. If anyone
on this list is able to provide Ibrahim with a WRF file directly then
please do.


> 2. In ocw/data_source/local.load_NLDAS_forcingA_files
> <https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L510>, what
> are NLDAS2 forcingAWRF files? Where can I download them?
>

http://ldas.gsfc.nasa.gov/nldas/NLDAS2forcing.php
Please do some research on this page. I looked for 2 minutes and can see
some download links.


> 3. In /ocw/data_source/local.load_GPM_IMERG_files
> <https://github.com/apache/climate/blob/master/ocw/data_source/local.py#L574>,
> what are GPM Level 3 IMEGE files? Where can I download them?
>

http://pmm.nasa.gov/data-access/downloads/gpm
i looked here for two minutes and there are downloads available from here.


>
> These functions are not covered by the existing Unit Tests and I'll have
> to fix it. So I need to have a clear understanding of what they are and how
> they work.
>
>
Understood. Thanks. Please open Jira issues for everything you are working
on. Your pull request commit messages should be exactly the Jira issue
title this way the automated hooks will ensure all development and
correspondence is shadowed over to the issue tracker.
Thanks
Lewis



-- 
*Lewis*

Re: [HELP] OCW - Improving Testing framework

Posted by Ibrahim Jarif <ja...@gmail.com>.
Hi Lewis,
I've created a JiRA Issue for GSoC Project.
Here it is - CLIMATE-784 <https://issues.apache.org/jira/browse/CLIMATE-784>


Thanks,

On Wed, Apr 27, 2016 at 2:13 AM, Lewis John Mcgibbney <
lewis.mcgibbney@gmail.com> wrote:

> Hi Ibrahim,
> Thanks, can you please open a JIRA ticket for this?
> We can then use that as the main platform for carving this issue.
> If you could post your issue here for everyone's reference that would be
> ideal.
> Thanks
>
> On Sun, Apr 24, 2016 at 1:30 PM, Ibrahim Jarif <ja...@gmail.com>
> wrote:
>
>> Hello Developers,
>> I'll be working on improving the existing tests framework for the Apache
>> Open Climate Workbench over this summer.
>> My primary aim is to achieve 100% code coverage on unit tests for the OCW
>> module. The following data shows the current test coverage.
>>
>> ..........................................................................................................................................................................................................................................................................
>> Name                       Stmts   Miss  Cover   Missing
>> ----------------------------------------------------------------------------------------------------------------------------------
>> ocw.py                         0      0   100%
>> ocw/data_source.py             0      0   100%
>> ocw/data_source/dap.py        22      0   100%
>> ocw/data_source/esgf.py       41     29    29%   80-105, 109-131, 135-141
>> ocw/data_source/local.py     248    174    30%   147-176, 231-240, 273, 276-279, 329-352, 378-422, 474-508, 541-572, 604-636
>> ocw/data_source/rcmed.py     125     12    90%   83, 206-209, 214-216, 242-245
>> ocw/dataset.py               152     24    84%   126-127, 146-147, 149, 152-162, 181, 191, 209-224, 368-379
>> ocw/dataset_processor.py     571    316    45%   53-105, 148-165, 194-196, 200-201, 222-229, 243-253, 263, 346-347, 356-363, 370-375, 430-435, 568-631, 644-659, 672-681, 696-699, 718-720, 727-729, 742-751, 875-889, 908-909, 942-952, 971-1068, 1071-1092, 1125-1196, 1215, 1231-1240
>> ocw/esgf.py                    0      0   100%
>> ocw/esgf/constants.py          6      0   100%
>> ocw/esgf/download.py          26     17    35%   35-37, 39, 41, 52-67
>> ocw/esgf/logon.py             10      5    50%   37-44
>> ocw/esgf/search.py            27     18    33%   41-47, 55-58, 64, 71, 78-86
>> ocw/evaluation.py            202     26    87%   120, 151-156, 184-189, 228-230, 259, 265, 338-346, 367-369, 388-390, 408-410, 429-431
>> ocw/metrics.py                58      0   100%
>> ocw/utils.py                 153     46    70%   47, 219-220, 227-229, 275, 294, 322-326, 356-362, 373-396, 407-422
>> -----------------------------------------------------------------------------------------------------------------------------------
>> TOTAL                       1641    667    59%
>> -----------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> I'll be also developing smoke tests for the project.
>>
>> I would love to have some feedback on what should be improved in the
>> testing framework and
>> what kind of tests should be added for smoke testing.
>>
>> Thanks,
>> Ibrahim
>>
>
>
>
> --
> *Lewis*
>

Re: [HELP] OCW - Improving Testing framework

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Hi Ibrahim,
Thanks, can you please open a JIRA ticket for this?
We can then use that as the main platform for carving this issue.
If you could post your issue here for everyone's reference that would be
ideal.
Thanks

On Sun, Apr 24, 2016 at 1:30 PM, Ibrahim Jarif <ja...@gmail.com>
wrote:

> Hello Developers,
> I'll be working on improving the existing tests framework for the Apache
> Open Climate Workbench over this summer.
> My primary aim is to achieve 100% code coverage on unit tests for the OCW
> module. The following data shows the current test coverage.
>
> ..........................................................................................................................................................................................................................................................................
> Name                       Stmts   Miss  Cover   Missing
> ----------------------------------------------------------------------------------------------------------------------------------
> ocw.py                         0      0   100%
> ocw/data_source.py             0      0   100%
> ocw/data_source/dap.py        22      0   100%
> ocw/data_source/esgf.py       41     29    29%   80-105, 109-131, 135-141
> ocw/data_source/local.py     248    174    30%   147-176, 231-240, 273, 276-279, 329-352, 378-422, 474-508, 541-572, 604-636
> ocw/data_source/rcmed.py     125     12    90%   83, 206-209, 214-216, 242-245
> ocw/dataset.py               152     24    84%   126-127, 146-147, 149, 152-162, 181, 191, 209-224, 368-379
> ocw/dataset_processor.py     571    316    45%   53-105, 148-165, 194-196, 200-201, 222-229, 243-253, 263, 346-347, 356-363, 370-375, 430-435, 568-631, 644-659, 672-681, 696-699, 718-720, 727-729, 742-751, 875-889, 908-909, 942-952, 971-1068, 1071-1092, 1125-1196, 1215, 1231-1240
> ocw/esgf.py                    0      0   100%
> ocw/esgf/constants.py          6      0   100%
> ocw/esgf/download.py          26     17    35%   35-37, 39, 41, 52-67
> ocw/esgf/logon.py             10      5    50%   37-44
> ocw/esgf/search.py            27     18    33%   41-47, 55-58, 64, 71, 78-86
> ocw/evaluation.py            202     26    87%   120, 151-156, 184-189, 228-230, 259, 265, 338-346, 367-369, 388-390, 408-410, 429-431
> ocw/metrics.py                58      0   100%
> ocw/utils.py                 153     46    70%   47, 219-220, 227-229, 275, 294, 322-326, 356-362, 373-396, 407-422
> -----------------------------------------------------------------------------------------------------------------------------------
> TOTAL                       1641    667    59%
> -----------------------------------------------------------------------------------------------------------------------------------
>
>
> I'll be also developing smoke tests for the project.
>
> I would love to have some feedback on what should be improved in the
> testing framework and
> what kind of tests should be added for smoke testing.
>
> Thanks,
> Ibrahim
>



-- 
*Lewis*