Skip to content

Commit

Permalink
feat: update nmr-load-save
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Nov 6, 2023
1 parent 565fb92 commit 39669b4
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 77 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"ml-stat": "^1.3.3",
"multiplet-analysis": "^2.1.2",
"nmr-correlation": "^2.3.3",
"nmr-load-save": "^0.22.4",
"nmr-load-save": "^0.23.0",
"nmr-processing": "^11.4.1",
"nmredata": "^0.9.7",
"numeral": "^2.0.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useFormikContext } from 'formik';
import { OnLoadProcessing, WorkspacePreferences } from 'nmr-load-save';
import { WorkspacePreferences } from 'nmr-load-save';
import { BaseFilter } from 'nmr-processing';
import { useState } from 'react';
import { TabItem, Tabs } from 'react-science/ui';

Expand Down Expand Up @@ -37,7 +38,7 @@ function OnLoadProcessingTabContent() {
}

function FiltersTable({ data, nucleus }) {
const COLUMNS: Array<CustomColumn<OnLoadProcessing>> = [
const COLUMNS: Array<CustomColumn<BaseFilter>> = [
{
index: 1,
Header: '#',
Expand Down
6 changes: 4 additions & 2 deletions src/component/reducer/actions/LoadActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function setData(
) {
const {
nmriumState: { data, view },
onLoadProcessing = {},
onLoadProcessing = { autoProcessing: true },
parseMetaFileResult = null,
} = input || {
nmriumState: { data: { spectra: [], molecules: [], correlations: {} } },
Expand Down Expand Up @@ -133,7 +133,9 @@ function setData(
draft.data = draft.data.concat(
initSpectra(spectra, {
usedColors: draft.usedColors,
onLoadProcessing: autoOnLoadProcessing ? onLoadProcessing : {},
onLoadProcessing: autoOnLoadProcessing
? onLoadProcessing
: { autoProcessing: true },
molecules: draft.molecules,
}),
);
Expand Down
1 change: 1 addition & 0 deletions src/component/workspaces/exercise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const exercise: InnerWorkspace = {
verticalSplitterCloseThreshold: 600,
spectraRendering: 'auto',
loggingLevel: 'info',
invert: false,
},
formatting: {
nuclei: {},
Expand Down
1 change: 1 addition & 0 deletions src/component/workspaces/prediction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const prediction: InnerWorkspace = {
verticalSplitterCloseThreshold: 600,
spectraRendering: 'auto',
loggingLevel: 'info',
invert: false,
},
display: {
panels: {
Expand Down
1 change: 1 addition & 0 deletions src/component/workspaces/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const simulation: InnerWorkspace = {
verticalSplitterCloseThreshold: 600,
spectraRendering: 'auto',
loggingLevel: 'info',
invert: false,
},
display: {
panels: {
Expand Down
132 changes: 68 additions & 64 deletions src/component/workspaces/workspaceDefaultProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const workspaceDefaultProperties: Required<WorkspacePreferences> = {
verticalSplitterCloseThreshold: 600,
spectraRendering: 'auto',
loggingLevel: 'info',
invert: false,
},
formatting: {
nuclei: {
Expand Down Expand Up @@ -121,76 +122,79 @@ export const workspaceDefaultProperties: Required<WorkspacePreferences> = {
],
},
onLoadProcessing: {
'1H': [
{
name: Filters.digitalFilter.id,
label: Filters.digitalFilter.name,
value: {},
flag: true,
},
{
name: Filters.apodization.id,
label: Filters.apodization.name,
value: {},
flag: false,
},
{
name: Filters.zeroFilling.id,
label: Filters.zeroFilling.name,
autoProcessing: true,
filters: {
'1H': [
{
name: Filters.digitalFilter.id,
label: Filters.digitalFilter.name,
value: {},
flag: true,
},
{
name: Filters.apodization.id,
label: Filters.apodization.name,
value: {},
flag: false,
},
{
name: Filters.zeroFilling.id,
label: Filters.zeroFilling.name,

value: {},
flag: true,
},
{
name: Filters.fft.id,
label: Filters.fft.name,
value: {},
flag: true,
},
{
name: Filters.fft.id,
label: Filters.fft.name,

value: {},
flag: true,
},
{
name: Filters.phaseCorrection.id,
label: Filters.phaseCorrection.name,
value: {},
flag: true,
},
{
name: Filters.phaseCorrection.id,
label: Filters.phaseCorrection.name,

value: {},
flag: true,
},
],
'13C': [
{
name: Filters.digitalFilter.id,
label: Filters.digitalFilter.name,
value: {},
flag: true,
},
],
'13C': [
{
name: Filters.digitalFilter.id,
label: Filters.digitalFilter.name,

value: {},
flag: true,
},
{
name: Filters.apodization.id,
label: Filters.apodization.name,
value: {},
flag: true,
},
{
name: Filters.zeroFilling.id,
label: Filters.zeroFilling.name,
value: {},
flag: true,
},
{
name: Filters.apodization.id,
label: Filters.apodization.name,
value: {},
flag: true,
},
{
name: Filters.zeroFilling.id,
label: Filters.zeroFilling.name,

value: {},
flag: true,
},
{
name: Filters.fft.id,
label: Filters.fft.name,
value: {},
flag: true,
},
{
name: Filters.fft.id,
label: Filters.fft.name,

value: {},
flag: true,
},
{
name: Filters.phaseCorrection.id,
label: Filters.phaseCorrection.name,
value: {},
flag: true,
},
{
name: Filters.phaseCorrection.id,
label: Filters.phaseCorrection.name,

value: {},
flag: true,
},
],
value: {},
flag: true,
},
],
},
},
};

0 comments on commit 39669b4

Please sign in to comment.