Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/learning_MED_dataset' into dev_g…
Browse files Browse the repository at this point in the history
…ithubActionsSetup
  • Loading branch information
NicoLongfield committed Dec 4, 2023
2 parents 109aca6 + 8793315 commit 41d2b6b
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 25 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ npm install
- You can do it manually by running `go build main.go` in the `go_server` folder
- You can also use a script that you can run from the root folder of the project:
- Windows : `.\utilScripts\pack_GO.bat`
- Linux : `bash utilScripts/pack_GO.sh`
- Linux : `bash utilScripts/pack_GO_linux.sh`
- MacOS : `bash utilScripts/pack_GO_mac.sh`

## 5. Python environment

Expand Down
Binary file modified go_executables/server_go_win32.exe
Binary file not shown.
Binary file modified go_server/main.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"html-react-parser": "^3.0.12",
"install": "^0.13.0",
"interweave": "^13.1.0",
"ipynb-editor": "^1.1.0",
"jimp": "^0.22.10",
"jquery-csv": "^1.0.21",
"prettier": "^3.0.3",
Expand All @@ -107,6 +108,7 @@
"react-hook-form": "^7.47.0",
"react-icons": "^4.11.0",
"react-iframe": "^1.8.5",
"react-ipynb-renderer": "^2.1.3",
"react-loading": "^2.0.3",
"react-native-uuid": "^2.0.1",
"react-plotly.js": "^2.6.0",
Expand Down
1 change: 0 additions & 1 deletion pythonCode/modules/input/create_holdout_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _custom_process(self, json_config: dict) -> dict:
# Create the holdout set
progress += progress_step
self.set_progress(now=progress, label="Creating holdout set")


