Skip to content

Commit 30612a2

Browse files
authored
Merge pull request #519 from MEDomicsLab/develop
v1.7.0 merge
2 parents 85d8f67 + 5dd3b93 commit 30612a2

116 files changed

Lines changed: 10597 additions & 2363 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[submodule "pythonCode/submodules/MEDprofiles"]
66
path = pythonCode/submodules/MEDprofiles
77
url = git@github.com:MEDomics-UdeS/MEDprofiles.git
8-
branch = fusion_MEDomicsLab
8+
branch = fusion_MEDomicsLab

electron-builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ mac: # Added from package.json
6060
# - "Contents/MacOS/MEDomicsLab"
6161
pkg: # Added from package.json
6262
isRelocatable: false
63+
scripts: "../build/pkg-scripts"
6364
win: # Added from package.json
6465
target: nsis
6566
icon: "app/assets/icon.ico"

go_server/blueprints/input/input.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ func AddHandleFunc() {
3232
Utils.CreateHandleFunc(prePath+"/create_group_DB/", handleCreateGroupDB)
3333
Utils.CreateHandleFunc(prePath+"/generate_sample_data/", handleGenerateSampleData)
3434
Utils.CreateHandleFunc(prePath+"/find_duplicate_columns_DB", handleFindDuplicateColumnsDB)
35+
Utils.CreateHandleFunc(prePath+"/normalizeDB/", handleNormalizeDB)
36+
Utils.CreateHandleFunc(prePath+"/drop_columns_tags/", handleDeleteColumnsAndTags)
37+
3538
}
3639

3740
// handleMerge handles the request to merge the datasets for the DB
@@ -297,6 +300,16 @@ func handleGenerateSampleData(jsonConfig string, id string) (string, error) {
297300
return response, nil
298301
}
299302

303+
func handleNormalizeDB(jsonConfig string, id string) (string, error) {
304+
log.Println("Normalizing DB...", id)
305+
response, err := Utils.StartPythonScripts(jsonConfig, "../pythonCode/modules/input/normalizeDB.py", id)
306+
Utils.RemoveIdFromScripts(id)
307+
if err != nil {
308+
return "", err
309+
}
310+
return response, nil
311+
}
312+
300313
// handleFindDuplicateColumnsDB to identify duplicate columns from a CSV
301314
// It returns the response from the python script
302315
func handleFindDuplicateColumnsDB(jsonConfig string, id string) (string, error) {
@@ -316,3 +329,12 @@ func handleFindDuplicateColumnsDB(jsonConfig string, id string) (string, error)
316329

317330
return response, nil
318331
}
332+
func handleDeleteColumnsAndTags(jsonConfig string, id string) (string, error) {
333+
log.Println("Deleting Columns...", id)
334+
response, err := Utils.StartPythonScripts(jsonConfig, "../pythonCode/modules/input/drop_columns_tags.py", id)
335+
Utils.RemoveIdFromScripts(id)
336+
if err != nil {
337+
return "", err
338+
}
339+
return response, nil
340+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package superset
2+
3+
import (
4+
Utils "go_module/src"
5+
"log"
6+
)
7+
8+
var prePath = "superset"
9+
10+
// AddHandleFunc adds the specific module handle function to the server
11+
func AddHandleFunc() {
12+
Utils.CreateHandleFunc(prePath+"/launch/", handleLaunch)
13+
Utils.CreateHandleFunc(prePath+"/create_user/", handleCreateUser)
14+
Utils.CreateHandleFunc(prePath+"/progress/", handleProgress)
15+
}
16+
17+
// handleStartSweetviz handles the request to run a sweetviz analysis
18+
// It returns the response from the python script
19+
func handleLaunch(jsonConfig string, id string) (string, error) {
20+
log.Println("launching superset...", id)
21+
response, err := Utils.StartPythonScripts(jsonConfig, "../pythonCode/modules/superset/launch.py", id)
22+
Utils.RemoveIdFromScripts(id)
23+
if err != nil {
24+
return "", err
25+
}
26+
return response, nil
27+
}
28+
29+
// handleCreateUser handles the request to create a user in superset
30+
// It returns the response from the python script
31+
func handleCreateUser(jsonConfig string, id string) (string, error) {
32+
log.Println("creating user in superset...", id)
33+
response, err := Utils.StartPythonScripts(jsonConfig, "../pythonCode/modules/superset/create_user.py", id)
34+
Utils.RemoveIdFromScripts(id)
35+
if err != nil {
36+
return "", err
37+
}
38+
return response, nil
39+
}
40+
41+
// handleProgress handles the request to get the progress of the experiment
42+
// It returns the progress of the experiment
43+
func handleProgress(jsonConfig string, id string) (string, error) {
44+
Utils.Mu.Lock()
45+
progress := Utils.Scripts[id].Progress
46+
Utils.Mu.Unlock()
47+
if progress != "" {
48+
return progress, nil
49+
} else {
50+
return "{\"now\":\"0\", \"currentLabel\":\"Warming up\"}", nil
51+
}
52+
}

go_server/main

-2.95 KB
Binary file not shown.

go_server/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
Learning "go_module/blueprints/learning"
1515
MED3pa "go_module/blueprints/med3pa"
1616
MEDfl "go_module/blueprints/medfl"
17+
Superset "go_module/blueprints/superset"
1718
Utils "go_module/src"
1819
"log"
1920
"net/http"
@@ -36,6 +37,7 @@ func main() {
3637
Application.AddHandleFunc()
3738
MED3pa.AddHandleFunc()
3839
MEDfl.AddHandleFunc()
40+
Superset.AddHandleFunc()
3941
Utils.CreateHandleFunc("get_server_health", handleGetServerHealth)
4042
Utils.CreateHandleFunc("removeId/", handleRemoveId)
4143
Utils.CreateHandleFunc("clearAll", handleClearAll)
@@ -49,9 +51,8 @@ func main() {
4951

5052
if len(os.Args) == 6 {
5153
condaEnv = os.Args[5]
52-
}
53-
54-
54+
}
55+
5556
log.Println("Conda env: " + condaEnv)
5657
os.Setenv("MED_ENV", condaEnv)
5758
os.Setenv("MED_TMP", os.Args[4])
@@ -66,7 +67,6 @@ func main() {
6667
return
6768
}
6869

69-
7070
}
7171

7272
// handleGetServerHealth handles the request to get the server health

go_server/src/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func StartPythonScripts(jsonParam string, filename string, id string) (string, e
192192
err = Scripts[id].Cmd.Start()
193193
Mu.Unlock()
194194
if err != nil {
195-
log.Println("Error starting command " + script)
195+
log.Println("Error starting command " + Scripts[id].Cmd.String())
196196
return "", err
197197
}
198198
response := ""

main/background.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ function sendStatusToWindow(text) {
8787
}
8888

8989
autoUpdater.on("checking-for-update", () => {
90-
console.log("DEBUG: checking for update")
9190
sendStatusToWindow("Checking for update...")
9291
})
9392

0 commit comments

Comments
 (0)