This file contains 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
import re | |
def resolve(template, context): | |
"""Quick and dirty template resolver, replacing {{ }} with context's values | |
For example, {{foo.bar}} is replaced with foo.bar's value, provided "foo" | |
is variable passed in context. | |
Args: | |
template (str) | |
Templated string for which will we substitue in templated values |
This file contains 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
""" | |
DataFrameTable | |
============== | |
Quick and Dirty Qt app to view pandas DataFrames. Includes sorting and | |
filterting. | |
Based on qtpandas in pandas sandbox module, by Jev Kuznetsov | |
Usage: |
This file contains 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
""" | |
Take a girn output and find the commits and PRs that caused that code | |
to be added. | |
""" | |
# Find all PRs that brought in future warnings | |
# for https://github.com/pydata/pandas/issues/6641 | |
# Make sure you have a copy of all the PRs in your upstream | |
# See: |
This file contains 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
""" | |
Allow the simple creation of kivy UIs for arbitrary python object. The UI | |
will automatically update as the underlying python model changes, provided any | |
function on the UI side that changes the underlying data model use the | |
"update" decorator. | |
""" | |
import kivy | |
kivy.require('1.7.0') |
This file contains 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
def raisePsspyError(psspyFunc): | |
"""This decorator raises a python exception whenever a psspy | |
function returns an ierr that is not 0. """ | |
def callPsspyFunc(*args, **kwargs): | |
ans = psspyFunc(*args, **kwargs) | |
if type(ans) is tuple: | |
ierr = ans[0] # ierr is always first element of tuple | |
elif type(ans) is int: | |
ierr = ans # function only returns ierr | |
else: |