Skip to content

Commit

Permalink
make link
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn committed Oct 29, 2023
1 parent 13d4373 commit e5fd9a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 3 additions & 3 deletions backend/main.py
@@ -1,8 +1,8 @@

import lunchheros


from fastapi.encoders import jsonable_encoder
from src.lunchheros.db.dbFetcher import get_encoded_data
from src.lunchheros.db.dbFetcher import filter_data, get_encoded_data
from src.routes.users.userFunctions import getAllQueryListData, getAllUsers, getUserWithId
from fastapi import FastAPI
from supabase_client import supabase_client
Expand Down Expand Up @@ -30,6 +30,6 @@ def load_current_user(userId: str):
userData = getUserWithId(userId)
queryList = getAllQueryListData()

test = lunchheros.match.match(userData)
test = filter_data(queryList)

return { "currentUser" : userData, "query": queryList}
4 changes: 3 additions & 1 deletion backend/src/lunchheros/db/dbFetcher.py
@@ -1,10 +1,12 @@
from lunchheros import match
import numpy as np
import pandas as pd
import json
import os

async def get_encoded_data(time_slot: int, location: str, data):
async def filter_data(data):
print("get_encoded_data")
return match(data)
# Transform data
#print(f"Data {time_slot} {location} {data}")
#df = pd.DataFrame(data)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/lunchheros/match/__init__.py
@@ -1,5 +1,5 @@
"""Subpackage related to matching between users into groups."""

from lunchheros.match import matching
from lunchheros.match._randomize import matching

__all__ = ["matching"]
13 changes: 11 additions & 2 deletions backend/tests/match/test_randomize.py
@@ -1,4 +1,4 @@
from lunchheros.match._randomize import _randomize_groups
from lunchheros.match._randomize import _randomize_groups, matching

import json
import numpy as np
Expand Down Expand Up @@ -37,4 +37,13 @@ def test_randomize_with_real():
group_size = 4
# randomize groups
groups = _randomize_groups(group_size, numpy_array.tolist())
print(groups)
print(groups)


def test_matching():

grouping = matching(test_data)

print(grouping)
return grouping

0 comments on commit e5fd9a7

Please sign in to comment.