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

Open
amotl opened this issue Jan 6, 2021 · 0 comments

Comments

@amotl
Copy link
Member

amotl commented Jan 6, 2021

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.

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