nmrium icon indicating copy to clipboard operation
nmrium copied to clipboard

auto processing workflows

Open hamed-musallam opened this issue 5 months ago • 6 comments

To support more flexible auto-processing workflows from the processing panel, we need to refactor the existing structure.

The old structure of the auto processing filters is based on the nucleus type ('1H', '13C')

onLoadProcessing: {
  autoProcessing: true,
  filters: {
    '1H': [ /* array of filters */ ],
    '13C': [ /* array of filters */ ],
  }
} 

The new format introduces a flat list of workflow, where:

  • Each item has a condition (jpath and value)
  • Workflow items are linked using id and parentId to form a hierarchical tree. The system traverses this tree sequentially, performing a value match for each specified jpath. Filters are applied only when they have matching conditions.
onLoadProcessing: {
  autoProcessing: true,
  workflows: [
    {
      id: '1',
      parentId: null,
      jpath: ['info','nucleus'],
      value: '1H',
      enabled: true,
      filters: [ /* array of filters */ ]
    },
    {
      id: '2',
      parentId: '1',
      jpath:['info','x'],
      value: '298K',
      enabled: true,
      filters:[ /* array of filters */ ]
    },
    {
      id: '3',
      parentId: '2',
      jpath: ['info','y'],
      value: 1002,
      enabled: true,
      filters: [ /* array of filters */ ]
    }
  ]
}

hamed-musallam avatar Jul 23 '25 09:07 hamed-musallam

Add a new workflow sketch

Image

hamed-musallam avatar Jul 23 '25 10:07 hamed-musallam

New format autoprocessing pipelines

onLoadProcessing: {
  autoProcessing: true,
  pipelines: [
    {
     id:'1',
     label: 'Pipeline 1',
      enabled: true,
      selectors: [
        { jpath: ['info', 'nucleus'], value: '1H' }
      ],
      filters: [ /* array of filters */ ]
    },
    {
       id:'2',
       label: 'Pipeline 2',
      enabled: true,
      selectors: [
        { jpath: ['info', 'nucleus'], value: '1H' },
        { jpath: ['info', 'x'], value: '298K' }
      ],
      filters: [ /* array of filters */ ]
    },
    {
      id:'3',
      label: 'Pipeline 3',
      enabled: true,
      selectors: [
        { jpath: ['info', 'nucleus'], value: '1H' },
        { jpath: ['info', 'x'], value: '298K' },
        { jpath: ['info', 'y'], value: 1002 }
      ],
      filters: [ /* array of filters */ ]
    }
  ]
}

interface Selector {
  jpath: string[];
  value: string | number;
}

interface Pipeline { 
  id:string;
  label:string;
  enabled: boolean;
  selectors: Selector[]; // ordered by hierarchy
  filters: Filter[];
}

interface OnLoadProcessing {
  autoProcessing: boolean;
  pipelines: Pipeline[];
}

hamed-musallam avatar Aug 05 '25 08:08 hamed-musallam

Image

hamed-musallam avatar Aug 05 '25 09:08 hamed-musallam

How are you doing those sketches ?? They look great !

Maybe I would make the design more horizontal (like most of the screens) and put the selector part and the save button on the right.

lpatiny avatar Aug 05 '25 10:08 lpatiny

@lpatiny Like this

Image

hamed-musallam avatar Aug 05 '25 10:08 hamed-musallam

We need an optional label for the pipeline

Image

hamed-musallam avatar Aug 06 '25 11:08 hamed-musallam