From b552615d32b805cb4554fdd7793c43638443a917 Mon Sep 17 00:00:00 2001 From: tjlane Date: Mon, 28 Oct 2024 15:18:27 +0100 Subject: [PATCH] clear warnings --- meteor/scripts/common.py | 3 ++- test/unit/scripts/test_common.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meteor/scripts/common.py b/meteor/scripts/common.py index b10fb59..bdff820 100644 --- a/meteor/scripts/common.py +++ b/meteor/scripts/common.py @@ -7,6 +7,7 @@ from enum import StrEnum, auto from pathlib import Path from typing import Any +from io import StringIO import numpy as np import pandas as pd @@ -328,6 +329,6 @@ def write_combined_metadata( def read_combined_metadata(*, filename: Path) -> tuple[pd.DataFrame, TvDenoiseResult]: with filename.open("r") as f: combined_metadata = json.load(f) - it_tv_metadata = pd.read_json(combined_metadata["iterative_tv"]) + it_tv_metadata = pd.read_json(StringIO(combined_metadata["iterative_tv"])) final_tv_metadata = TvDenoiseResult.from_json(combined_metadata["final_tv_pass"]) return it_tv_metadata, final_tv_metadata diff --git a/test/unit/scripts/test_common.py b/test/unit/scripts/test_common.py index a8e0237..aa9aa01 100644 --- a/test/unit/scripts/test_common.py +++ b/test/unit/scripts/test_common.py @@ -146,7 +146,8 @@ def test_kweight_diffmap_according_to_mode( mode: WeightMode, diffmap_set: DiffMapSet, fixed_kparameter: float ) -> None: # ensure the two maps aren't exactly the same to prevent numerical issues - diffmap_set.derivative.amplitudes.iloc[0] += 1.0 + print("***", diffmap_set.derivative.columns) + diffmap_set.derivative.loc[0, diffmap_set.derivative._amplitude_column] += 1.0 diffmap, _ = kweight_diffmap_according_to_mode( mapset=diffmap_set, kweight_mode=mode, kweight_parameter=fixed_kparameter