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

Setup issue - ValueError: ufunc <ufunc 'positive'> not supported by quantities #174

Closed
cmoriarty opened this issue Jun 19, 2017 · 4 comments

Comments

@cmoriarty
Copy link

I created a fresh conda python2.7 enviornment, and ran pip install instrumentkit. This worked great, although with the single import statement:

from instruments.thorlabs import APTMotorController

I get the following error:

  File "C:\ProgramData\Anaconda2\envs\kittest\lib\site-packages\quantities\quantity.py", line 236, in __array_prepare__
    """ % uf
ValueError: ufunc <ufunc 'positive'> not supported by quantities
                please file a bug report at https://github.com/python-quantities
@scasagrande
Copy link
Contributor

Hey @cmoriarty ! Thanks for the report. I missed it as I've been working on some data analysis for another project this week.

I haven't tested installation with conda actually. I'll give it a go locally, but for now can you try conda py3.4+ ? Not sure if it will help, but I'm interested to see.

@cmoriarty
Copy link
Author

No worries, I never have expectations when I post issues on github, haha. Thanks for replying!

We are limited to python 2.7 because of a device on our system with an SDK that isn't python3 compatible (cough cough Boston Micromachines cough cough). It sounds like you think python 2.7 is the culprit?

Just to clarify, I did use pip (not conda) to install InstrumentKit. I just did it in a conda environment, which is probably irrelevant.

In the end I had to implement my own low-level interface to the d2xx USB driver to control a Thorlabs MFF101 flip motor. I did it with the ftd2xx python wrapper on github. I will be needing to interface with a Thorlabs laser source in the next month or so, I'll check back in then.

@scasagrande
Copy link
Contributor

For clarification, you get the error during the installation process of pip install instrumentkit ? If so, it must be something related to anaconda, because IK currently installs in CI on CPython 2.7 without issue. I'll take a look this weekend.

@scasagrande
Copy link
Contributor

@cmoriarty It looks like this is an issue with the quantities package and the latest numpy>=1.13.0. You can see that here: python-quantities/python-quantities#129

I'd suggest you first manually install numpy==1.12.1 and the install InstrumentKit.

cgranade added a commit that referenced this issue Jul 12, 2017
cgranade added a commit that referenced this issue Jul 12, 2017
scasagrande pushed a commit that referenced this issue Jul 14, 2017
* Initial version of named struct class.

* Added tests for new class.

* docs and a pylint fix.

* Py3k fix (filter → list(filter))

* Improvements to string handling.

* Ignored additional carp.

* Provide fixes for build and start using hypothesis

* Locked requirements.txt; see #174.

* Fixed py3k compat issue.

* Fixed negative length checks.

* Fixed bug in StringField.__get__

* Added NamedStruct.__eq__ test.

* Fixing pylint warnings.

* Moved pylint warning comment.

* Changed numpy version in reqs as suggested by @scasagrande
scasagrande pushed a commit that referenced this issue Feb 10, 2019
* Added driver/motor tables for T/KDC001 APT devs.

* Moved TODO comment to avoid pylint error.

* Misc Py3k changes for ThorLabs APT

* motion_timeout for APT motor cmds, fix scale factor

* ThorLabsAPT: Example of new config support.

* More pylint fixes

* Fix for line continuation convention.

* Rearranged imports into standard order.

* Added an APT test. Not working yet.

* Fix linting issues

* New handling in loopback for empty terminator.

* struct.Struct for contents of hw_info packets

* Support for specifying expected apt pkt sizes

* Fixes to APT and APT tests

* Missed a conflict marker.

* Fixed bug due to `if size` falling through on size == 0.

* Removed trailing whitespace.

* Locked requirements.txt; see #174.

* Remove numpy version pinning in requirements.txt

* Add tests to cover additional loopback comm behaviour

* Make pylint happy

* Revert changes to size=0 behaviour in loopback comm
scasagrande added a commit that referenced this issue Feb 19, 2019
* Drop support for Python 3.4 (#200)

* Fix issue #197 (#201)

Where checking if value is in enum will raise value error in Py38

* Improvements to APT (#167)

* Added driver/motor tables for T/KDC001 APT devs.

* Moved TODO comment to avoid pylint error.

* Misc Py3k changes for ThorLabs APT

* motion_timeout for APT motor cmds, fix scale factor

* ThorLabsAPT: Example of new config support.

* More pylint fixes

* Fix for line continuation convention.

* Rearranged imports into standard order.

* Added an APT test. Not working yet.

* Fix linting issues

* New handling in loopback for empty terminator.

* struct.Struct for contents of hw_info packets

* Support for specifying expected apt pkt sizes

* Fixes to APT and APT tests

* Missed a conflict marker.

* Fixed bug due to `if size` falling through on size == 0.

* Removed trailing whitespace.

* Locked requirements.txt; see #174.

* Remove numpy version pinning in requirements.txt

* Add tests to cover additional loopback comm behaviour

* Make pylint happy

* Revert changes to size=0 behaviour in loopback comm

* Fix bug with SCPIFunctionGenerator.function, add tests (#202)

* Fix bug with SCPIFunctionGenerator.function, add tests

* Fix linting

* Fix Agilent 33220a, add tests (#203)

* Function Generator single/multi-channel consistency (#206)

* Function Generator single/multi-channel consistency

* Fix Py27 linting issue

* Fix linting issue

* Add tests for FunctionGenerator abstract instrument

* Adding support for the minghe mhs5200 (#150)

* added mhs5200

* added minghe function generator

* added absolute_import

* fixed scaling on frequency

* switched to abstract instrument class

* fixed a few docstrings

* after testing with device

* Minghe MHS5200 - Add instrument to docs

* isolating changes from cc1 test station:

* Revert "isolating changes from cc1 test station:"

This reverts commit 87b8dec.

* reverting changes and fixing duty cycle

* Update for new FunctionGenerator multichannel consistency update

* Docstring modifications (#207)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants