Reputation: 1183
I have a folder structure like this:
nlp
├── generation
│ ├── io_operations
│ ├── __init__.py
│ ├── generator.py
│ ├── processing.py
│ └── prompting.py
│ ├── prompts (folder)
│ ├── ressources (folder)
│ ├── __init__.py
│ ├── classifier.py
│ ├── clustering.py
│ ├── dsos.py
│ ├── mapper.py
│ └── utils.py
and in both nlp/generation/__init__.py
and nlp/__init__.py
I have custom datatypes defined. The datatypes in generation
are used across the entire folder structure (so, e.g., in classifier
something from there can be used. So it is "globally" available and easy to import by just calling from nlp.generation import structure
. The data structures defined in nlp/__init__.py
are not used in the generation
sub-directory but only on that level (and sometimes from outside). Here, too, importing them is just from nlp import structure
.
My question is whether that is a good practice or not, and if not, why. Thanks!
Upvotes: 0
Views: 39