From e3a5fcbaaf1cf2cefd2295e306fffde77f183083 Mon Sep 17 00:00:00 2001
From: Yngve Levinsen <yngve.levinsen@esss.se>
Date: Mon, 20 Jan 2020 15:41:17 +0100
Subject: [PATCH] looks to me like the number of bytes in density file has
 changed

---
 ess/TraceWin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ess/TraceWin.py b/ess/TraceWin.py
index f8b7a9a..3f8f7e5 100644
--- a/ess/TraceWin.py
+++ b/ess/TraceWin.py
@@ -725,7 +725,7 @@ class density_file:
             year = numpy.fromfile(self.fin, dtype=numpy.int16, count=1)[0]
         if shift:
             print(year, version)
-            raise ValueError("ERROR, shifted " + str(shift * 2) + " bytes")
+            raise ValueError(f"ERROR, shifted {shift + 2} bytes")
 
         self.vlong = numpy.fromfile(self.fin, dtype=numpy.int16, count=1)[0]
         self.Nrun = numpy.fromfile(self.fin, dtype=numpy.int32, count=1)[0]
@@ -762,7 +762,7 @@ class density_file:
             else:
                 raise TypeError(f"It is not possible to read {self.filename}")
         elif self.version == 8:
-            numpy.fromfile(self.fin, dtype=numpy.int16, count=12344 // 2)
+            numpy.fromfile(self.fin, dtype=numpy.int16, count=8344 // 2)
         elif self.version == 9:
             numpy.fromfile(self.fin, dtype=numpy.int16, count=12352 // 2)
         elif self.version == 10:
-- 
GitLab