Skip to content

Commit 81e8427

Browse files
committed
chore: Use relative pre-imports to avoid KeyError
1 parent dc706e8 commit 81e8427

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/solarbatteryield/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
# Pre-import modules to ensure they are fully loaded before concurrent access.
1111
# This prevents race conditions with @dataclass decorators on Streamlit Cloud.
1212
# Order matters: import dependencies before dependents.
13-
from solarbatteryield import inverter_efficiency # noqa: F401 - needed by models, simulation
14-
from solarbatteryield import h0_profile # noqa: F401 - needed by config, simulation
15-
from solarbatteryield import load_regression # noqa: F401 - JSON loaded at module level
16-
from solarbatteryield import config # noqa: F401 - needed by state, sidebar, report
17-
from solarbatteryield import models # noqa: F401 - needed by simulation, report
13+
# Use relative imports to avoid KeyError during package initialization.
14+
from . import inverter_efficiency # noqa: F401 - needed by models, simulation
15+
from . import h0_profile # noqa: F401 - needed by config, simulation
16+
from . import load_regression # noqa: F401 - JSON loaded at module level
17+
from . import config # noqa: F401 - needed by state, sidebar, report
18+
from . import models # noqa: F401 - needed by simulation, report

0 commit comments

Comments
 (0)