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

Introduce devito.Zero to replace sympy.Zero in the FD layer #2332

Open
FabioLuporini opened this issue Mar 13, 2024 · 1 comment
Open

Introduce devito.Zero to replace sympy.Zero in the FD layer #2332

FabioLuporini opened this issue Mar 13, 2024 · 1 comment
Labels

Comments

@FabioLuporini
Copy link
Contributor

this way we avoid annoying try-excepts such as

       try:
             theta = model.theta
         except AttributeError:
             theta = 0

or

if theta != 0:
    <expr>
@mloubout
Copy link
Contributor

It's not that simple

  • first case has nothing do with FD layer, just the case where the model doesn't have a theta attribute only option is try/catch or getattr
    The second case has so many possibilities tracking them all would be quite a pain

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

No branches or pull requests

2 participants