From a3075d2da01f8b5cbb64adfbd094c5790ecbe3cd Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 08:27:39 -0700 Subject: [PATCH 1/7] Added networkx==3.1 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 20063b12c..512eada62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,3 +26,4 @@ tiktoken==0.4.0 configargparse PyYAML backoff==2.2.1 +networkx==3.1 From 27db4c038fd9fc47a30a079f6103385bffdc2172 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 08:29:08 -0700 Subject: [PATCH 2/7] bugfix --- aider/repomap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/repomap.py b/aider/repomap.py index ccd0f24d5..8993e0b87 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -314,7 +314,8 @@ class RepoMap: top_rank = sorted([(rank, node) for (node, rank) in ranked.items()], reverse=True) for rank, fname in top_rank: - rel_other_fnames_without_tags.remove(fname) + if fname in rel_other_fnames_without_tags: + rel_other_fnames_without_tags.remove(fname) if fname not in fnames_already_included: ranked_tags.append((fname,)) From baa08e12f8b8d5d0b0ec2bb7dbccee56c9d5c172 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 08:29:30 -0700 Subject: [PATCH 3/7] ssh --- aider/repomap.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/repomap.py b/aider/repomap.py index 8993e0b87..ff301fc25 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -38,7 +38,6 @@ def to_tree(tags): break num_common = i - dump(repr(tag), num_common) indent = tab * num_common rest = tag[num_common:] From 4121b9900e35c0b81d9264824fe71830e8e85dc8 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 08:30:00 -0700 Subject: [PATCH 4/7] aider: Added cache versioning to `RepoMap` class. # Context: USER: is there a standard way to version these cache files? ASSISTANT: Yes, a standard way to version cache files is to include a version number in the cache file name or within the cache data. This allows you to easily identify and manage different versions of the cache, and update the cache handling logic when needed. Here's how you can implement cache versioning in your `RepoMap` class: 1. Add a constant for the cache version at the beginning of the class. 2. Modify the cache directory names to include the version number. 3. When loading the cache, check if the version matches the current version. If not, clear the cache and start fresh. Here are the changes you need to make in `aider/repomap.py`: ```python aider/repomap.py <<<<<<< ORIGINAL class RepoMap: ctags_cmd = ["ctags", "--fields=+S", "--extras=-F", "--output-format=json"] IDENT_CACHE_DIR = ".aider.ident.cache" TAGS_CACHE_DIR = ".aider.tags.cache" ======= class RepoMap: CACHE_VERSION = 1 ctags_cmd = ["ctags", "--fields=+S", "--extras=-F", "--output-format=json"] IDENT_CACHE_DIR = f".aider.ident.cache.v{CACHE_VERSION}" TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}" >>>>>>> UPDATED ``` Now, whenever you need to change the cache format or handling logic, you can simply increment the `CACHE_VERSION` constant, and the cache will be automatically invalidated and recreated with the new version. --- aider/repomap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/repomap.py b/aider/repomap.py index ff301fc25..324897a1a 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -60,9 +60,10 @@ def fname_to_components(fname, with_colon): class RepoMap: + CACHE_VERSION = 1 ctags_cmd = ["ctags", "--fields=+S", "--extras=-F", "--output-format=json"] - IDENT_CACHE_DIR = ".aider.ident.cache" - TAGS_CACHE_DIR = ".aider.tags.cache" + IDENT_CACHE_DIR = f".aider.ident.cache.v{CACHE_VERSION}" + TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}" def __init__(self, map_tokens=1024, root=None, main_model="gpt-4", io=None): self.io = io From c361366dd981d9b88b8a41615a13b56e13930765 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 09:02:36 -0700 Subject: [PATCH 5/7] Added diskcache==5.6.1 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 512eada62..53b110efc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,3 +27,4 @@ configargparse PyYAML backoff==2.2.1 networkx==3.1 +diskcache==5.6.1 From b824cf4eb33c7e470bf6c839b26e5fa99530a6a3 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 09:03:59 -0700 Subject: [PATCH 6/7] Added numpy==1.24.3 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 53b110efc..431628bf0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,3 +28,4 @@ PyYAML backoff==2.2.1 networkx==3.1 diskcache==5.6.1 +numpy==1.24.3 From ac2d75ed098f4c662727431d1abbc3ef86f48d23 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Jun 2023 09:05:08 -0700 Subject: [PATCH 7/7] Added scipy==1.10.1 --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 431628bf0..8fb6723ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,3 +29,5 @@ backoff==2.2.1 networkx==3.1 diskcache==5.6.1 numpy==1.24.3 +scipy==1.10.1 +