From bfce477eac1017af0fc59c76ef6a60333dd7a4e5 Mon Sep 17 00:00:00 2001 From: Peter Nemere Date: Wed, 22 Nov 2023 10:00:52 +1000 Subject: [PATCH] Fixing breadboard importer crash for Joel with < 10 spectra in zip, also less verbose logging, not logging file name of each msa file --- data-import/data-converter/converter.go | 4 ++-- data-import/internal/data-converters/jplbreadboard/spectra.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data-import/data-converter/converter.go b/data-import/data-converter/converter.go index 407d1df8..ea04525f 100644 --- a/data-import/data-converter/converter.go +++ b/data-import/data-converter/converter.go @@ -260,9 +260,9 @@ func SelectImporter(localFS fileaccess.FileAccess, remoteFS fileaccess.FileAcces } log.Infof("SelectImporter: Path contains %v files...", len(items)) - for c, item := range items { + /*for c, item := range items { log.Infof(" %v. %v", c+1, item) - } + }*/ // Check if it's a combined dataset combinedFiles, _ /*imageFileNames*/, _ /*combinedFile1Meta*/, _ /*combinedFile2Meta*/, err := combined.GetCombinedBeamFiles(importPath, log) diff --git a/data-import/internal/data-converters/jplbreadboard/spectra.go b/data-import/internal/data-converters/jplbreadboard/spectra.go index 5216c019..c16ce64e 100644 --- a/data-import/internal/data-converters/jplbreadboard/spectra.go +++ b/data-import/internal/data-converters/jplbreadboard/spectra.go @@ -126,6 +126,9 @@ func makeSpectraLookup(inputpath string, spectraFiles []string, singleDetectorMS spectraLookup := make(dataConvertModels.DetectorSampleByPMC) reportInterval := len(spectraFiles) / 10 + if reportInterval == 0 { + reportInterval = 1 + } c := 1 for idx, f := range spectraFiles {