edf2csv 0.9.6 → 0.9.8

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.
@@ -1706,6 +1706,22 @@ export function withSignalTableUnwritten(diagnostics, writesSignals, gzip) {
1706
1706
  'physical minimum and maximum in the order the header gives them, inversion included.',
1707
1707
  };
1708
1708
  }
1709
+ /*
1710
+ And the record this one could not place, which is timed from its neighbours in a signal
1711
+ table and nowhere else. Its events are exported whatever its position is: an onset is
1712
+ read off the event, not off the record it sits in, and `record_index` still names that
1713
+ record.
1714
+ */
1715
+ if (diagnostic.hint?.startsWith('That record is timed as if') === true ||
1716
+ diagnostic.hint?.startsWith('Those records are timed as if') === true) {
1717
+ const one = diagnostic.hint.startsWith('That record');
1718
+ return {
1719
+ ...diagnostic,
1720
+ hint: `--annotations-only writes no signal rows, so nothing is timed from ${one ? 'that record' : 'those records'}. ` +
1721
+ `The events in ${one ? 'it' : 'them'} carry their own onsets, and ` +
1722
+ `${annotationsFile}'s record_index still names ${one ? 'it' : 'them'}.`,
1723
+ };
1724
+ }
1709
1725
  if (diagnostic.code !== 'DISCONTINUOUS' || diagnostic.hint === undefined)
1710
1726
  return diagnostic;
1711
1727
  if (diagnostic.hint.startsWith('Each row carries its true recording time')) {
@@ -1729,6 +1745,50 @@ export function withSignalTableUnwritten(diagnostics, writesSignals, gzip) {
1729
1745
  hint: '--annotations-only writes no signal rows, so no sample times are written at all.',
1730
1746
  };
1731
1747
  }
1748
+ /*
1749
+ And the three that say the times are written as if the records were contiguous, which
1750
+ this pass had not been shown.
1751
+
1752
+ Those are the answers for a file whose record positions are not recorded, or are
1753
+ contradicted by its own `EDF+C` marker — and they describe a time column. An
1754
+ `--annotations-only` run writes none, so all three promise something about rows it does
1755
+ not write:
1756
+
1757
+ warning: This file is marked continuous (EDF+C), but 1 of its 3 data records says
1758
+ it starts somewhere other than where continuity puts it.
1759
+ Times are written as if the records were contiguous, which is what EDF+C
1760
+ means. ...
1761
+ warning: This file is marked discontinuous but has no annotation channel, so where
1762
+ its records sit in time is not recorded anywhere.
1763
+ Times are written as if the records were contiguous. Any gaps are lost.
1764
+
1765
+ over an annotations.csv holding its header and no rows. The three sentences above this
1766
+ one were amended for exactly this at 0.8.x; these were the DISCONTINUOUS hints that do
1767
+ not begin with any of their phrases.
1768
+
1769
+ What the header says about itself is still worth saying, so the messages stay. Only the
1770
+ clause about what a conversion makes of it was false, and what is true instead is that
1771
+ the events carry their own onsets whatever the records do.
1772
+ */
1773
+ if (diagnostic.hint.startsWith('Times are written as if the records were contiguous')) {
1774
+ return {
1775
+ ...diagnostic,
1776
+ hint: '--annotations-only writes no signal rows, so no times are written from the ' +
1777
+ `records at all. ${annotationsFile} carries each event's own onset, which the ` +
1778
+ 'records do not decide.',
1779
+ };
1780
+ }
1781
+ // The marker warning's hint, which `withTimingPromiseKept` has already rewritten once and
1782
+ // which points at the warning under it. That pointer is still right and is what separates
1783
+ // the two, so it is the clause about the time column that goes and not the sentence.
1784
+ if (diagnostic.hint.startsWith('Where its records sit in time is not recorded in this file')) {
1785
+ return {
1786
+ ...diagnostic,
1787
+ hint: 'Where its records sit in time is not recorded in this file, and ' +
1788
+ '--annotations-only writes no signal rows to time from them anyway — see the ' +
1789
+ 'warning below.',
1790
+ };
1791
+ }
1732
1792
  return diagnostic;
1733
1793
  });
1734
1794
  }