Add ptu support and pyproject.toml, deprecate cython#213
Merged
paulmueller merged 1 commit intoFCS-analysis:mainfrom Jan 19, 2026
Merged
Add ptu support and pyproject.toml, deprecate cython#213paulmueller merged 1 commit intoFCS-analysis:mainfrom
paulmueller merged 1 commit intoFCS-analysis:mainfrom
Conversation
9bba109 to
13159e5
Compare
A user requested the ability to load ptu (t2) files from a PicoQuant PicoHarp. The test suite covers HydraHarp (t2, t3) and PicoHarp (t2) but the code should be as general as the underlying ptufile package. In the process of setting this up I debugged a bit and made a few changes: * rewrite fib4.pyx as fib4.py, which deprecates cython * bump minimum Python version to 3.11 to support ptufile * migrated from setup.py to pyproject.toml (tested on Linux) * set up tox.ini for running the test suite * set up ruff, ty, and codespell placeholders for gradual linting (remove the exclusions as desired) * fix some stray numpy bugs (np.float_ deprecation) * remove distutils due to deprecation in Python 3.12 * do version generation through setuptools_scm * ensure the test suite fully passes for all versions supported * ensure the CI check stage works up through testing Deprecating cython There was only one function that required cython. I have replaced it with a pure numpy implementation that seems to perform equivalently and gets the same results for both random and test data. In tests/test_file_format.py:test_pt3_basic the behavior is the same as before (expected 2037 is actually 2037.5) but I have no insight as to why that happened in the first place. The correlation data (last two lines of that test) pass on my machine though. So all I can say is that no observable behavior has changed for loading pt3 or running dividAndConquer, not that the trace value is actually correct.
13159e5 to
9642a94
Compare
Collaborator
Author
|
A user on Windows (anaconda, Python 3.13) reports that the app works |
paulmueller
approved these changes
Jan 19, 2026
Member
|
Thank you for the heavy lifting ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #204, Closes #208, Closes #84
A user requested the ability to load ptu (t2) files from a PicoQuant PicoHarp. The test suite covers HydraHarp (t2, t3) and PicoHarp (t2) but the code should be as general as the underlying ptufile package.
In the process of setting this up I debugged a bit and made a few changes:
Deprecating cython
There was only one function that required cython. I have replaced it with a pure numpy implementation that seems to perform equivalently and gets the same results for both random and test data.
In tests/test_file_format.py:test_pt3_basic the behavior is the same as before (expected 2037 is actually 2037.5) but I have no insight as to why that happened in the first place. The correlation data (last two lines of that test) pass on my machine though. So all I can say is that no observable behavior has changed for loading pt3 or running dividAndConquer, not that the trace value is actually correct.
Broken
I had to disable the checks for the execution of the macos and windows apps for now. With macos the main issue is that the matplotlib font cache is taking forever to run, so either there is a speedup I am missing or we just need to cache it. So the actual gui might be broken there but I have confirmed it works on Linux
I made no attempt to fix the downstream CI stages for github and PyPI