added comments, added ui improvements and requirement of txt#10
Conversation
…lition in unimain and tests for video and deletions
| super().__init__() | ||
| self._search_fn = search_fn | ||
| self._open_fn = open_fn | ||
| self.DEBUG = True |
There was a problem hiding this comment.
why debug mode is true here
There was a problem hiding this comment.
i added it to debug textual to enable its logs have removed it can be enabled to debug
| from pathlib import Path | ||
|
|
||
| pipeline = IndexPipeline() | ||
| video_path = Path(r"C:\Users\USER\Documents\test\Screen Recording 2026-03-28 220347.mp4") |
There was a problem hiding this comment.
my bad added this for testing have removed
| # stores results by modality, and displays the current modality's results. | ||
| def _perform_search(self, query: str) -> None: | ||
| top_k_select = self.query_one("#top-k-select", Select) | ||
| top_k = top_k_select.value or 6 |
There was a problem hiding this comment.
default value for the user to see for the first time, giving back 6 as the default top k select values
| self.current_results = results # Store for selection | ||
| if results: | ||
| self.log(f">>> Displaying {len(results)} {self.current_modality} results") | ||
| scores = [abs(float(r.get("score", 0.0))) for r in results] |
There was a problem hiding this comment.
can we written in a better way, very less readability
There was a problem hiding this comment.
didnt understand about readability? spacing or logic cleanup? sure will rename r
There was a problem hiding this comment.
I mean too much opt. in a single line . Its more wrt how you want to grow your codebase. For ex. same could have done like
scores = []
for r in results:
score = float(r.get("score", 0.0))
scores.append(abs(score))
There was a problem hiding this comment.
will add a linter but the logic is being in single line will remain the same still sooo its simplifying vs overcomplicating keeping the above version itself
| self.log(f">>> Displaying {len(results)} {self.current_modality} results") | ||
| scores = [abs(float(r.get("score", 0.0))) for r in results] | ||
| max_score = max(scores) if scores else 0.0 | ||
| for i, r in enumerate(results): |
There was a problem hiding this comment.
again r, sometimes its a iterator , sometimes a value. Dont know what is r
There was a problem hiding this comment.
pls use meaningful iterator names. i,r (doesn't make sense)
abhiedward001
left a comment
There was a problem hiding this comment.
Pls create a linting rule for your codebase. Would be very helpful. Need linter, pre commit hooks to maintain code hygiene
No description provided.