-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Python2 compatibility issues in new workspace/reports. Cleans u…
…p factory.py. Adds a new "compattools.py" file with "isstr" and "isint" function to properly check if something is an integer or string in Python2 or Python3 (the issues involved are that Python2 has a 'long' type that Python3 doesn't, and in Python3 the default string type is unicode). These new functions have been added throughout pyGSTi to replace isinstance(x, int) and isinstance(x, str) and variants thereof to give better Python2 compatibility across the board. Such comparisons are especially relevant to the reporting code. Fixes a bug with using the 'exec' statement within Python2 -- (you can't use 'exec' in a function which contains nested functions unless you specify the locals). Consolidates code within factory.py, adding some internal subroutines and making _merge_template do more processing (e.g. inlining CSS files). Additional linlogPercentage and errgen_type parameters added to factory functions, so start moving away from having "display options" contained in a Results object. Adds precision argument to WorkspaceTable's render() function, which should later get plumbed up to an argument of the factory functions. All of the recently added tutorials now run using a python2 kernel, which is the closest thing we have to a python2 test at this point.
- Loading branch information
Erik Nielsen
committed
Apr 3, 2017
1 parent
0949285
commit 1a98c84
Showing
23 changed files
with
337 additions
and
295 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.