edf2csv 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -18,7 +18,7 @@ import process from 'node:process';
18
18
  import { EdfError } from './edf/errors.js';
19
19
  import { EdfFile } from './edf/reader.js';
20
20
  import { buildPlan, withoutFileRateWarning } from './convert/plan.js';
21
- import { ConversionError, USAGE_ERROR_CODES, auditStdout, convert, defaultOutputDir, describeFsError, descriptionDiagnostics, durationDiagnostics, requestedAnnotationWindow, noAnnotations, noSignalFile, stdoutRefusal, } from './convert/run.js';
21
+ import { ConversionError, USAGE_ERROR_CODES, auditStdout, convert, defaultOutputDir, describeFsError, descriptionDiagnostics, emptyAnnotations, durationDiagnostics, requestedAnnotationWindow, noAnnotations, noSignalFile, stdoutRefusal, } from './convert/run.js';
22
22
  import { ChannelSelectionError } from './convert/channels.js';
23
23
  // Shared with the library so a bad option is the same error whichever way it arrived.
24
24
  import { MAX_DECIMALS, OptionError } from './convert/options.js';
@@ -926,6 +926,17 @@ async function showInfo(input, shared, asJson, jsonIndent, batch = false, toStdo
926
926
  // And what those descriptions carry; see descriptionDiagnostics. Only reached where the
927
927
  // events have been read, which is the same set of files the duration warnings cover.
928
928
  plan.diagnostics.push(...descriptionDiagnostics(annotationData.annotations, eventWindow));
929
+ /*
930
+ And the empty-table warning, where the count is in hand to raise it from.
931
+
932
+ `knownEvents` is null on a continuous file, whose annotation channel is read only as far
933
+ as its origin — so `--info` cannot say this about one and does not guess. On a
934
+ discontinuous file the whole channel has been read, and this is what the conversion
935
+ will say, predicted before it runs.
936
+ */
937
+ if (!plan.writeSignals && knownEvents === 0) {
938
+ plan.diagnostics.push(emptyAnnotations(annotationData.annotations.length, eventWindow));
939
+ }
929
940
  /*
930
941
  And the warning about the signal file this conversion would not write.
931
942