Skip to content

bh107: Can't multiply from the left #632

Description

@jamesavery

Binary operations with scalars are implemented only when the scalar is on the right.
Negation isn't working either.

Example:

import numpy as np
import bh107 as bh

xs = bh.array(np.linspace(0,10,100)) # Oh, linspace is also missing
g = bh.exp(-xs**2)       # Unsupported operand
g = bh.exp((xs**2)*-1) # Works, is pretty awkward
f = 0.5*g                      # Unsupported operand
f = g*0.5                      # Works
h = 1+f                        # Unsupported operand
h = f+1                        # Works, you get the picture

It's pretty grueling to change this everywhere when I want to test with bh107. It should be easy to fix, but I don't know where to do it.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions