-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a draft PR for compiling AgML using python 3. There were only a few types of changes needed to get AgML to run under python 3. 1) Python 3 requires () in print and presumably assert statements. 2) Exceptions have been moved from the "exceptions" to the "builtins" module. 3) Python 3 needs the full path to the module, even if we are importing the module from a module in the same directory. 4) Python 3 requires consistent use of spaces vs tabs for indentation purposes (showed up in one file... I think when I went on a quest for a new editor... as if emacs and vi are not enough.) 5) Python3 has changed dictionaries. The iteritems() method is removed. The iter() method, which is common between python 2 and 3, should be used instead. (Slightly slower... and return list may now be bound differently between python2 and 3...) 5a) Minor issue w/ using "pop" to access dictionary keys resulting from above... get was a perfectly good substitute 6) And there is something in the legacy compat pams/geometry/tpcegeo/tpcegeo.g file that throws a unicode error. Ignoring the error seems to fix the problem w/ no observable difference in the output. The refactoring above may or may not leave the geometry model invariant. It is sufficient to show that the output of the AgML codes is identical, up to whitespace differences and irrelevant re-orderings of declaration statements. On the c++ side, we are good. The codes produced using python2 is equivalent to the python3 code. Some differences are observed in the order in which (for instance) shape parameters are output. This is a consequence of the change from iteritems() to iter()... and if I took the python2 output from after the refactoring, I would probably not even see this difference. On the Mortran side, we have additional differences. The rules for breaking lines at column 72 seem to be broken. Will need to solve this problem before converting this from draft. --------- Co-authored-by: Dmitri Smirnov <[email protected]> Co-authored-by: Yuri Fisyak <[email protected]>
- Loading branch information
1 parent
f8a6955
commit e266c8b
Showing
10 changed files
with
92 additions
and
221 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
Oops, something went wrong.