Skip to content

UnboundLocalError: local variable 'dotAB' referenced before assignment #20

Description

@aforsythe

Forgive me if I'm doing something stupid ...

The following code produces the following error in basics.py dot23

import luxpy as lx
import numpy as np

data = np.array([185, 206, 163])
Rw = np.array([256, 264, 202])

camout = lx.cam.zcam(data, Rw)
UnboundLocalError: local variable 'dotAB' referenced before assignment
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-4-599aff8f528b> in <module>
      2 Rw = np.array([256, 264, 202])
      3 
----> 4 camout = lx.cam.zcam(data, Rw)

/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/luxpy/color/cam/zcam.py in run(data, xyzw, outin, cieobs, conditions, forward, mcat, **kwargs)
    377     #--------------------------------------------
    378     # Apply CAT to white point:
--> 379     xyzwc = cat.apply_vonkries1(xyzw, xyzw1 = xyzw, xyzw2 = xyzw_d65, 
    380                                 D = D, mcat = mcat, invmcat = invmcat,
    381                                 use_Yw = True)

/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/luxpy/color/cat/chromaticadaptation.py in apply_vonkries1(xyz, xyzw1, xyzw2, D, mcat, invmcat, in_, out_, use_Yw)
    671     # transform from xyz to cat sensor space:
    672     if in_ == 'xyz':
--> 673         rgb = math.dot23(mcat, xyz.T)
    674         rgbw1 = math.dot23(mcat, xyzw1.T)
    675         rgbw2 = math.dot23(mcat, xyzw2.T)

/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/luxpy/math/basics.py in dot23(A, B, keepdims)
    235             dotAB = np.expand_dims(dotAB,axis=1)
    236 
--> 237     return dotAB
    238 
    239 #------------------------------------------------------------------------------

UnboundLocalError: local variable 'dotAB' referenced before assignment

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions