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

Fix: sort dataset keys in error message when importing non-existing dataset #2497

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

lostella
Copy link
Contributor

Description of changes: It's hard to hunt down the dataset you're looking for if the list is not sorted.

For example, when trying to load the solar_dataset with underscore instead of hyphen, you get (using single backticks to get the output wrapped over multiple lines)

AssertionError: solar_energy is not present, please choose one from dict_keys(['constant', 'exchange_rate', 'solar-energy', 'electricity', 'traffic', 'exchange_rate_nips', 'electricity_nips', 'traffic_nips', 'solar_nips', 'wiki-rolling_nips', 'taxi_30min', 'kaggle_web_traffic_with_missing', 'kaggle_web_traffic_without_missing', 'kaggle_web_traffic_weekly', 'm1_yearly', 'm1_quarterly', 'm1_monthly', 'nn5_daily_with_missing', 'nn5_daily_without_missing', 'nn5_weekly', 'tourism_monthly', 'tourism_quarterly', 'tourism_yearly', 'cif_2016', 'london_smart_meters_without_missing', 'wind_farms_without_missing', 'car_parts_without_missing', 'dominick', 'fred_md', 'pedestrian_counts', 'hospital', 'covid_deaths', 'kdd_cup_2018_without_missing', 'weather', 'm3_monthly', 'm3_quarterly', 'm3_yearly', 'm3_other', 'm4_hourly', 'm4_daily', 'm4_weekly', 'm4_monthly', 'm4_quarterly', 'm4_yearly', 'm5', 'uber_tlc_daily', 'uber_tlc_hourly', 'airpassengers']).

while with this fix you get

AssertionError: solar_energy is not present, please choose one from ['airpassengers', 'car_parts_without_missing', 'cif_2016', 'constant', 'covid_deaths', 'dominick', 'electricity', 'electricity_nips', 'exchange_rate', 'exchange_rate_nips', 'fred_md', 'hospital', 'kaggle_web_traffic_weekly', 'kaggle_web_traffic_with_missing', 'kaggle_web_traffic_without_missing', 'kdd_cup_2018_without_missing', 'london_smart_meters_without_missing', 'm1_monthly', 'm1_quarterly', 'm1_yearly', 'm3_monthly', 'm3_other', 'm3_quarterly', 'm3_yearly', 'm4_daily', 'm4_hourly', 'm4_monthly', 'm4_quarterly', 'm4_weekly', 'm4_yearly', 'm5', 'nn5_daily_with_missing', 'nn5_daily_without_missing', 'nn5_weekly', 'pedestrian_counts', 'solar-energy', 'solar_nips', 'taxi_30min', 'tourism_monthly', 'tourism_quarterly', 'tourism_yearly', 'traffic', 'traffic_nips', 'uber_tlc_daily', 'uber_tlc_hourly', 'weather', 'wiki-rolling_nips', 'wind_farms_without_missing'].

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

@lostella lostella added the enhancement New feature or request label Dec 15, 2022
@lostella lostella enabled auto-merge (squash) December 15, 2022 14:04
@lostella lostella merged commit 3231271 into awslabs:dev Dec 15, 2022
@lostella lostella added the pending v0.11.x backport This contains a fix to be backported to the v0.11.x branch label Dec 19, 2022
@lostella lostella deleted the fix-repo-error-message branch December 20, 2022 08:25
lostella added a commit to lostella/gluonts that referenced this pull request Dec 20, 2022
@lostella lostella mentioned this pull request Dec 20, 2022
lostella added a commit that referenced this pull request Dec 20, 2022
* Fix dataclass handling of member inheritance. (#2492)

* Fix: sort dataset keys in error message when importing non-existing dataset (#2497)

Co-authored-by: Lorenzo Stella <[email protected]>
Co-authored-by: Jasper <[email protected]>

* Fix `DateSplitter` for multiples of base frequencies (#2500)

* Fix docstrings according to docformatter (#2501)

* Pin docformatter version. (#2507)

* Docs: Fix install instructions. (#2508)

* Add examples to docstring for `periods_between` (#2504)

* Cap numpy compatibility in `mxnet` extra requirements (#2506)

* xfail multivariate grouper test

Co-authored-by: Lorenzo Stella <[email protected]>
Co-authored-by: Jasper <[email protected]>

* remove undesired files

* `itertools.select`. (#2426)

* Add itertools select.

Co-authored-by: Jasper <[email protected]>
Co-authored-by: Lorenzo Stella <[email protected]>
Co-authored-by: Jasper <[email protected]>
@lostella lostella removed the pending v0.11.x backport This contains a fix to be backported to the v0.11.x branch label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants