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

Slow counter overhaul #555

Merged
merged 53 commits into from
Jun 11, 2020
Merged

Slow counter overhaul #555

merged 53 commits into from
Jun 11, 2020

Conversation

Neverhorst
Copy link
Member

Description

Added a whole new tool chain (GUI, logic, interface, hardware) for "slow counting".

In the process I also deleted some testing/template modules that somehow made their way into master... but should not have...

Motivation and Context

The current time series counter is very limited regarding data throughput and mixed signal capabilities.
For high data rates it will crash the NI card and dependent modules.
Also the oversampling and averaging is very inconsistent.
I implemented a wholesome replacement for "slow counting" by using the new modules TimeSeriesGui, TimeSeriesReaderLogic and NIXSeriesInStreamer.
The logic and hardware interface are more versatile and should be suited for any use case where continuous data streaming from a buffered device with variable read size is needed.
Also the counter/time trace GUI offers settings to switch channels physically and/or virtually on and off.

The old counter modules are still present but loading the respective GUI will cause a deprecation warning to pop up in order to encourage users to switch to the new modules.
I also intend to include the pop-up notification as simple tool in core... but in a different PR.

How Has This Been Tested?

On Win8.1 x64 with NI USB-6343 hardware and also with new dummy module.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have documented my changes in the changelog (documentation/changelog.md)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added/updated for the module the config example in the docstring of the class accordingly.
  • I have checked that the change does not contain obvious errors (syntax, indentation, mutable default values).
  • I have tested my changes using 'Load all modules' on the default dummy configuration with my changes included.
  • All changed Jupyter notebooks have been stripped of their output cells.

Copy link
Member

@kay-jahnke kay-jahnke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The follwoing error appears when the timeseries counter is running and the python hangs (e.g. due to other hardware using all resources on the computer). I have to confess I do not understand it.
The error appeared while testing on the mesoscopic setup with high data acquisition rates. The hanging I provoked by sampling a long sequence on the pulser or restarting the magnet control (in its own process).

Traceback (most recent call last):
  File "C:\Software\qudi\gui\time_series\time_series_gui.py", line 461, in update_data
    self._vb.autoRange()
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\pyqtgraph\graphicsItems\ViewBox\ViewBox.py", line 592, in autoRange
    bounds = self.childrenBoundingRect(items=items)
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\pyqtgraph\graphicsItems\ViewBox\ViewBox.py", line 1375, in childrenBoundingRect
    range = self.childrenBounds(*args, **kwds)
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\pyqtgraph\graphicsItems\ViewBox\ViewBox.py", line 1285, in childrenBounds
    px, py = [v.length() if v is not None else 0 for v in self.childGroup.pixelVectors()]
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\pyqtgraph\graphicsItems\GraphicsItem.py", line 252, in pixelVectors
    dti = fn.invertQTransform(dt)
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\pyqtgraph\functions.py", line 2306, in invertQTransform
    inv = numpy.linalg.inv(arr)
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\numpy\linalg\linalg.py", line 528, in inv
    ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
  File "C:\ProgramData\Anaconda3\envs\qudi\lib\site-packages\numpy\linalg\linalg.py", line 89, in _raise_linalgerror_singular
    raise LinAlgError("Singular matrix")
numpy.linalg.linalg.LinAlgError: Singular matrix

@Neverhorst
Copy link
Member Author

Thank you @kay-jahnke.
I tried to reproduce this error on dummy config with 1kHz data rate, 4 times oversampling (=4kHz sampling rate) and 20s trace window.
Started sampling a large hahnecho waveform and pressed "load all modules". Everything stutters and it takes ages but in the end... no error.
Can you give a more detailed way to reproduce this error?

Copy link
Member

@kay-jahnke kay-jahnke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As no one (me included) could reproduce the error, let's just merge this PR.
I noticed there are conflicts deleting test files for testing the new interfaces, were they still in master?

@alrik-durand
Copy link
Contributor

Hi,

Sorry for the late message ! Could I suggest some modification to the interface architecture ?
As I mentioned in the issue #586, it would be great to have some kind of guidelines for the interface design, so all the interfaces (at least the new ones) follow a similar style.
I personally have some preferences, but i would be happy with any unified style.

I can make some suggestion/change to this code if you are interested but don't have time for this !

What are your thoughts on this ?

Alrik

# Conflicts:
#	documentation/changelog.md
#	interface/first_test_interface.py
#	interface/second_test_interface.py
@Neverhorst
Copy link
Member Author

Hi,

Sorry for the late message ! Could I suggest some modification to the interface architecture ?
As I mentioned in the issue #586, it would be great to have some kind of guidelines for the interface design, so all the interfaces (at least the new ones) follow a similar style.
I personally have some preferences, but i would be happy with any unified style.

I can make some suggestion/change to this code if you are interested but don't have time for this !

What are your thoughts on this ?

Alrik

Well, I see the benefit in writing down basic/general guidelines for interface classes. Feel free to propose something.
However, a universal guideline will most certainly require months of discussions. And if we are then to "unify" all existing interfaces, this will be a huge project (many people rely on the current interfaces without contributing their projects to our qudi master).
What I want to say is that your proposed project will be very long-term and we can not stop development of new modules/interfaces until then.
So, unless you have immediate concerns about/improvements for the specific data streaming interface proposed in this PR, I would like to merge this (people want to have it and wait for it).

@alrik-durand
Copy link
Contributor

Hi,

Thank you for your reply.
Indeed this is quite a project, but I feel like it is time for the Qudi project to think about this issues, as it is now a mature and well established platform.

I see no immediate concerns, this PR seems otherwise very nice!

I'll start working on some propositions

@Neverhorst Neverhorst merged commit fc847a9 into master Jun 11, 2020
@Neverhorst Neverhorst deleted the slow_counter_overhaul branch June 11, 2020 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants