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

Implement and use _update_equation_with_symbol_definitions function #8

Open
fhightower opened this issue May 25, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@fhightower
Copy link
Contributor

What?

I would like to implement the _update_equation_with_symbol_definitions function something like the code below:

def _update_equation_with_symbol_definitions(equation: str):
    """Find all letters in the given equation and replace them with the appropriate call to the sympy.symbols function."""
    from strings import asciiLetters

    ascii_letters = [char for char in equation if char in asciiLetters()]

    for letter in set(ascii_letters):
        equation = equation.replace(letter, f'sympy.symbols("{letter}")')

    return equation

Then, I would like to use it in the equation_solve function so that someone can pass in an equation like y = x ^ 3 + 2 and both y and x will be converted to sympy symbols.

@fhightower fhightower added the enhancement New feature or request label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant