Giter VIP home page Giter VIP logo

Comments (2)

ap-- avatar ap-- commented on July 22, 2024

Hi Dave,

thanks for contributing!

The reason I added the context managers like this, was just so I could use a with statement instead of a try...finally block around the global measurement logic and guarantee that the spectrometer is closed. I am not entirely sure if opening and closing the spectrometer connection for every measurement will work, because Spectrometer._open_device() calls lib.device_open(self._dev) which does some spectrometer initialization. (I do believe the initialization is a no-op in cseabreeze for most spectrometers, but I think not for all)

(In the pyseabreeze case it resets the usb connection, which might not be desirable while you run your experiment)

So what I am actually saying is:
If you go ahead with implementing the change and submitting a pull request, we should wait with merging it into master until we can confirm correct operation for a few different spectrometer models and operating systems.

I can test a USB2000+ and a Spark under Linux, Windows and OSX with both backends.

Thanks,
-Andreas

from python-seabreeze.

ap-- avatar ap-- commented on July 22, 2024

I'm closing this issue since automatic closing of spectrometers is quite a bit improved and the contextmanager fuinctionality will be removed with v2.0

from python-seabreeze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.