Created
May 20, 2016 18:21
-
-
Save kdeloach/e37a0d3dd805b86d4a427e602df16423 to your computer and use it in GitHub Desktop.
Run GWLF-E model from sparse dict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
from __future__ import division | |
import sys | |
import json | |
import logging | |
from StringIO import StringIO | |
from gwlfe import gwlfe, parser | |
def main(): | |
log = logging.getLogger('gwlfe') | |
log.setLevel(logging.DEBUG) | |
ch = logging.StreamHandler() | |
log.addHandler(ch) | |
mapshed_data = json.load(open('mapshed_data.json', 'r')) | |
z = parser.DataModel(mapshed_data) | |
output = StringIO() | |
writer = parser.GmsWriter(output) | |
writer.write(z) | |
output.seek(0) | |
reader = parser.GmsReader(output) | |
z = reader.read() | |
result = gwlfe.run(z) | |
print(json.dumps(result, indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment