microsync 2.6.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- microsync-2.6.3/MANIFEST.in +23 -0
- microsync-2.6.3/PKG-INFO +69 -0
- microsync-2.6.3/README.md +35 -0
- microsync-2.6.3/install.py +104 -0
- microsync-2.6.3/jitter_tests.ipynb +562 -0
- microsync-2.6.3/microsync/__init__.py +32 -0
- microsync-2.6.3/microsync/__version__.py +15 -0
- microsync-2.6.3/microsync/constants.py +36 -0
- microsync-2.6.3/microsync/event_visualizer.py +446 -0
- microsync-2.6.3/microsync/microsync.py +1213 -0
- microsync-2.6.3/microsync/rev_pin_map.py +121 -0
- microsync-2.6.3/microsync/tektronix.py +380 -0
- microsync-2.6.3/microsync.egg-info/PKG-INFO +69 -0
- microsync-2.6.3/microsync.egg-info/SOURCES.txt +20 -0
- microsync-2.6.3/microsync.egg-info/dependency_links.txt +1 -0
- microsync-2.6.3/microsync.egg-info/entry_points.txt +2 -0
- microsync-2.6.3/microsync.egg-info/requires.txt +9 -0
- microsync-2.6.3/microsync.egg-info/top_level.txt +1 -0
- microsync-2.6.3/microsync_demo.ipynb +4660 -0
- microsync-2.6.3/pyproject.toml +65 -0
- microsync-2.6.3/requirements.txt +7 -0
- microsync-2.6.3/setup.cfg +4 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Include Python source files
|
|
2
|
+
include *.py
|
|
3
|
+
|
|
4
|
+
# Include Jupyter notebook
|
|
5
|
+
include *.ipynb
|
|
6
|
+
|
|
7
|
+
# Exclude build artifacts
|
|
8
|
+
global-exclude *.pyc
|
|
9
|
+
global-exclude *.pyo
|
|
10
|
+
global-exclude *.pyd
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude .git*
|
|
13
|
+
global-exclude .DS_Store
|
|
14
|
+
global-exclude *.so
|
|
15
|
+
global-exclude *.dll
|
|
16
|
+
global-exclude *.dylib
|
|
17
|
+
global-exclude *.exe
|
|
18
|
+
global-exclude build/
|
|
19
|
+
global-exclude dist/
|
|
20
|
+
global-exclude *.egg-info/
|
|
21
|
+
|
|
22
|
+
global-exclude .coverage
|
|
23
|
+
global-exclude htmlcov/
|
microsync-2.6.3/PKG-INFO
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microsync
|
|
3
|
+
Version: 2.6.3
|
|
4
|
+
Summary: Python driver for 32-bit microscope synchronization device.
|
|
5
|
+
Author-email: Roman Kiselev <roman.kiselev@stjude.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/stjude-smc/microsync
|
|
8
|
+
Project-URL: Repository, https://github.com/stjude-smc/microsync
|
|
9
|
+
Project-URL: Documentation, https://stjude-smc.github.io/microsync/
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/stjude-smc/microsync/issues
|
|
11
|
+
Keywords: microscope,synchronization,device,arduino,sam3x,serial,timing,laser,camera,ptirf
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Operating System :: OS Independent
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.7
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
Requires-Dist: pyserial>=3.0
|
|
27
|
+
Requires-Dist: bokeh>=3.0.0
|
|
28
|
+
Requires-Dist: selenium>=4.0.0
|
|
29
|
+
Requires-Dist: webdriver-manager>=4.0.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: jupyter>=1.0; extra == "dev"
|
|
32
|
+
Requires-Dist: sphinx>=4.0; extra == "dev"
|
|
33
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "dev"
|
|
34
|
+
|
|
35
|
+
# `microsync` — Python driver for microscope synchronization device
|
|
36
|
+
|
|
37
|
+
**Python driver for `microsync` — a universal 32-bit Arduino Due-based triggering device**. Control lasers, cameras, and timing with microsecond precision.
|
|
38
|
+
|
|
39
|
+
- **Full documentation:** [stjude-smc.github.io/microsync](https://stjude-smc.github.io/microsync/)
|
|
40
|
+
- **Repository:** [github.com/stjude-smc/microsync](https://github.com/stjude-smc/microsync)
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
Requires Python 3.7+ and `pyserial` (installed automatically):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install microsync
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
Upload the microsync firmware to an Arduino Due, then:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from microsync import SyncDevice
|
|
56
|
+
|
|
57
|
+
sd = SyncDevice("COM4") # or "/dev/ttyUSB0" on Linux
|
|
58
|
+
sd.pos_pulse("D8", 1000, ts=1000) # 1 ms pulse on D8 after 1 ms delay
|
|
59
|
+
sd.go()
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Features
|
|
63
|
+
|
|
64
|
+
- Microsecond-precision event scheduling (pulses, toggles, camera triggers)
|
|
65
|
+
- Laser shutter and interlock safety logic
|
|
66
|
+
- Acquisition modes: continuous, stroboscopic, ALEX
|
|
67
|
+
- Interactive event visualization (Bokeh)
|
|
68
|
+
- Context manager for jitter-free batch commands
|
|
69
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# `microsync` — Python driver for microscope synchronization device
|
|
2
|
+
|
|
3
|
+
**Python driver for `microsync` — a universal 32-bit Arduino Due-based triggering device**. Control lasers, cameras, and timing with microsecond precision.
|
|
4
|
+
|
|
5
|
+
- **Full documentation:** [stjude-smc.github.io/microsync](https://stjude-smc.github.io/microsync/)
|
|
6
|
+
- **Repository:** [github.com/stjude-smc/microsync](https://github.com/stjude-smc/microsync)
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
Requires Python 3.7+ and `pyserial` (installed automatically):
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install microsync
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
Upload the microsync firmware to an Arduino Due, then:
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from microsync import SyncDevice
|
|
22
|
+
|
|
23
|
+
sd = SyncDevice("COM4") # or "/dev/ttyUSB0" on Linux
|
|
24
|
+
sd.pos_pulse("D8", 1000, ts=1000) # 1 ms pulse on D8 after 1 ms delay
|
|
25
|
+
sd.go()
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- Microsecond-precision event scheduling (pulses, toggles, camera triggers)
|
|
31
|
+
- Laser shutter and interlock safety logic
|
|
32
|
+
- Acquisition modes: continuous, stroboscopic, ALEX
|
|
33
|
+
- Interactive event visualization (Bokeh)
|
|
34
|
+
- Context manager for jitter-free batch commands
|
|
35
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Simple installation script for microsync package.
|
|
4
|
+
|
|
5
|
+
This script provides an easy way to install the microsync package
|
|
6
|
+
either in development mode or as a regular installation.
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
python install.py [--dev] [--user]
|
|
10
|
+
|
|
11
|
+
Options:
|
|
12
|
+
--dev Install in development mode (editable install)
|
|
13
|
+
--user Install for current user only
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import sys
|
|
17
|
+
import subprocess
|
|
18
|
+
import argparse
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def run_command(cmd, description):
|
|
23
|
+
"""Run a command and handle errors."""
|
|
24
|
+
print(f"Running: {description}")
|
|
25
|
+
print(f"Command: {' '.join(cmd)}")
|
|
26
|
+
|
|
27
|
+
try:
|
|
28
|
+
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
|
29
|
+
print("✓ Success!")
|
|
30
|
+
if result.stdout:
|
|
31
|
+
print(result.stdout)
|
|
32
|
+
return True
|
|
33
|
+
except subprocess.CalledProcessError as e:
|
|
34
|
+
print(f"✗ Error: {e}")
|
|
35
|
+
if e.stdout:
|
|
36
|
+
print("STDOUT:", e.stdout)
|
|
37
|
+
if e.stderr:
|
|
38
|
+
print("STDERR:", e.stderr)
|
|
39
|
+
return False
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def main():
|
|
43
|
+
parser = argparse.ArgumentParser(
|
|
44
|
+
description="Install microsync package",
|
|
45
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
46
|
+
epilog="""
|
|
47
|
+
Examples:
|
|
48
|
+
python install.py # Install normally
|
|
49
|
+
python install.py --dev # Install in development mode
|
|
50
|
+
python install.py --user # Install for current user only
|
|
51
|
+
python install.py --dev --user # Install in dev mode for current user
|
|
52
|
+
"""
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
'--dev',
|
|
57
|
+
action='store_true',
|
|
58
|
+
help='Install in development mode (editable install)'
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
'--user',
|
|
63
|
+
action='store_true',
|
|
64
|
+
help='Install for current user only'
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
args = parser.parse_args()
|
|
68
|
+
|
|
69
|
+
# Check if we're in the right directory
|
|
70
|
+
if not Path('pyproject.toml').exists():
|
|
71
|
+
print("Error: pyproject.toml not found. Please run this script from the python/ directory.")
|
|
72
|
+
sys.exit(1)
|
|
73
|
+
|
|
74
|
+
# Build the pip install command
|
|
75
|
+
cmd = [sys.executable, '-m', 'pip', 'install']
|
|
76
|
+
|
|
77
|
+
if args.dev:
|
|
78
|
+
cmd.append('-e')
|
|
79
|
+
cmd.append('.[dev]') # Include development dependencies
|
|
80
|
+
else:
|
|
81
|
+
cmd.append('.')
|
|
82
|
+
|
|
83
|
+
if args.user:
|
|
84
|
+
cmd.append('--user')
|
|
85
|
+
|
|
86
|
+
# Run the installation
|
|
87
|
+
success = run_command(cmd, "Installing microsync package")
|
|
88
|
+
|
|
89
|
+
if success:
|
|
90
|
+
print("\n🎉 Installation completed successfully!")
|
|
91
|
+
print("\nYou can now use the package:")
|
|
92
|
+
print(" import microsync")
|
|
93
|
+
print(" device = microsync.SyncDevice('COM3') # or '/dev/ttyUSB0' on Linux")
|
|
94
|
+
|
|
95
|
+
if args.dev:
|
|
96
|
+
print("\nNote: This is a development installation.")
|
|
97
|
+
print("Changes to the source code will be immediately available.")
|
|
98
|
+
else:
|
|
99
|
+
print("\n❌ Installation failed!")
|
|
100
|
+
sys.exit(1)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if __name__ == '__main__':
|
|
104
|
+
main()
|