jackmedda
commited on
Commit
·
71692ea
1
Parent(s):
3c184b3
Demo first draft
Browse files- __init__.py +0 -3
- app.py +2 -1
- utils/poi_search_utils.py +2 -3
- utils/recommender_poi_utils.py +2 -2
- utils/sensory_config_utils.py +1 -1
- utils/survey_utils.py +1 -2
- utils/user_profile_utils.py +1 -1
- utils/utils.py +1 -1
__init__.py
CHANGED
@@ -1,3 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources")
|
|
|
|
|
|
|
|
app.py
CHANGED
@@ -6,7 +6,6 @@ from functools import partial
|
|
6 |
|
7 |
import gradio as gr
|
8 |
|
9 |
-
from app import RESOURCE_DIR
|
10 |
from app.utils.poi_search_utils import (
|
11 |
clear_all_selections,
|
12 |
get_selection_summary,
|
@@ -38,6 +37,8 @@ from app.utils.user_profile_utils import (
|
|
38 |
update_user_sensory_aversions
|
39 |
)
|
40 |
|
|
|
|
|
41 |
with open(os.path.join(RESOURCE_DIR, "aversion_config_questions.json"), "r") as f:
|
42 |
AVERSIONS_QUESTIONS = json.load(f)
|
43 |
with open(os.path.join(RESOURCE_DIR, "aversions.json"), "r") as f:
|
|
|
6 |
|
7 |
import gradio as gr
|
8 |
|
|
|
9 |
from app.utils.poi_search_utils import (
|
10 |
clear_all_selections,
|
11 |
get_selection_summary,
|
|
|
37 |
update_user_sensory_aversions
|
38 |
)
|
39 |
|
40 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources")
|
41 |
+
|
42 |
with open(os.path.join(RESOURCE_DIR, "aversion_config_questions.json"), "r") as f:
|
43 |
AVERSIONS_QUESTIONS = json.load(f)
|
44 |
with open(os.path.join(RESOURCE_DIR, "aversions.json"), "r") as f:
|
utils/poi_search_utils.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
import datetime
|
2 |
import json
|
3 |
import os
|
4 |
|
5 |
-
from app import RESOURCE_DIR
|
6 |
from app.html_items import create_poi_cards_list
|
7 |
|
8 |
-
|
|
|
9 |
with open(os.path.join(RESOURCE_DIR, "mock_data.json"), "r") as f:
|
10 |
LOADED_MOCK_POIS = json.load(f)
|
11 |
pois_list = LOADED_MOCK_POIS
|
|
|
|
|
1 |
import json
|
2 |
import os
|
3 |
|
|
|
4 |
from app.html_items import create_poi_cards_list
|
5 |
|
6 |
+
|
7 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
|
8 |
with open(os.path.join(RESOURCE_DIR, "mock_data.json"), "r") as f:
|
9 |
LOADED_MOCK_POIS = json.load(f)
|
10 |
pois_list = LOADED_MOCK_POIS
|
utils/recommender_poi_utils.py
CHANGED
@@ -6,10 +6,10 @@ import random
|
|
6 |
import gradio as gr
|
7 |
from app.html_items import create_poi_html, create_recommendation_item
|
8 |
|
9 |
-
from app import RESOURCE_DIR
|
10 |
from app.utils.survey_utils import reset_surveys
|
11 |
|
12 |
-
|
|
|
13 |
with open(os.path.join(RESOURCE_DIR, "mock_data.json"), "r") as f:
|
14 |
LOADED_MOCK_POIS = json.load(f)
|
15 |
|
|
|
6 |
import gradio as gr
|
7 |
from app.html_items import create_poi_html, create_recommendation_item
|
8 |
|
|
|
9 |
from app.utils.survey_utils import reset_surveys
|
10 |
|
11 |
+
|
12 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
|
13 |
with open(os.path.join(RESOURCE_DIR, "mock_data.json"), "r") as f:
|
14 |
LOADED_MOCK_POIS = json.load(f)
|
15 |
|
utils/sensory_config_utils.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import json
|
2 |
import os
|
3 |
|
4 |
-
from app import RESOURCE_DIR
|
5 |
from app.utils import get_aversion_color, get_qualitative_aversion
|
6 |
|
7 |
|
|
|
8 |
with open(os.path.join(RESOURCE_DIR, "aversion_config_questions.json"), "r") as f:
|
9 |
AVERSIONS_QUESTIONS = json.load(f)
|
10 |
with open(os.path.join(RESOURCE_DIR, "aversions.json"), "r") as f:
|
|
|
1 |
import json
|
2 |
import os
|
3 |
|
|
|
4 |
from app.utils import get_aversion_color, get_qualitative_aversion
|
5 |
|
6 |
|
7 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
|
8 |
with open(os.path.join(RESOURCE_DIR, "aversion_config_questions.json"), "r") as f:
|
9 |
AVERSIONS_QUESTIONS = json.load(f)
|
10 |
with open(os.path.join(RESOURCE_DIR, "aversions.json"), "r") as f:
|
utils/survey_utils.py
CHANGED
@@ -4,9 +4,8 @@ import os
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
7 |
-
from app import RESOURCE_DIR
|
8 |
|
9 |
-
|
10 |
with open(os.path.join(RESOURCE_DIR, "survey_statements.json"), "r") as f:
|
11 |
survey_data = json.load(f)
|
12 |
SURVEY_STATEMENTS = survey_data.get("statements", [])
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
7 |
|
8 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
|
9 |
with open(os.path.join(RESOURCE_DIR, "survey_statements.json"), "r") as f:
|
10 |
survey_data = json.load(f)
|
11 |
SURVEY_STATEMENTS = survey_data.get("statements", [])
|
utils/user_profile_utils.py
CHANGED
@@ -3,9 +3,9 @@ import json
|
|
3 |
import os
|
4 |
from typing import Optional
|
5 |
|
6 |
-
from app import RESOURCE_DIR
|
7 |
from app.utils.sensory_config_utils import extract_sensory_preferences
|
8 |
|
|
|
9 |
USER_PROFILES_FILE = os.path.join(RESOURCE_DIR, os.pardir, "database", "user_profiles.json")
|
10 |
os.makedirs(os.path.dirname(USER_PROFILES_FILE), exist_ok=True)
|
11 |
|
|
|
3 |
import os
|
4 |
from typing import Optional
|
5 |
|
|
|
6 |
from app.utils.sensory_config_utils import extract_sensory_preferences
|
7 |
|
8 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
|
9 |
USER_PROFILES_FILE = os.path.join(RESOURCE_DIR, os.pardir, "database", "user_profiles.json")
|
10 |
os.makedirs(os.path.dirname(USER_PROFILES_FILE), exist_ok=True)
|
11 |
|
utils/utils.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import json
|
2 |
import os
|
3 |
|
4 |
-
from app import RESOURCE_DIR
|
5 |
|
|
|
6 |
with open(os.path.join(RESOURCE_DIR, "_defaults.json"), "r") as f:
|
7 |
_defaults = json.load(f)
|
8 |
|
|
|
1 |
import json
|
2 |
import os
|
3 |
|
|
|
4 |
|
5 |
+
RESOURCE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
|
6 |
with open(os.path.join(RESOURCE_DIR, "_defaults.json"), "r") as f:
|
7 |
_defaults = json.load(f)
|
8 |
|