albertotb / get-gfs

Downloading meteorological information from GFS
MIT License
55 stars 26 forks source link

AttributeError: '<class 'pydap.model.StructureType'>' object has no attribute 'shape' #7

Closed diegormsouza closed 3 years ago

diegormsouza commented 3 years ago

Dear Alberto,

Could you please help with the following? When testing the real time server script (get_gfs.py) the data is downloaded without any problems.

However, when testing the script for the historical data (get_gfs_hist.py), with the following instruction:

(get-gfs) D:\VLAB\GFS\get-gfs-master>python get_gfs_hist.py -t 0 10 -x -10 10 -y -10 10 -c example_conf_hist.json 20191005 00 -v

I'm getting the following error, related to the 'shape' attribute. Have you ever seen this error? I tried to update the pydap library, but I'm getting the same error.

Thanks in advance!

Regards,

Diego Souza

[20191005 00] AttributeError: '<class 'pydap.model.StructureType'>' object has no attribute 'shape'
Traceback (most recent call last):
  File "D:\Users\dsouza\miniconda3\envs\get-gfs\lib\site-packages\pydap\model.py", line 382, in __getattr__
    return self[attr]
  File "D:\Users\dsouza\miniconda3\envs\get-gfs\lib\site-packages\pydap\model.py", line 425, in __getitem__
    return self._getitem_string(key)
  File "D:\Users\dsouza\miniconda3\envs\get-gfs\lib\site-packages\pydap\model.py", line 404, in _getitem_string
    return self._dict[quote(key)]
KeyError: 'shape'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Users\dsouza\miniconda3\envs\get-gfs\lib\site-packages\pydap\model.py", line 235, in __getattr__
    return self.attributes[attr]
KeyError: 'shape'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\VLAB\GFS\get-gfs-master\get_gfs_hist.py", line 233, in main
    save_dataset(hour, date, var_config, args.time, args.lat, args.lon, fname, verbose=args.verbose)
  File "D:\VLAB\GFS\get-gfs-master\get_gfs_hist.py", line 170, in save_dataset
    data_list = [get_general(file, time, var_config, lat_idx,
  File "D:\VLAB\GFS\get-gfs-master\get_gfs_hist.py", line 170, in <listcomp>
    data_list = [get_general(file, time, var_config, lat_idx,
  File "D:\VLAB\GFS\get-gfs-master\get_gfs_hist.py", line 105, in get_general
    var_data = [ pd.DataFrame((np.concatenate((var_w.data, var_e.data),
  File "D:\VLAB\GFS\get-gfs-master\get_gfs_hist.py", line 106, in <listcomp>
    axis=len(var_w.shape)-1)
  File "D:\Users\dsouza\miniconda3\envs\get-gfs\lib\site-packages\pydap\model.py", line 384, in __getattr__
    return DapType.__getattr__(self, attr)
  File "D:\Users\dsouza\miniconda3\envs\get-gfs\lib\site-packages\pydap\model.py", line 237, in __getattr__
    raise AttributeError(
AttributeError: '<class 'pydap.model.StructureType'>' object has no attribute 'shape'
albertotb commented 3 years ago

This should be fixed in the last master version. Please try it now

diegormsouza commented 3 years ago

It works now! Thanks Alberto!