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

Consider adding as_symbol() method or similar #38

Open
arcondello opened this issue Jun 27, 2024 · 0 comments
Open

Consider adding as_symbol() method or similar #38

arcondello opened this issue Jun 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@arcondello
Copy link
Member

Similar to numpy.asarray. This would basically be

def as_symbol(model, symbol):
    if isinstance(symbol, Symbol):
        return symbol
    return model.constant(np.asarray(symbol, dtype=double))

or something like that. We could then use it in a bunch of function signatures. Because right now it's clunky to have to do model.constant(...) absolutely everywhere.

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