mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
style: format code with linter
This commit is contained in:
parent
276b30506c
commit
de26f8e5e0
1 changed files with 8 additions and 7 deletions
|
@ -24,9 +24,10 @@ from aider.dump import dump # noqa: F402,E402
|
|||
|
||||
Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
|
||||
|
||||
|
||||
def print_elapsed(message):
|
||||
current_time = time.time()
|
||||
if hasattr(print_elapsed, 'last_time'):
|
||||
if hasattr(print_elapsed, "last_time"):
|
||||
elapsed = current_time - print_elapsed.last_time
|
||||
print(f"{message}: {elapsed:.2f} seconds")
|
||||
else:
|
||||
|
@ -256,7 +257,7 @@ class RepoMap:
|
|||
fnames = tqdm(fnames)
|
||||
self.cache_missing = False
|
||||
|
||||
print_elapsed('Starting tags processing')
|
||||
print_elapsed("Starting tags processing")
|
||||
|
||||
for fname in fnames:
|
||||
if not Path(fname).is_file():
|
||||
|
@ -294,7 +295,7 @@ class RepoMap:
|
|||
elif tag.kind == "ref":
|
||||
references[tag.name].append(rel_fname)
|
||||
|
||||
print_elapsed('Finished tags processing, starting graph creation')
|
||||
print_elapsed("Finished tags processing, starting graph creation")
|
||||
##
|
||||
# dump(defines)
|
||||
# dump(references)
|
||||
|
@ -335,13 +336,13 @@ class RepoMap:
|
|||
else:
|
||||
pers_args = dict()
|
||||
|
||||
print_elapsed('Starting pagerank calculation')
|
||||
print_elapsed("Starting pagerank calculation")
|
||||
try:
|
||||
ranked = nx.pagerank(G, weight="weight", **pers_args)
|
||||
except ZeroDivisionError:
|
||||
return []
|
||||
|
||||
print_elapsed('Starting rank distribution')
|
||||
print_elapsed("Starting rank distribution")
|
||||
|
||||
# distribute the rank from each source node, across all of its out edges
|
||||
ranked_definitions = defaultdict(float)
|
||||
|
@ -359,7 +360,7 @@ class RepoMap:
|
|||
|
||||
# dump(ranked_definitions)
|
||||
|
||||
print_elapsed('Starting ranked tags processing')
|
||||
print_elapsed("Starting ranked tags processing")
|
||||
for (fname, ident), rank in ranked_definitions:
|
||||
# print(f"{rank:.03f} {fname} {ident}")
|
||||
if fname in chat_rel_fnames:
|
||||
|
@ -380,7 +381,7 @@ class RepoMap:
|
|||
for fname in rel_other_fnames_without_tags:
|
||||
ranked_tags.append((fname,))
|
||||
|
||||
print_elapsed('Finished processing')
|
||||
print_elapsed("Finished processing")
|
||||
return ranked_tags
|
||||
|
||||
def get_ranked_tags_map(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue