-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speedups #54
Speedups #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request introduces several improvements and refactoring in the hierarchy annotator and updates the version number. The changes are well-aligned with the project's structure and should enhance the maintainability of the code. Overall, the modifications are beneficial and appear to be correctly implemented.
Butler is in closed beta. Reply with feedback or to ask Butler to review other parts of the PR. Please give feedback with emoji reacts.
@@ -7,7 +7,7 @@ packages=["ragdaemon"] | |||
|
|||
[project] | |||
name = "ragdaemon" | |||
version = "0.7.7" | |||
version = "0.7.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version number has been updated from 0.7.7 to 0.7.8. Please ensure that all related documentation and dependency requirements are also updated accordingly if needed.
@@ -1 +1 @@ | |||
__version__ = "0.7.7" | |||
__version__ = "0.7.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version number in __init__.py
has been updated to match the new version in pyproject.toml
. This is good for maintaining consistency across the project.
@@ -66,37 +66,32 @@ async def annotate( | |||
for parent in path.parents: | |||
if len(parent.parts) == 0: | |||
parent = Path("ROOT") | |||
directories.add(parent) | |||
directories.add(parent.as_posix()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversion of parent
to parent.as_posix()
directly in the directories
set is a good change for consistency, ensuring that all directory paths are stored in the same string format.
) | ||
for source, target in edges: | ||
for id in (source, target): | ||
if id not in graph and id not in directories: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for id
not being in graph
or directories
before adding an edge is crucial for data integrity. This prevents the graph from having edges that reference non-existent nodes.
# Fill-in directory data (same process as get_document for dirs, but more efficient) | ||
for dir in sorted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Fill-in directory data (same process as get_document for dirs, but more efficient) | |
for dir in sorted( | |
for dir in sorted(directories, key=lambda x: len(x) if x != 'ROOT' else 0, reverse=True): |
Refactoring the sorting of directories to a more concise and readable format improves code maintainability. This change also ensures that 'ROOT' is properly handled as a special case.
No description provided.