Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PEP8 recommended function, method, and class formatted names #28

Closed
moorepants opened this issue Sep 20, 2018 · 4 comments
Closed

Comments

@moorepants
Copy link
Collaborator

For backward compatibility I'd like to dual support:

  • problem -> Problem
  • problem.addOption() -> Problem.add_option()
  • problem.setProblemScaling() -> Problem.set_problem_scaling() or Problem.set_scaling()

So ipopt/__init__.py would have:

from cyipopt import Problem
problem = Problem

And there would be dual methods:

class Problem():
    def add_option(...):
        # all functional code here
    def addOption(self, *args, **kwargs):
        # maybe add a deprecation warning here
        self.add_option(*args, **kwargs)
@brocksam
Copy link
Collaborator

Is this still of interest? I'm keen to get involved and this issue looks like it'd be a good place to start.

@moorepants
Copy link
Collaborator Author

This is, the only thing is that we'd want to deprecate them method names, so have both for some time.

@brocksam
Copy link
Collaborator

This is, the only thing is that we'd want to deprecate them method names, so have both for some time.

Yup, understood. Will follow your suggestion for dual support with deprecation warnings for the old non-PEP8 style.

@moorepants
Copy link
Collaborator Author

Cool, thanks for helping :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants