gluonts icon indicating copy to clipboard operation
gluonts copied to clipboard

Move `dataset.repository` to `lab`.

Open jaheba opened this issue 3 years ago • 2 comments

Issue #, if available:

Description of changes:

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

jaheba avatar Jun 10 '22 13:06 jaheba

I'm not sure I agree with this change, because I believe it doesn't make it easier to remember what-to-import-from-where: now there would be gluonts.dataset and gluonts.lab.datasets which look similar. One problem with that is that both namespace are related to datasets, only the first contains "dataset types" and the other contains stuff that materializes actual instances of those types (filled with data): they are different in the content, but they split across two subpackages with very similar name.

In my opinion, we should optimize for imports being mnemonic. Somewhat reducing the number of required import levels to type would be good:

from gluonts.dataset import get_dataset, OffsetSplitter  # 2 levels

vs

from gluonts.lab.datasets import get_dataset  # 3 levels
from gluonts.dataset.split import OffsetSplitter  # 3 levels (total 6)

lostella avatar Jun 10 '22 14:06 lostella

Something I want to achieve is to separate the library stuff from more interactive utilities. Things that belong to lib should be happily imported across different gluon-ts modules, but stuff that is lab is only used by end-users and in tests.

I think for lib longer import paths can be a good thing, since they are more precise about where things come from.

However, for lab we could be more aggressive and do things like:

from gluonts.lab import get_dataset

jaheba avatar Jun 10 '22 15:06 jaheba