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

Unary operator doesn't work #186

Open
kwinkunks opened this issue Jan 10, 2022 · 1 comment
Open

Unary operator doesn't work #186

kwinkunks opened this issue Jan 10, 2022 · 1 comment
Labels

Comments

@kwinkunks
Copy link
Member

E.g. this doesn't work:

w = Well.from_las('data/P-129_out.LAS')
gr = w.data['GR']

# This works:
gr.plot_2d(cmap='viridis', curve=True, lw=0.3, edgecolor='k')

# This doesn't:
(200 - gr).plot_2d(cmap='viridis', curve=True, lw=0.3, edgecolor='k')

Should be easy enough to fix with __neg__() and __pos__() I think.

@kwinkunks kwinkunks added the bug label Jan 10, 2022
@patrick-reinhard
Copy link
Collaborator

Do you mean here that (200-gr) is not working properly?

    curve = well.data['GR']
    curve2 = 200-curve

    arr1 = curve.df.to_numpy()
    arr3 = arr1-200

    arr2 = curve2.df.to_numpy()

    all(arr2 == arr3)

     Out[11]: True

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