CDAT / cdms

8 stars 10 forks source link

AttributeError with cdscan #397

Closed pochedls closed 4 years ago

pochedls commented 4 years ago

Describe the bug

cdscan failing with AttributeError: 'dict_keys' object has no attribute 'append'. This is affecting our ability to access a number of CESM files within CFMIP (since we are not able to produce xmls for the files).

It seems this was documented before and there may be a fix (here). If you'd like, I can attempt a pull request with a fix.

To Reproduce

cdscan -x test.xml /p/css03/esgf_publish/CMIP6/CFMIP/NCAR/CESM2/amip-4xCO2/r1i1p1f1/CFmon/clisccp/gn/v20200124/*.nc

Environment (please complete the following information):

Related Issues

Error

$ cdscan -x test.xml /p/css03/esgf_publish/CMIP6/CFMIP/NCAR/CESM2/amip-4xCO2/r1i1p1f1/CFmon/clisccp/gn/v20200124/*.nc Finding common directory ... Common directory: /p/css03/esgf_publish/CMIP6/CFMIP/NCAR/CESM2/amip-4xCO2/r1i1p1f1/CFmon/clisccp/gn/v20200124/ Scanning files ... /p/css03/esgf_publish/CMIP6/CFMIP/NCAR/CESM2/amip-4xCO2/r1i1p1f1/CFmon/clisccp/gn/v20200124/clisccp_CFmon_CESM2_amip-4xCO2_r1i1p1f1_gn_197901-201412.nc Traceback (most recent call last): File "/export_backup/pochedley1/bin/anaconda3/envs/cdat82/bin/cdscan", line 1842, in main(sys.argv) File "/export_backup/pochedley1/bin/anaconda3/envs/cdat82/bin/cdscan", line 1155, in main varnames.append(axisvar.id) AttributeError: 'dict_keys' object has no attribute 'append'

jasonb5 commented 4 years ago

@forsyth2 Looks like the cdscan script isn't 100% compatible with python 3.

pochedls commented 4 years ago

@forsyth2 & @jasonb5 - this is so helpful - thank you! Will this be included in the next CDAT release?

pochedls commented 4 years ago

Note also that you may be able to close #239 and #256.

jasonb5 commented 4 years ago

@pochedls No problem. This will be in CDAT 8.2.1. Thanks for the links!