From ebb154cda191756a7580125fb19e10c74b3f652d Mon Sep 17 00:00:00 2001 From: bnb32 Date: Thu, 27 Jun 2024 10:30:03 -0600 Subject: [PATCH] tf run eagerly to get accurate pytest-cov report on solar model --- tests/training/test_train_gan_dc.py | 4 +--- tests/training/test_train_solar.py | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/training/test_train_gan_dc.py b/tests/training/test_train_gan_dc.py index 3e46a5e104..9b62f8ca79 100644 --- a/tests/training/test_train_gan_dc.py +++ b/tests/training/test_train_gan_dc.py @@ -11,9 +11,7 @@ DataHandlerH5, ) from sup3r.utilities.loss_metrics import MmdMseLoss -from sup3r.utilities.pytest.helpers import ( - BatchHandlerTesterDC, -) +from sup3r.utilities.pytest.helpers import BatchHandlerTesterDC TARGET_COORD = (39.01, -105.15) FEATURES = ['u_100m', 'v_100m'] diff --git a/tests/training/test_train_solar.py b/tests/training/test_train_solar.py index 9e3c765376..9d16ec4d94 100644 --- a/tests/training/test_train_solar.py +++ b/tests/training/test_train_solar.py @@ -6,6 +6,7 @@ import numpy as np import pytest +import tensorflow as tf from tensorflow.keras.losses import MeanAbsoluteError from sup3r import CONFIG_DIR @@ -16,6 +17,9 @@ FEATURES_S = ['clearsky_ratio', 'ghi', 'clearsky_ghi'] TARGET_S = (39.01, -105.13) +# added to get accurate pytest-cov report on tf.function +tf.config.run_functions_eagerly(True) + def test_solar_cc_model(): """Test the solar climate change nsrdb super res model.