Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant