Skip to content

Commit f2aac7c

Browse files
authored
1.0.2 - Fixed issues with python & DP projects
2 parents 97a9c59 + 7cab491 commit f2aac7c

20 files changed

Lines changed: 39 additions & 39 deletions

File tree

debiaiServer/api/v1/debiai/dataprovider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def format_data_provider_info(data_provider):
4747

4848

4949
def get_data_provider_info(dataProviderId):
50-
5150
# As Parquet not yet supported we force json_block:
5251
if dataProviderId == "json_block":
5352
dataProviderId = "Python module Data Provider"

debiaiServer/api/v1/debiai/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
swagger: "2.0"
22
info:
3-
version: 1.0.1
3+
version: 1.0.2
44
title: DebiAI_APPLICATION_PROJECT_BACKEND_API
55
description: DebiAI backend api
66
contact:

debiaiServer/api/v1/debiai/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
def freeze(o):
5-
65
if isinstance(o, dict):
76
return frozenset({k: freeze(v) for k, v in o.items()}.items())
87

debiaiServer/api/v1/exploration/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,8 @@ def create_selection(
288288
# Extract the selected combinations from the exploration
289289
combinations = exploration.get("combinations", [])
290290
if not combinations:
291-
raise ValueError(
292-
f"No combinations found in exploration \
293-
{exploration_id} for project {project_id}"
294-
)
291+
raise ValueError(f"No combinations found in exploration \
292+
{exploration_id} for project {project_id}")
295293

296294
# Filter the combinations based on the selected IDs
297295
selected_combinations = [

debiaiServer/api/v1/json_block_provider/dataprovider.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717

1818
def get_data_providers_project():
19-
2019
# Return a list of project overviews for a specific data provider
2120
data_provider = data_provider_manager.get_single_data_provider(dataProviderId)
2221

@@ -37,6 +36,17 @@ def get_data_providers_project():
3736
return projects, 200
3837

3938

39+
def _flatten_column(col):
40+
"""Promote metadata.category and metadata.group to the top level of a column."""
41+
flat = dict(col)
42+
metadata = flat.get("metadata", {})
43+
if "category" in metadata:
44+
flat["category"] = metadata["category"]
45+
if "group" in metadata:
46+
flat["group"] = metadata["group"]
47+
return flat
48+
49+
4050
def change_project_v1(project_info, column_info):
4151
v1_project_info = {
4252
"id": project_info["id"],
@@ -50,7 +60,7 @@ def change_project_v1(project_info, column_info):
5060
"nbSelections": project_info["nbSelections"],
5161
"nbSamples": project_info["nbSamples"],
5262
},
53-
"columns": column_info,
63+
"columns": [_flatten_column(c) for c in column_info],
5464
# "nbModels": project_info["nbModels"],
5565
# "nbSelections": project_info["nbSelections"],
5666
# "nbSamples": project_info["nbSamples"],
@@ -61,6 +71,11 @@ def change_project_v1(project_info, column_info):
6171
# "blockLevelInfo": projectBlockLevel, remove here, keep in the API for python module in V1
6272
}
6373

74+
# Include resultStructure only when it is defined
75+
result_structure = project_info.get("resultStructure")
76+
if result_structure is not None:
77+
v1_project_info["resultStructure"] = result_structure
78+
6479
return v1_project_info
6580

6681

debiaiServer/config/config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cache_duration = 120
4545
# List all the web data providers you want to use
4646
# Format: data_provider_name = <Data provider URL>
4747
; My_data_provider1 = http://localhost:3010/debiai
48-
; My_data_provider2 = http://localhost:3011/
48+
My_data_provider2 = http://localhost:8000/
4949

5050

5151
### ALGO PROVIDERS ### (ref: https://debiai.irt-systemx.fr/algoProviders/)

debiaiServer/debiai_gui_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,8 @@ def build_parameters(args):
157157

158158

159159
def main():
160-
parser = argparse.ArgumentParser(
161-
description="""DebiAI GUI Command Line.
162-
Learn more about DebiAI at https://debiai.irt-systemx.fr/"""
163-
)
160+
parser = argparse.ArgumentParser(description="""DebiAI GUI Command Line.
161+
Learn more about DebiAI at https://debiai.irt-systemx.fr/""")
164162

165163
# Version flag
166164
parser.add_argument(

debiaiServer/exploration/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,8 @@ def create_selection(
307307
# Extract the selected combinations from the exploration
308308
combinations = exploration.get("combinations", [])
309309
if not combinations:
310-
raise ValueError(
311-
f"No combinations found in exploration \
312-
{exploration_id} for project {project_id}"
313-
)
310+
raise ValueError(f"No combinations found in exploration \
311+
{exploration_id} for project {project_id}")
314312

315313
# Filter the combinations based on the selected IDs
316314
selected_combinations = [

debiaiServer/modules/algoProviders/integratedAlgoProvider/algorithms/regressionErrorMetric.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
get_input_from_inputs,
33
)
44

5-
65
# This algorithm is a simple regression metric calculator
76
# It takes a list of numbers corresponding to an error
87
# and a ceil corresponding to the maximum acceptable error

debiaiServer/modules/dataProviders/dataProviderManager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ def get_data_provider_list():
114114

115115

116116
def get_single_data_provider(id) -> WebDataProvider:
117-
118117
# TODO For compatibility with v0 :
119118
if id == PYTHON_DATA_PROVIDER_NAME and python_data_provider_disabled:
120119
raise DataProviderException("Python module data provider is disabled", 403)

0 commit comments

Comments
 (0)