Skip to content

Commit

Permalink
tf run eagerly to get accurate pytest-cov report on solar model
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb32 committed Jun 27, 2024
1 parent aca9fc7 commit ebb154c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions tests/training/test_train_gan_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 4 additions & 0 deletions tests/training/test_train_solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit ebb154c

Please sign in to comment.