Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
diegormsouza opened this issue May 24, 2021 · 2 comments · Fixed by #8
Closed

Comments

@diegormsouza
Copy link

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
Copy link
Owner

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

@diegormsouza
Copy link
Author

It works now! Thanks Alberto!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants