Skip to content

Commit

Permalink
Merge pull request #20 from convidev-tud/9-testsuite
Browse files Browse the repository at this point in the history
9 testsuite
  • Loading branch information
KKegel committed Mar 7, 2024
2 parents 0297b9f + 2921feb commit 112df4e
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 33 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ __pycache__/
# C extensions
*.so

*.code-workspace

tmp/
env/
*env/
volume/
volume/*
!.gitkeep
!volume/config.template.yaml

test-config*
config-*
Expand Down
2 changes: 1 addition & 1 deletion deb_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ echo preparing analysis
ls -l

source env/bin/activate
python3 -W ignore main.py $1
python3 -W ignore driftool/main.py $1
7 changes: 0 additions & 7 deletions driftool.code-workspace

This file was deleted.

File renamed without changes.
14 changes: 7 additions & 7 deletions lib/analysis/analysis.py → driftool/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from sklearn.manifold import MDS
import math

from lib.data.pairwise_distance import PairwiseDistance, distance_avg
from lib.analysis.repository_handler import RepositoryHandler
from lib.data.measured_environment import MeasuredEnvironment
from lib.analysis.csv_data import read_branches_from_csv, read_distances_from_csv
from lib.data.sysconf import SysConf
from lib.analysis.async_exec import async_execute
from lib.data.config_file import ConfigFile
from data.pairwise_distance import PairwiseDistance, distance_avg
from analysis.repository_handler import RepositoryHandler
from data.measured_environment import MeasuredEnvironment
from analysis.csv_data import read_branches_from_csv, read_distances_from_csv
from data.sysconf import SysConf
from analysis.async_exec import async_execute
from data.config_file import ConfigFile

def calculate_median_distance_avg(embeddings: np.ndarray[float]) -> float:
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import asyncio

from lib.data.pairwise_distance import PairwiseDistance
from data.pairwise_distance import PairwiseDistance


def async_execute(threads: list[list[str]], reference_dir: str) -> list[tuple[str, str, PairwiseDistance]]:
Expand Down Expand Up @@ -45,7 +45,7 @@ def async_execute(threads: list[list[str]], reference_dir: str) -> list[tuple[st
async def run(combinations: str, reference_dir: str):
print("Async thread started, please wait...")
proc = await asyncio.create_subprocess_shell(
"python thread.py " + combinations + " " + reference_dir,
"python driftool/thread.py " + combinations + " " + reference_dir,
stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)

stdout, stderr = await proc.communicate()
Expand Down
2 changes: 1 addition & 1 deletion lib/analysis/csv_data.py → driftool/analysis/csv_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from lib.data.pairwise_distance import PairwiseDistance
from data.pairwise_distance import PairwiseDistance
import csv

def read_branches_from_csv(csv_input_file: str) -> list[str]:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/analysis/plot.py → driftool/analysis/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from matplotlib import pyplot as plt
from lib.data.measured_environment import MeasuredEnvironment
from data.measured_environment import MeasuredEnvironment

def visualise_embeddings(me: MeasuredEnvironment):
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import re
import stat

from lib.data.pairwise_distance import PairwiseDistance
from lib.analysis.directory import purge_blacklist, keep_whitelist
from data.pairwise_distance import PairwiseDistance
from analysis.directory import purge_blacklist, keep_whitelist

class RepositoryHandler:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions main.py → driftool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

from datetime import datetime

from lib.data.measured_environment import MeasuredEnvironment
from lib.data.config_file import ConfigFile
from lib.data.sysconf import SysConf
from lib.analysis.analysis import analyze_with_config
from lib.analysis.plot import visualise_embeddings
from lib.webview.render.renderer import render_html
from data.measured_environment import MeasuredEnvironment
from data.config_file import ConfigFile
from data.sysconf import SysConf
from analysis.analysis import analyze_with_config
from analysis.plot import visualise_embeddings
from webview.render.renderer import render_html


if __name__ == '__main__':
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions thread.py → driftool/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import sys

from lib.analysis.analysis import calculate_partial_distance_relation
from lib.analysis.repository_handler import RepositoryHandler
from analysis.analysis import calculate_partial_distance_relation
from analysis.repository_handler import RepositoryHandler

argv = sys.argv[1:]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from io import StringIO
import json

from lib.data.measured_environment import MeasuredEnvironment
from lib.data.distance import BranchDistance, BranchEnvironment
from data.measured_environment import MeasuredEnvironment
from data.distance import BranchDistance, BranchEnvironment


def generate_branch_distance_map(me: MeasuredEnvironment) -> list[BranchEnvironment]:
Expand Down Expand Up @@ -52,7 +52,7 @@ def render_html(me: MeasuredEnvironment, report_title: str, branch_ignore: list[
This template file contains placeholders for the data values.
Data objects are preprocessed and passed to the tmplate engine
'''
mytemplate = Template(filename='resources/report.template.html')
mytemplate = Template(filename='driftool/resources/report.template.html')
buf = StringIO()

sd_embeddings = (me.embedding_lines * 10).astype(int)
Expand Down
Empty file added volume/.gitkeep
Empty file.
14 changes: 14 additions & 0 deletions volume/config.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
input_repository: volume/my-repository
output_directory: volume/
fetch_updates: false
report_title: My Report
print_plot: false
html: true
show_html: false
simple_export: false
branch_ignore:
- "^release\\-"
- "^v\\."
blacklist: []
whitelist:
- "\\.java"

0 comments on commit 112df4e

Please sign in to comment.