Tags: domna/tdm_loader
Tags
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 <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * 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 <[email protected]> Co-authored-by: Florian Dobener <[email protected]>
Refactor channel_group_search implementation in tdm_loader (#27) * Refactor channel_group_search implementation in tdm_loader When searching and resulting groups has identical channel group names, only the first channel group index is returned New logic will look at channel group names together with occurrences to find the correct channel group index. * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Simplify channel group search logic in tdm_loader The previous implementation counted and used the number of times a channel group name appeared, which added extra complexity to the search logic. The new logic simplifies this process by directly appending the names to the found_terms list and by making the search case- and space-insensitive. * Refactor search logic in tdm_loader for channel group names Switched from a for-loop and conditional check structure to an inline list comprehension to search for channel group names. The aim of this refactor is to simplify the code and improve readability, while maintaining the functionality of ignoring None values and retaining valid group names. * Update return type in tdm_loader Changed the return type of a function in tdm_loader from a list to a set. This modification ensures unique channel group names are returned from the function, thus improving the accuracy of the channel search process. * Removed the use of set when returning search results from channel_group_search * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> * Update tdm_loader/tdm_loader.py Co-authored-by: Florian Dobener <[email protected]> --------- Co-authored-by: Espen Enes <[email protected]> Co-authored-by: Florian Dobener <[email protected]>