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

Program croaks when acquiring "forecast" data with "--humanize" and "--show-ids" options #6

Closed
amotl opened this issue Dec 29, 2020 · 1 comment

Comments

@amotl
Copy link
Contributor

amotl commented Dec 29, 2020

Hi there,

phenodata currently croaks when trying to acquire forecast data when using both the --humanize and --show-ids options.

phenodata forecast \
    --source=dwd --dataset=immediate --partition=recent --language=german \
    --species-preset=mellifera-de-primary --station=Müncheberg,Oberspiesheim --phase-id=5,7 \
    --humanize --show-ids
Traceback (most recent call last):
  File "/Users/amo/Library/Caches/pypoetry/virtualenvs/grafana-pandas-datasource-41rstjPg-py3.9/bin/phenodata", line 33, in <module>
    sys.exit(load_entry_point('phenodata', 'console_scripts', 'phenodata')())
  File "/path/to/phenodata/phenodata/command.py", line 165, in run
    data = client.get_forecast(options, forecast_year=options['forecast-year'], humanize=options['humanize'])
  File "/path/to/phenodata/phenodata/dwd/pheno.py", line 258, in get_forecast
    forecast = self.humanizer.get_forecast(megaframe, target_year=target_year)
  File "/path/to/phenodata/phenodata/dwd/pheno.py", line 518, in get_forecast
    stations, species, phases, quality_levels, quality_bytes = self.get_fields(frame)
  File "/path/to/phenodata/phenodata/dwd/pheno.py", line 574, in get_fields
    station_label += ' [{}]'.format(row['Stations_id'])
  File "/Users/amo/Library/Caches/pypoetry/virtualenvs/grafana-pandas-datasource-41rstjPg-py3.9/lib/python3.9/site-packages/pandas/core/series.py", line 882, in __getitem__
    return self._get_value(key)
  File "/Users/amo/Library/Caches/pypoetry/virtualenvs/grafana-pandas-datasource-41rstjPg-py3.9/lib/python3.9/site-packages/pandas/core/series.py", line 990, in _get_value
    loc = self.index.get_loc(label)
  File "/Users/amo/Library/Caches/pypoetry/virtualenvs/grafana-pandas-datasource-41rstjPg-py3.9/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
    raise KeyError(key) from err
KeyError: 'Stations_id'

With kind regards,
Andreas.

@amotl
Copy link
Contributor Author

amotl commented Jan 6, 2021

This has been filed at the wrong place, sorry for that. I've now created the issue at earthobservations/phenodata#6.

@amotl amotl closed this as completed Jan 6, 2021
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

No branches or pull requests

1 participant