aeon-toolkit / aeon

A toolkit for machine learning from time series
https://aeon-toolkit.org/
BSD 3-Clause "New" or "Revised" License
978 stars 116 forks source link

[ENH] Rework distance/matrix profile import system #2021

Open baraline opened 1 month ago

baraline commented 1 month ago

Describe the issue

Currently, when selecting between distance or matrix profile options in QuerySearch or SeriesSearch a dict is used with as values the functions to use. This requires to import all of them at the start of the module, while only one will be used.

Suggest a potential alternative/fix

Make a function that only imports the necessary method at runtime.

Additional context

No response

aryanpola commented 2 weeks ago

@baraline Lazy loading(dynamic importing would be the way to solve the issue?

aryanpola commented 2 weeks ago

Also, how do I classify a certain module as heavy?

baraline commented 2 weeks ago

That should be the solution yes !

baraline commented 2 weeks ago

The idea would simply to import the distance profile / matrix profile functions matching the distance and speed ups paramater given during initialisation