Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

logging and error resiliance #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ErichBSchulz
Copy link

I encountered some glitches with merging data (and issues finding the range of available data)

this patch simply makes the fetch a bit more robust

fwitw this is my client code:

from opennempy import web_api

regions = ['nsw1', 'qld1', 'sa1','tas1','vic1']

def getdata(d1, d2, regions,
      data_dir = 'data',
      logger = False, log_level = logging.INFO
    ):
    print('data_dir:', data_dir)
    web_api.data_dir = data_dir
    if logger:
      web_api.log.addHandler(logger)
    web_api.log.setLevel(log_level)
    print('data_dir:', data_dir)
    for region in regions:
        print('getting',d1, d2, region)
        df_5, df_30 = web_api.load_data(
            d1 = d1, # datetime.datetime(2018,3,4),
            d2 = d2, # datetime.datetime(2018,4,19),
            region=region)
        print('got df_5, df_30', len(df_5), len(df_30), 'rows')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant