rwijtvliet / portfolyo

Handling timeseries for power and gas retail portfolios.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[bug/enhancement] Import time #73

Closed rwijtvliet closed 3 months ago

rwijtvliet commented 8 months ago

The statement import portfolyotakes several seconds, compared to near instantaneous for other packages, including large ones. It seems some expensive code is executed, either in the package itself or in one of its dependencies.

Maybe we can improve this, maybe with the help of a profiler (cProfile e.g)

Pizza2Pizza commented 6 months ago

I'm not sure what the problem is. I rung this code: import cProfile import portfolyo as pf def main(): import portfolyo as pf

if name == "main": cProfile.run("main()", sort="cumulative")

and my results are zeros everywhere. Can you run it on your end and tell me the results?

rwijtvliet commented 6 months ago

If a package is imported once, it's skipped on subsequent imports. Try (from memory, so check) from importlib import releoad and then in main: pf = import portfolyo as pf

rwijtvliet commented 3 months ago

Let's close this issue for now and focus on other priorities