79787646

Date: 2025-10-10 19:39:59
Score: 1
Natty:
Report link

As an alternative to @pixel-process's answer, you could develop your package somewhere on your normal Python path, giving the parent directory the name of your package, and then use absolute imports. E.g., in test.py you could then say from pkg_name.utils_dataset.px_chol import CLASS_NAME.

The advantage to using absolute rather than relative imports is, as PEP 8 says,

They are usually more readable and tend to be better behaved (or at least give better error messages) if the import system is incorrectly configured.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @pixel-process's
  • Low reputation (1):
Posted by: PT-Hrothgar