Skip to content

WIP: python 2-3 single codebase - #1064

Closed
vincentarelbundock wants to merge 4 commits into
statsmodels:masterfrom
vincentarelbundock:p23
Closed

vincentarelbundock wants to merge 4 commits into
statsmodels:masterfrom
vincentarelbundock:p23

Conversation

@vincentarelbundock

Copy link
Copy Markdown

Trying to get a more comprehensive list of changes to be made by applying python-mechanize to various folders in the SM tree.

  • from six.moves import zip
  • from six.moves import map
  • map -> list comprehension
  • dot imports
  • xrange -> range
  • from future import print_function
  • from functools import reduce
  • - func_name = func.im_func.func_name
  • + func_name = func.func.name
  • - for meth, how in klass._wrap_methods.iteritems():
  • + for meth, how in six.iteritems(klass._wrap_methods):

Also,

  • Print statements in examples and docstrings

Vincent Arel-Bundock added 2 commits August 26, 2013 09:25
map/zip/dot-import
Comment thread statsmodels/base/data.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugly and not necessary, I think

Vincent Arel-Bundock added 2 commits August 26, 2013 14:39
@vincentarelbundock

Copy link
Copy Markdown
Author

OK, went crazy like you suggested and ran:

find ~/src/statsmodels -type f -name "*.py" | xargs python-modernize -w

See:

https://github.com/vincentarelbundock/statsmodels/commit/8998e1cbaec47b8d3dc5c2116813515e53bb4ebe

@vincentarelbundock

Copy link
Copy Markdown
Author

Duplicate from future import print_function are a known issue: mitsuhiko/python-modernize#13

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

@vincentarelbundock

Copy link
Copy Markdown
Author

Some of your comments seem like they could refer to later stages of the conversion. I'm thinking about conversion from print to warnings and such.

There are a lot of minor changes, so I think it may pay to accept some less than ideal choices and customizations for the benefits of automation.

Comment thread statsmodels/__init__.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate ((

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants