Skip to content

Commit

Permalink
Dev add and delete columns (#223)
Browse files Browse the repository at this point in the history
* Added a general seed for random number generation in the settings
* Added the python executable path that is retrieved automatically to the settings tab
* New Delete Columns tool in the input module for the removal of columns from a dataset
* New Transform Columns tool in the input module for the NaN values handling, either with a binary approach or by setting the NaN values to zero
  • Loading branch information
NicoLongfield authored Feb 7, 2024
1 parent 974126f commit 2843756
Show file tree
Hide file tree
Showing 8 changed files with 922 additions and 11 deletions.
Binary file modified go_server/main
Binary file not shown.
35 changes: 29 additions & 6 deletions main/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,39 @@ if (isProd) {
function getPythonEnvironment() {
// Returns the python environment
let pythonEnvironment = process.env.MED_ENV

// Retrieve the path to the conda environment from the settings file
let userDataPath = app.getPath("userData")
let settingsFilePath = path.join(userDataPath, "settings.json")
let settingsFound = fs.existsSync(settingsFilePath)
let settings = {}
if (settingsFound) {
let settings = JSON.parse(fs.readFileSync(settingsFilePath, "utf8"))
// Check if the conda environment is defined in the settings file
if (settings.condaPath !== undefined) {
pythonEnvironment = settings.condaPath
}
}

if (pythonEnvironment === undefined) {
let userPath = process.env.HOME
let anacondaPath = getCondaPath(userPath)
if (anacondaPath !== null) {
// If a python environment is found, the path to the python executable is returned
if (checkCondaEnvs(anacondaPath).includes(medCondaEnv)) {
pythonEnvironment = getThePythonExecutablePath(anacondaPath, medCondaEnv)
if (pythonEnvironment === undefined || pythonEnvironment === null) {
let userPath = process.env.HOME
let anacondaPath = getCondaPath(userPath)
if (anacondaPath !== null) {
// If a python environment is found, the path to the python executable is returned
if (checkCondaEnvs(anacondaPath).includes(medCondaEnv)) {
pythonEnvironment = getThePythonExecutablePath(anacondaPath, medCondaEnv)
}
}
}
}
// If the python environment is found, the conda path is saved in the settings file if it is not already defined
if (pythonEnvironment !== undefined && pythonEnvironment !== null) {
if (settingsFound && settings.condaPath === undefined) {
settings.condaPath = pythonEnvironment
fs.writeFileSync(settingsFilePath, JSON.stringify(settings))
}
}
return pythonEnvironment
}

Expand Down
Loading

0 comments on commit 2843756

Please # to comment.