EMS-TU-Ilmenau / fastmat

A library to build up lazily evaluated expressions of linear transforms for efficient scientific computing.
https://fastmat.readthedocs.io
Apache License 2.0
24 stars 8 forks source link

fastmat and Spyder's "User Module Reloader" #27

Closed JanKirchhofTU closed 5 years ago

JanKirchhofTU commented 6 years ago

When I do something like

import fastmat as fm
HadamardMatrix = fm.Hadamard(10)

and run this in an IPython console, it will run smoothly the first time. Starting from the second execution (in the same console), I get

  File "/path/.local/lib/python2.7/site-packages/fastmat/core/calibration.py", line 68, in getMatrixCalibration
    return calData.get(target, None)

AttributeError: 'NoneType' object has no attribute 'get'

each time fastmat is used in the code.

fastmat seems to have problems with Spyder's User Module Reloader (UMR) feature causing the warnings. Simply excluding it from the UMR works so far.

JanKirchhofTU commented 6 years ago

Moving on further, this issue exists only in spyder-versions based on python 2.x but not in spyder connected with python 3.x.

ChristophWWagner commented 6 years ago

Does the issue occur after class calibration, too?

Please create a calibration data set with

python util/bee.py calibrate all -o cal.json

and then use that calibrated file in your fastmat session:

import fastmat
fastmat.core.calibration.loadCalibration('cal.json')
SebastianSemper commented 6 years ago

Is this fixed?

ChristophWWagner commented 5 years ago

I would assume this to be a yes. closing.

https://github.com/spyder-ide/spyder/pull/7198/commits/26fe99ff2b11c77f5bb3c105e008891f53a09aef