Skip to content

Commit

Permalink
Merge pull request #120 from UW-SASWE/bugfix_v3.0.14
Browse files Browse the repository at this point in the history
Bugfix v3.0.14 (Resolves #119)
  • Loading branch information
SanchitMinocha authored Nov 30, 2024
2 parents fcff597 + 70a8602 commit e4e8e71
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/rat/cli/rat_test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import date

DOWNLOAD_LINK_DROPBOX = {
'test_data': "https://www.dropbox.com/scl/fi/f1pnyz9mo178kweh3agtf/test_data.zip?dl=1&rlkey=qxvsfrhc2li55dh4yj4a03bq2"
Expand Down Expand Up @@ -93,8 +93,8 @@
'basin_name': 'gunnison',
'basin_id': 0,
'spin_up': False,
'start': datetime(2022, 1, 1),
'end': datetime(2022, 1, 31),
'start': date(2022, 1, 1),
'end': date(2022, 1, 31),
},

'VIC': {
Expand Down Expand Up @@ -124,8 +124,8 @@
'basin_name': 'Nueces',
'basin_id': 4223,
'spin_up': False,
'start': datetime(2022, 8, 1),
'end': datetime(2022, 8, 31),
'start': date(2022, 8, 1),
'end': date(2022, 8, 31),
},

'VIC': {
Expand Down
4 changes: 2 additions & 2 deletions src/rat/data_processing/newdata_low_latency.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pandas as pd
from logging import getLogger

from plugins.forecasting.forecasting import get_gefs_precip
from plugins.forecasting.forecasting import get_GFS_data
from rat.plugins.forecasting.forecasting import get_gefs_precip
from rat.plugins.forecasting.forecasting import get_GFS_data
from rat.utils.logging import LOG_NAME, LOG_LEVEL, NOTIFICATION

# Getting the log-level 2
Expand Down
18 changes: 11 additions & 7 deletions src/rat/run_rat.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from contextlib import redirect_stderr
from io import StringIO
import datetime
import copy
import os

import pandas as pd
import numpy as np
import yaml
import os
import argparse
import configparser
import ee
import ruamel_yaml as ryaml
from pathlib import Path
import datetime
import copy
from dask.distributed import Client, LocalCluster

from rat.utils.logging import init_logger,close_logger,LOG_LEVEL1_NAME
Expand Down Expand Up @@ -60,11 +63,12 @@ def run_rat(config_fn, operational_latency=None ):
secrets.read(config['CONFIDENTIAL']['secrets'])
ee_configuration.service_account = secrets["ee"]["service_account"]
ee_configuration.key_file = secrets["ee"]["key_file"]
ee_credentials = ee.ServiceAccountCredentials(ee_configuration.service_account,ee_configuration.key_file)
ee.Initialize(ee_credentials)
with StringIO() as fake_stderr, redirect_stderr(fake_stderr):
ee_credentials = ee.ServiceAccountCredentials(ee_configuration.service_account,ee_configuration.key_file)
ee.Initialize(ee_credentials)
log.info("Connected to earth engine succesfully.")
except:
log.info("Failed to connect to Earth engine. Wrong credentials. If you want to use Surface Area Estimations from RAT, please update the EE credentials.")
except Exception as e:
log.error(f"Failed to connect to Earth Engine. RAT will not be able to use Surface Area Estimations. Error: {e}")

############################ ----------- Single basin run ---------------- ######################################
if(not config['GLOBAL']['multiple_basin_run']):
Expand Down

0 comments on commit e4e8e71

Please sign in to comment.