Commit fc4cfec
Benjamin Moody
Record.wrsamp: always set checksums to correct values.
When writing a record, the application generally shouldn't have to
worry about details like calculating checksums. The wfdb
package *should* ensure that the output files it generates are
correct, and *should not* trust applications to calculate checksums
correctly.
Moreover, although it was originally intended for SignalMixin.wr_dats
to verify that the application-supplied checksums were correct, this
never actually worked, and existing test cases depend on that fact.
So it is not reasonable for wr_dats to raise an exception if the
checksums are wrong.
Instead, update the checksums in the Record object when wrsamp is
called (and note that we have to do this before calling wrheader,
which is called before wr_dats).
For compatibility with old test cases, that expect to be able to read
and write records quasi-unmodified, we don't set checksums for signals
that previously had a checksum of None, or that previously had a
checksum that was correct mod 2**16.1 parent 768d833 commit fc4cfec
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
925 | 935 | | |
926 | 936 | | |
927 | 937 | | |
| |||
0 commit comments