From f63b82561cc6a84174c39876cf14cf42748b7cee Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Tue, 31 May 2022 15:37:58 +0200 Subject: [PATCH 1/2] use quantity instead of Unit in sink reader --- setup.cfg | 2 +- src/osyris/io/sink.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index e349711f..3a8dee35 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = osyris -version = 2.9.0 +version = 2.9.1 author = Neil Vaytet author_email = neil.vaytet@esss.se description = A package to visualize AMR data from the RAMSES code diff --git a/src/osyris/io/sink.py b/src/osyris/io/sink.py index 7d2b67f5..79c34180 100644 --- a/src/osyris/io/sink.py +++ b/src/osyris/io/sink.py @@ -10,6 +10,7 @@ class SinkReader: + def __init__(self): self.kind = ReaderKind.SINK self.initialized = False @@ -50,7 +51,7 @@ def initialize(self, meta, units, select): else: if all(x in u for x in ["[", "]"]): # Legacy sink format quantities are not in code units - unit_list.append(ureg(u.replace("[", "").replace("]", ""))) + unit_list.append(1.0 * ureg(u.replace("[", "").replace("]", ""))) else: unit_list.append(eval(u.replace(' ', '*'))) From efca1f578a1bba555e32d064e651ab5e8ba36a0d Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Tue, 31 May 2022 15:42:51 +0200 Subject: [PATCH 2/2] yapf --- src/osyris/io/sink.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/osyris/io/sink.py b/src/osyris/io/sink.py index 79c34180..576fd7e1 100644 --- a/src/osyris/io/sink.py +++ b/src/osyris/io/sink.py @@ -10,7 +10,6 @@ class SinkReader: - def __init__(self): self.kind = ReaderKind.SINK self.initialized = False