Skip to content

Commit 9fc9219

Browse files
authored
Merge pull request #33 from data-exp-lab/main
Deploy Edge Creation Feature
2 parents 759734f + d4eb5cc commit 9fc9219

25 files changed

+4571
-5152
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@ DeepGit is a free, open-source web application designed to help researchers and
2222
1. Clone the repository:
2323
```bash
2424
git clone https://github.com/data-exp-lab/deepgit.git
25-
cd deepgit
2625
```
2726

28-
2. Install dependencies:
27+
2. Install frontend dependencies:
2928
```bash
29+
cd deepgit
3030
npm install
3131
```
3232

33-
3. Start the development server:
33+
3. Install the backend dependencies:
34+
```bash
35+
cd backend
36+
pip install -r requirements.txt
37+
```
38+
39+
4. Start the development server:
3440
```bash
35-
npm run dev:watch
41+
cd ..
42+
bash start.sh
3643
```
3744
# Acknowledgment
3845
DeepGit is built upon [Retina](https://ouestware.gitlab.io/retina/1.0.0-beta.4/#/) developed by [OuestWare](https://www.ouestware.com/en/)

backend/app/services/gexy_node_service.py

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,61 @@ def generate_gexf_nodes_for_topics(self, topics):
6161
topics_lower = [t.lower() for t in topics]
6262
placeholders = ",".join(["?"] * len(topics_lower))
6363

64+
# Debug: Check what columns actually exist in the repos table
65+
schema_query = "DESCRIBE repos"
66+
# try:
67+
# schema_result = self.con.execute(schema_query).fetchall()
68+
# # print("Repos table schema:")
69+
# # for col in schema_result:
70+
# # print(f" {col}")
71+
# except Exception as e:
72+
# print(f"Could not get schema: {e}")
73+
6474
query = f"""
65-
WITH repo_topics_agg AS (
66-
SELECT r.nameWithOwner,
67-
GROUP_CONCAT(t.topic, '|') as topics
75+
WITH matching_repos AS (
76+
SELECT DISTINCT r.nameWithOwner
6877
FROM repos r
6978
JOIN repo_topics t ON r.nameWithOwner = t.repo
7079
WHERE LOWER(t.topic) IN ({placeholders})
80+
),
81+
repo_topics_agg AS (
82+
SELECT
83+
r.nameWithOwner,
84+
GROUP_CONCAT(t.topic, '|') AS topics
85+
FROM repos r
86+
JOIN repo_topics t ON r.nameWithOwner = t.repo
87+
JOIN matching_repos mr ON r.nameWithOwner = mr.nameWithOwner
7188
GROUP BY r.nameWithOwner
7289
)
73-
SELECT DISTINCT r.nameWithOwner, r.stars, r.forks, r.watchers, r.isFork, r.isArchived,
74-
r.languageCount, r.pullRequests, r.issues, r.primaryLanguage, r.createdAt,
75-
r.license, rt.topics
90+
SELECT
91+
r.nameWithOwner,
92+
r.stars,
93+
r.forks,
94+
r.watchers,
95+
r.isArchived,
96+
r.languageCount,
97+
r.pullRequests,
98+
r.issues,
99+
r.primaryLanguage,
100+
r.createdAt,
101+
r.license,
102+
rt.topics
76103
FROM repos r
77-
JOIN repo_topics t ON r.nameWithOwner = t.repo
78-
JOIN repo_topics_agg rt ON r.nameWithOwner = rt.nameWithOwner
79-
WHERE LOWER(t.topic) IN ({placeholders})
104+
JOIN matching_repos mr ON r.nameWithOwner = mr.nameWithOwner
105+
JOIN repo_topics_agg rt ON r.nameWithOwner = rt.nameWithOwner;
80106
"""
81-
result = self.con.execute(query, topics_lower + topics_lower).fetchall()
107+
result = self.con.execute(query, topics_lower).fetchall()
108+
109+
# Debug: Print the first few rows to see what we're getting
110+
# if result:
111+
# print(f"First row sample: {result[0]}")
112+
# print(f"Number of results: {len(result)}")
113+
82114
columns = [
83115
"nameWithOwner",
84116
"stars",
85117
"forks",
86118
"watchers",
87-
"isFork",
88119
"isArchived",
89120
"languageCount",
90121
"pullRequests",
@@ -102,7 +133,6 @@ def generate_gexf_nodes_for_topics(self, topics):
102133
"stars": 0,
103134
"forks": 0,
104135
"watchers": 0,
105-
"isFork": False,
106136
"isArchived": False,
107137
"languageCount": 0,
108138
"pullRequests": 0,
@@ -119,7 +149,6 @@ def generate_gexf_nodes_for_topics(self, topics):
119149
'stars': {'type': 'integer'},
120150
'forks': {'type': 'integer'},
121151
'watchers': {'type': 'integer'},
122-
'isFork': {'type': 'boolean'},
123152
'isArchived': {'type': 'boolean'},
124153
'languageCount': {'type': 'integer'},
125154
'pullRequests': {'type': 'integer'},
@@ -157,6 +186,9 @@ def generate_gexf_nodes_for_topics(self, topics):
157186
elif col == "topics":
158187
# Store topics as a comma-separated string
159188
node_attrs[col] = val if val else default_values[col]
189+
elif col == "isArchived":
190+
# Ensure isArchived is always a boolean value
191+
node_attrs[col] = bool(val) if val is not None else False
160192
else:
161193
# Use default value if the value is None
162194
node_attrs[col] = default_values[col] if val is None else val

0 commit comments

Comments
 (0)