Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor channel search functionality in
tdm_loader
(#28)
* Refactor channel search functionality in `tdm_loader` The previous implementation of the channel search function in the `tdm_loader.py` was refactored. Search now matches channels directly without set generation and updates retrieval with more efficient lookups. The modification updates the testing to reflect the changes in the returned search results as well. Before the refactor searching throe 22000 channels took 6.5min and after it took 0.08s Also the test has changed to be similar when searching for "", all channels should be returned. * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <github@schroedingerscat.org> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <github@schroedingerscat.org> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <github@schroedingerscat.org> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <github@schroedingerscat.org> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <github@schroedingerscat.org> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <github@schroedingerscat.org> * Implement caching and optimize channel search in `tdm_loader` A cache decorator is introduced for the `get_channels` function to speed up repeated lookups, replacing the previous, dictionary lookup. * Rename method get_channels to _get_channels in tdm_loader The public `get_channels` function is renamed to the private method `_get_channels` in 'tdm_loader.py'. This is due to internal use only, to provide more clarity and prevent unintended external access. * Correct typo in method name in tdm_loader The method name "get_channels" has been corrected to "_get_channels" in the 'tdm_loader.py' file. The change was necessitated by the requirement for the method to be private, hence the underscore, as it's only meant for internal use, preventing unintended external access. --------- Co-authored-by: Espen Enes <espen.enes@nov.com> Co-authored-by: Florian Dobener <github@schroedingerscat.org>
- Loading branch information