if (shuffle_bool):
train_set, holdout_set = train_test_split(df_cleaned, test_size=holdout_size, random_state=random_state,
Expand Down
7 changes: 7 additions & 0 deletions renderer/components/layout/flexlayout/mainContainerClass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import ZoomPanPinchComponent from "./zoomPanPinchComponent"
import DataTableWrapperBPClass from "../../dataTypeVisualisation/dataTableWrapperBPClass"
import HtmlViewer from "../../mainPages/htmlViewer"
import ModelViewer from "../../mainPages/modelViewer"
import NotebookEditor from "../../mainPages/notebookEditor"
import Iframe from "react-iframe"

var fields = ["Name", "Field1", "Field2", "Field3", "Field4", "Field5"]
Expand Down Expand Up @@ -749,6 +750,12 @@ class MainInnerContainer extends React.Component<any, { layoutFile: string | nul
console.log("config", config)
return <Iframe url={config.path} width="100%" height="100%" />
}
} else if (component === "codeEditor") {
if (node.getExtraData().data == null) {
const config = node.getConfig()
console.log("config", config)
return <NotebookEditor url={config.path}/>
}
} else if (component !== "") {
if (node.getExtraData().data == null) {
const config = node.getConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ const renderItem = ({ item, depth, children, title, context, arrow }, additional
<li {...context.itemContainerWithChildrenProps} className={cx("rct-tree-item-li", item.isFolder && "rct-tree-item-li-isFolder", context.isSelected && "rct-tree-item-li-selected", context.isExpanded && "rct-tree-item-li-expanded", context.isFocused && "rct-tree-item-li-focused", context.isDraggingOver && "rct-tree-item-li-dragging-over", context.isSearchMatching && "rct-tree-item-li-search-match")}>
<div {...context.itemContainerWithoutChildrenProps} style={{ paddingLeft: `${(depth + 1) * 12}px` }} className={cx("rct-tree-item-title-container", item.isFolder && "rct-tree-item-title-container-isFolder", context.isSelected && "rct-tree-item-title-container-selected", context.isExpanded && "rct-tree-item-title-container-expanded", context.isFocused && "rct-tree-item-title-container-focused", context.isDraggingOver && "rct-tree-item-title-container-dragging-over", context.isSearchMatching && "rct-tree-item-title-container-search-match")}>
<div className="folder-bracket" style={{ left: `${(depth + 1) * 12 + 8}px`, backgroundColor: `${additionalParams.isHovering ? "" : "#ffffff00"}`, width: "1px", transition: "all 0.5s ease-in-out" }}></div>

{arrow}

<InteractiveComponent
type={type}
{...context.interactiveElementProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,27 @@ const SidebarDirectoryTreeControlled = ({ setExternalSelectedItems, setExternalD
<Item id="openInCodeEditor" onClick={handleContextMenuAction}>
Code editor (default)
</Item>
<Item id="openInJupyter" onClick={handleContextMenuAction}>
<Item id="openInJupyter" onClick={
() => {
const { shell } = require('electron');
const childProcess = require('child_process');

// Start Jupyter server
let jupyterServer = childProcess.spawn('jupyter', ['notebook', '--no-browser', '--port', '9999'], {
detached: true,
stdio: 'ignore'
});

// Open .ipynb file in Jupyter notebook
let openInJupyter = () => {
let filePath = globalData[selectedItems[0]].path;
let notebookUrl = `http://localhost:9999/notebooks/${filePath}`;
shell.openExternal(notebookUrl);
};

openInJupyter();
}
}>
Jupyter Notebook
</Item>
<Item id="openInVSCode" onClick={() => require("electron").shell.openPath(globalData[selectedItems[0]].path)}>
Expand Down
43 changes: 23 additions & 20 deletions renderer/components/learning/results/node/analyseResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,34 @@ const AnalyseResults = ({ selectedResults }) => {
if (imagesInfos.length != 0) {
console.log("imagesInfos", imagesInfos)
let zipPath = imagesInfos[0].path.split(MedDataObject.getPathSeparator() + "tmp" + MedDataObject.getPathSeparator())[0]
let images = []
console.log("zipPath", zipPath)
modifyZipFileSync(zipPath + ".medml", () => {
const addImage = (modelName, path) => {
return new Promise((resolve) => {
getLocalImageSync(path).then((imageUrl) => {
images.push(
<div key={modelName}>
<Image src={imageUrl} alt="Image" height="250" indicatorIcon={<h5>{modelName}</h5>} preview downloadable />
</div>
)
resolve()
})
})
}
return new Promise((resolve) => {
let chain = Promise.resolve()
for (let { modelName, path } of imagesInfos) {
console.log("path", path)
chain = chain.then(() => addImage(modelName, path))
}
resolve()
let promises = imagesInfos.map(({ modelName, path }) => {
console.log("path", path);
return getLocalImageSync(path).then((imageUrl) => {
return {
key: modelName,
imageUrl: imageUrl
};
});
});
Promise.all(promises)
.then((results) => {
let images = results.map(({ key, imageUrl }) => (
<div key={key}>
<Image src={imageUrl} alt="Image" height="250" indicatorIcon={<h5>{key}</h5>} preview downloadable />
</div>
));
setImages(images);
})
.catch((error) => {
console.log(error);
});
resolve();
})
}).then(() => {
setImages(images)
console.log("finishing")
})
}
}
Expand Down
15 changes: 15 additions & 0 deletions renderer/components/mainPages/notebookEditor.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

/**
* This is a base React component.
* @param {string} url - The URL parameter.
* @returns {JSX.Element} The rendered component.
*/
const NotebookEditor = ({ url }) => {
// Your component logic here
return <>
Not implemented yet
</>
};

export default NotebookEditor;
6 changes: 6 additions & 0 deletions renderer/components/workspace/dataStepsUtils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const pipeStep = {
console.log("executing... ", "TS", settings)
},
display: (settings) => {
console.log("displaying... ", "TS", settings)
return <div>TS</div>
}
},
Expand All @@ -36,6 +37,7 @@ export const pipeStep = {
console.log("executing... ", "IMAGE", settings)
},
display: (settings) => {
console.log("displaying... ", "IMAGE", settings)
return <div>IMAGE</div>
}
},
Expand All @@ -44,6 +46,7 @@ export const pipeStep = {
console.log("executing... ", "TEXT", settings)
},
display: (settings) => {
console.log("displaying... ", "TEXT", settings)
return <div>TEXT</div>
}
},
Expand All @@ -52,6 +55,7 @@ export const pipeStep = {
console.log("executing... ", "MASTERTABLE", settings)
},
display: (settings) => {
console.log("displaying... ", "MASTERTABLE", settings)
return <div>MASTERTABLE</div>
}
},
Expand All @@ -60,6 +64,7 @@ export const pipeStep = {
console.log("executing... ", "COLRENAME", settings)
},
display: (settings) => {
console.log("displaying... ", "COLRENAME", settings)
return <div>COLRENAME</div>
}
},
Expand All @@ -68,6 +73,7 @@ export const pipeStep = {
console.log("executing... ", "COLDROP", settings)
},
display: (settings) => {
console.log("displaying... ", "COLDROP", settings)
return <div>COLDROP</div>
}
}
Expand Down

0 comments on commit 41d2b6b

Please sign in to comment.