File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments