Skip to content

Commit

Permalink
issue #14: sort imports + output folder in env
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahim-kabir committed Apr 4, 2024
1 parent 0356f49 commit 78184c3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
BING_SEARCH_KEY =
BING_ENDPOINT =
CACHE_PATH =
OUTPUT_FOLDER =
9 changes: 6 additions & 3 deletions finesse/accuracy_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
import datetime
import csv
import os
import re

from dotenv import load_dotenv
from collections import namedtuple
import regex as re

from finesse.bing_search import BingSearch
from dotenv import load_dotenv

OUTPUT_FOLDER = "./finesse/output"
load_dotenv()
OUTPUT_FOLDER = os.getenv("OUTPUT_FOLDER","./finesse/output")
AccuracyResult = namedtuple("AccuracyResult", ["position", "total_pages", "score"])

def calculate_accuracy(responses_url: list[str], expected_url: list | str) -> AccuracyResult:
Expand Down
5 changes: 3 additions & 2 deletions finesse/bing_search.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from azure.cognitiveservices.search.websearch import WebSearchClient
from msrest.authentication import CognitiveServicesCredentials
import time
import statistics

from azure.cognitiveservices.search.websearch import WebSearchClient
from msrest.authentication import CognitiveServicesCredentials
from joblib import Memory


Expand Down
6 changes: 4 additions & 2 deletions finesse/finesse_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from locust import HttpUser, task, events
from jsonreader import JSONReader
import os
import json

from locust import HttpUser, task, events

from accuracy_functions import save_to_markdown, save_to_csv, calculate_accuracy, update_dict_bing_data
from host import is_host_up
from jsonreader import JSONReader

global_test_data = dict()
settings = dict()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
locust
regex
python-dotenv
azure-cognitiveservices-search-websearch
msrest
Expand Down

0 comments on commit 78184c3

Please sign in to comment.