JCSDA-internal / ioda-converters

Various converters for getting obs data in and out of IODA
9 stars 4 forks source link

Coding style error in marine convert scripts #282

Closed srherbener closed 4 years ago

srherbener commented 4 years ago

@gthompsnJCSDA got the following error when running ctest:

3/29 Testing: iodaconv_marine_coding_norms

3/29 Test: iodaconv_marine_coding_norms

Command: "/data/users/gthompsn/JEDI/build/build_ioda-converters/bin/iodaconv_lint.sh" "/data/users/gthompsn/JEDI/src/ioda-converters/src/marine" "/data/users/gthompsn/JEDI/src/ioda-converters"

Directory: /data/users/gthompsn/JEDI/build/build_ioda-converters/src/marine

"iodaconv_marine_coding_norms" start time: Jun 03 18:20 UTC

Output:

----------------------------------------------------------

+ SRC_DIR=/data/users/gthompsn/JEDI/src/ioda-converters/src/marine

+ PYCODESTYLE_CFG_PATH=/data/users/gthompsn/JEDI/src/ioda-converters

+ cd /data/users/gthompsn/JEDI/src/ioda-converters/src/marine

+ pycodestyle -v --config=/data/users/gthompsn/JEDI/src/ioda-converters/.pycodestyle '--filename=*.py,*.py.in' .

cli configuration: /data/users/gthompsn/JEDI/src/ioda-converters/.pycodestyle

directory .

checking ./argoClim2ioda.py.in

checking ./cryosat_ice2ioda.py.in

checking ./cryosat_ice2ioda_DBL.py.in

checking ./emc_ice2ioda.py.in

checking ./gds2_sst2ioda.py.in

checking ./gmao_obs2ioda.py.in

checking ./godae_profile2ioda.py.in

./godae_profile2ioda.py.in:198:21: E741 ambiguous variable name 'l'

checking ./godae_ship2ioda.py.in

checking ./godae_trak2ioda.py.in

checking ./hgodas_adt2ioda.py.in

checking ./hgodas_insitu2ioda.py.in

checking ./hgodas_sst2ioda.py.in

checking ./rads_adt2ioda.py.in

checking ./smap_sss2ioda.py.in

checking ./viirs_modis_oc2ioda.py.in

1       E741 ambiguous variable name 'l'

<end of output>

Test time =   0.81 sec

----------------------------------------------------------

Test Failed.

"iodaconv_marine_coding_norms" end time: Jun 03 18:20 UTC

"iodaconv_marine_coding_norms" time elapsed: 00:00:00

----------------------------------------------------------

It seems that this has surfaced due to a newer version of pycodestyle. The iodaconv_marine_coding_norms test passes on my iMac. I've got version 2.5.0 of pycodestyle installed, and @gthompsnJCSDA is using version 2.6.0.

flampouris commented 4 years ago

Hi @srherbener

we have the same issue with the ncepclasses and the chem should have the same issue, but I do not think that we check the norms for it. @YanHao-NOAA 's PR #204 is failing the travis-ci for the same reason.

Do you have any suggestions?

srherbener commented 4 years ago

I've verified that the error that is being flagged is a new check (E741) that got introduced between version 2.5.0 and 2.6.0 (latest) of pycodestyle.

This E741 check is flagging variable names that are single letters that can be confused with numerical digits. I'm guessing in this case the variable 'l' (lower case ell) is being flagged because it looks like the digit 1 (one).

I think this is a reasonable check to have and since there is only one place in all of the python converters where this error comes up, we should fix godae_profile2ioda.py.in.

I'm working on that now and should have a PR soon.