MEDomicsLab-docs
V1
V1
  • πŸ‘‹Welcome!
  • πŸ‘ŠQuick start
  • πŸ‘€Overview
  • 🏫Tutorials
    • πŸ”΅Design
      • Extraction Module
        • Image Extraction Page
        • Text Extraction Page
        • Time Series Extraction Page
        • MEDimage
      • Input Module
        • Feature Reduction Tool
        • MEDprofiles
          • MEDprofiles Viewer
      • Exploratory Module
    • 🟠Development
      • Learning Module
      • Evaluation Module
    • 🟒Deployment
      • Application Module
  • πŸ†•New features
  • Upcoming features
  • πŸ’»Contributing
    • Our coding standards
    • How to push my modification ?
  • πŸ€•Troubleshooting
  • ❓FAQ
  • πŸ€“About us
  • Important Links
    • Official Website
    • πŸ“”Release Notes
    • πŸ₯²Known Issues
    • 😎Project Board
    • 🧬Physionet
  • MEDIA
    • βš›οΈMEDomics
    • πŸ‘ΎDiscord
    • 😺Github
    • πŸ“ΊYouTube
  • Forms
    • πŸ—£οΈContact us
    • πŸ“Report an issue
Powered by GitBook
On this page
  • MEDomicsLab coding standards
  • Table of contents
  • Recommended Software
  • Project Repository Structure
  • Style
  • Naming Conventions
  • Components Structure
  • Setup of eslint and prettier
  • Documentation
  • Python Coding Standard
Edit on GitHub
  1. Contributing

Our coding standards

PreviousContributingNextHow to push my modification ?

Last updated 5 months ago

MEDomicsLab coding standards

Table of contents

Recommended Software

  • Windows (10 /11 +), macOs (12 +), Linux (20.04 +)

  • extensions:

  • - code formatter standardizer (see syntax)

  • Framework used in the platform

    • - Library manager for javascript language

    • - Web based programming for standalone app developpement

    • - Abstraction of adding server side rendering and optimisations

    • - Server side language

Project Repository Structure

Folder
Description

/app

Electron files

/baseFiles

Empty base files

/build

Contains distribution relative files

/go_server

Contains Go code acting as a server

/main

Electron related contents

/node_modules

Contains saved libraries (created from npm install)

/pythonCode

Python code

/pythonEnv

Python virtual environment utils

/renderer

NextJs related content

/resources

NextJs ressources (icons, etc.)

/utilScripts

NextJs ressources (icons, etc.)

Style

  • Import order (_app.js)

import  'bootstrap/dist/css/bootstrap.min.css';
import <all  other  global  css  libraries>

Naming Conventions

Javascript/react

  • Component : PascalCase

  • Component file name : camelCase

  • Each file name should be the same as the component defined inside

  • Component creation : prioritize function implementation over class

export  default  const  MyComponent = (someProps) =Β­> {
return (<></>)
}
  • Function creation: prioritize arrow implementation

const  myFct = (someParams) =Β­> {}

Components Structure

Directory tree of the application components
components
β”œβ”€β”€β”€dataTypeVisualisation
β”‚       dataTablePopoverBPClass.jsx
β”‚       dataTableWrapper.jsx
β”‚       dataTableWrapperBPClass.tsx
β”‚
β”œβ”€β”€β”€evaluation
β”‚       dashboard.jsx
β”‚       evaluationPageContent.jsx
β”‚       pageConfig.jsx
β”‚       pageEval.jsx
β”‚       predictPanel.jsx
β”‚
β”œβ”€β”€β”€extractionImage
β”‚   β”‚   extractionJPG.jsx
β”‚   β”‚
β”‚   └───extractionTypes
β”‚           extractionDenseNet.jsx
β”‚
β”œβ”€β”€β”€extractionMEDimage
β”‚   β”‚   docLink.jsx
β”‚   β”‚   flowCanvas.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€β”€buttonsTypes
β”‚   β”‚       resultsButton.jsx
β”‚   β”‚       viewButton.jsx
β”‚   β”‚
β”‚   └───nodesTypes
β”‚       β”‚   extractionNode.jsx
β”‚       β”‚   featuresNode.jsx
β”‚       β”‚   filterNode.jsx
β”‚       β”‚   segmentationNode.jsx
β”‚       β”‚   standardNode.jsx
β”‚       β”‚
β”‚       β”œβ”€β”€β”€filterTypes
β”‚       β”‚       gaborFilter.jsx
β”‚       β”‚       lawsFilter.jsx
β”‚       β”‚       logFilter.jsx
β”‚       β”‚       meanFilter.jsx
β”‚       β”‚       waveletFilter.jsx
β”‚       β”‚
β”‚       └───standardNodeForms
β”‚               discretizationForm.jsx
β”‚               inputForm.jsx
β”‚               interpolationForm.jsx
β”‚               reSegmentationForm.jsx
β”‚
β”œβ”€β”€β”€extractionTabular
β”‚   β”‚   extractionTabularData.jsx
β”‚   β”‚
β”‚   └───extractionTypes
β”‚           extractionBioBERT.jsx
β”‚           extractionTSfresh.jsx
β”‚
β”œβ”€β”€β”€flow
β”‚   β”‚   btnDiv.jsx
β”‚   β”‚   codeEditor.jsx
β”‚   β”‚   errorRequestDialog.jsx
β”‚   β”‚   flowPageBase.jsx
β”‚   β”‚   groupNode.jsx
β”‚   β”‚   handlers.jsx
β”‚   β”‚   node.jsx
β”‚   β”‚   nodeWrapperResults.jsx
β”‚   β”‚   sidebarAvailableNodes.jsx
β”‚   β”‚   workflowBase.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€β”€context
β”‚   β”‚       flowFunctionsContext.jsx
β”‚   β”‚       flowInfosContext.jsx
β”‚   β”‚       flowResultsContext.jsx
β”‚   β”‚
β”‚   └───results
β”‚           pipelinesResults.jsx
β”‚           resultsPane.jsx
β”‚
β”œβ”€β”€β”€generalPurpose
β”‚       errorRequestContext.jsx
β”‚       loaderContext.jsx
β”‚       progressBarRequests.jsx
β”‚
β”œβ”€β”€β”€input
β”‚       groupingTool.jsx
β”‚       holdOutSetCreationTool.jsx
β”‚       mergeTool.jsx
β”‚       simpleCleaningTool.jsx
β”‚       subsetCreationTool.jsx
β”‚
β”œβ”€β”€β”€layout
β”‚   β”‚   actionContext.jsx
β”‚   β”‚   iconSidebar.jsx
β”‚   β”‚   layoutContext.jsx
β”‚   β”‚   layoutManager.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€β”€flexlayout
β”‚   β”‚       mainContainerClass.tsx
β”‚   β”‚       popout.html
β”‚   β”‚       popupMenu.tsx
β”‚   β”‚       simple.layout
β”‚   β”‚       tabStorage.tsx
β”‚   β”‚       utils.tsx
β”‚   β”‚       zoomPanPinchComponent.jsx
β”‚   β”‚
β”‚   └───sidebarTools
β”‚       β”‚   components.jsx
β”‚       β”‚   fileCreationBtn.jsx
β”‚       β”‚   recursiveChildrenTest.js
β”‚       β”‚
β”‚       β”œβ”€β”€β”€directoryTree
β”‚       β”‚       renderItem.js
β”‚       β”‚       sidebarDirectoryTreeControlled.jsx
β”‚       β”‚       workspaceDirectoryTree.jsx
β”‚       β”‚
β”‚       └───pageSidebar
β”‚               evaluationSidebar.jsx
β”‚               explorerSidebar.jsx
β”‚               extractionSidebar.jsx
β”‚               flowSceneSidebar.jsx
β”‚               homeSidebar.jsx
β”‚               inputSidebar.jsx
β”‚               layoutTestSidebar.jsx
β”‚               searchSidebar.jsx
β”‚
β”œβ”€β”€β”€learning
β”‚   β”‚   checkOption.jsx
β”‚   β”‚   input.jsx
β”‚   β”‚   modalSettingsChooser.jsx
β”‚   β”‚   workflow.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€β”€nodesTypes
β”‚   β”‚       datasetNode.jsx
β”‚   β”‚       loadModelNode.jsx
β”‚   β”‚       optimizeIO.jsx
β”‚   β”‚       selectionNode.jsx
β”‚   β”‚       standardNode.jsx
β”‚   β”‚
β”‚   └───results
β”‚       β”œβ”€β”€β”€node
β”‚       β”‚       analyseResults.jsx
β”‚       β”‚       dataParamResults.jsx
β”‚       β”‚       modelsResults.jsx
β”‚       β”‚       saveModelResults.jsx
β”‚       β”‚
β”‚       └───utilities
β”‚               dataTablePath.jsx
β”‚               parameters.jsx
β”‚
β”œβ”€β”€β”€mainPages
β”‚   β”‚   application.jsx
β”‚   β”‚   evaluation.jsx
β”‚   β”‚   exploratory.jsx
β”‚   β”‚   extractionImage.jsx
β”‚   β”‚   extractionMEDimage.jsx
β”‚   β”‚   extractionText.jsx
β”‚   β”‚   extractionTS.jsx
β”‚   β”‚   home.jsx
β”‚   β”‚   htmlViewer.jsx
β”‚   β”‚   input.jsx
β”‚   β”‚   learning.jsx
β”‚   β”‚   modelViewer.jsx
β”‚   β”‚   output.jsx
β”‚   β”‚   results.jsx
β”‚   β”‚   terminal.jsx
β”‚   β”‚   test.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€β”€dataComponents
β”‚   β”‚       datasetSelector.jsx
β”‚   β”‚       dataTableFromContext.jsx
β”‚   β”‚       dataTableFromContextBP.jsx
β”‚   β”‚       dropzoneComponent.jsx
β”‚   β”‚       dropzoneComponent2.jsx
β”‚   β”‚       listBoxSelector.jsx
β”‚   β”‚       wsSelect.jsx
β”‚   β”‚
β”‚   └───moduleBasics
β”‚           modulePage.jsx
β”‚           pageInfosContext.jsx
β”‚
└───workspace
        dataContext.jsx
        medDataObject.js
        workspaceContext.jsx

To generate this : tree .\renderer\components\ /f

Syntax

(ES6 for JS as mentioned by Electron, for Python Electron follows Chromium's Coding Style)

Installation

  • Install prettier and plugin (should be included in package.json so a npm install should do it) npm install prettier eslint-plugin-prettier eslint-config-prettier

  • Open workspace settings

    • Can be accessed directly from this path: .vscode/settings.json

    • Or press CTRL+SHIFT+P and type Preferences: Open Workspace Settings (JSON)

  • Add these lines

{
  "eslint.options": {
    "overrideConfigFile": ".eslintrc.js"
  },
  "editor.formatOnSave": true,
  "eslint.validate": ["javascript"],
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

Usage

There are 2 config files:

  • eslint -Β­> .eslintrc.js

  • prettier -> .prettierrc.js

A higher priority is placed on Prettier wich handles basic formatting

see config file for more information on what it rules

then, all standards rules are placed in eslint config file. So if you need to add specific rules, it should be in .eslintrc.js file

Use CTRL+S to save and format files. Eslint may triggered error displayed as a red underline so you can hover these conventions error, then click on 'quick fix' and click on 'fix all/the problem(s)'

Documentation

Docstring

/**
* @param  {type}  someParams description
* @return  {type} description
* @description
* functionnal description of the function/React object
*/
const  myfct = (someParams) =Β­> {}

Comments

  • Do not over-detail the code for readability

  • Comments are meant to help understand important or critical actions in code

Documentation generation

Not tested : https://www.npmjs.com/package/react-doc-generator

(Comments, docstrings, documentation generator...)

Python Coding Standard

Use

See

Setup of and

Install and extensions

See .

πŸ’»
css react modules
react naming convention
eslint
prettier
eslint
prettier
MEDomicsTools for Python
see electron app supported OS
Visual Studio Code
prettier & eslint
npmjs
Electron
Nextjs
React
Go
Recommended Software
Project Repository Structure
Style
Naming Conventions
Components Structure
Type Hinting
Syntax
Documentation
Python Coding Standard