Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
8207014
reverted `create` to ~pre-anchor state
light-matters Nov 18, 2024
390875e
Merge branch 'main' of github.com:vukics/Wigner_Time into origin-API
light-matters Nov 18, 2024
5e6ec40
reverted ramp to ~the old `next` implementation
light-matters Nov 18, 2024
83d8359
first ideas for `origin.find` dispatch
light-matters Nov 18, 2024
4b25e23
small change
light-matters Nov 19, 2024
bcb8a4a
close to a working first draft using origin
light-matters Nov 19, 2024
f5ce87c
progress with origin
light-matters Nov 19, 2024
aa586c9
changing variable names
light-matters Nov 19, 2024
a07c6bc
splittitng tests
light-matters Nov 20, 2024
385bb13
basic origin idea with create
light-matters Nov 20, 2024
4bc8db1
deals with missing timeline
light-matters Nov 21, 2024
68facb8
create 'origin' seems to be working
light-matters Nov 21, 2024
9b5aba2
small change
light-matters Nov 26, 2024
5ba5121
brief notes from meeting
light-matters Nov 26, 2024
2b4c07f
started to implement the new `ramp` function
light-matters Nov 27, 2024
a2ad14e
untested draft implementation of ramp (with origins)
light-matters Nov 27, 2024
f242ee6
debugging `match`es
light-matters Nov 27, 2024
941c69c
first passing test
light-matters Nov 28, 2024
fca27ca
debugging more ramp features
light-matters Nov 28, 2024
1106a9f
passing ramp tests
light-matters Nov 28, 2024
ec2cd0e
all tests but ADwin
light-matters Nov 28, 2024
25ad838
simplified origin find
light-matters Nov 28, 2024
4678204
simplified origin find and update (a lot)
light-matters Nov 28, 2024
6f29230
got algorithm for expansion
light-matters Nov 29, 2024
5282626
Merge branch 'main' of github.com:vukics/Wigner_Time into origin-API
light-matters Dec 2, 2024
976dbd2
ramp expand (in the same place) seems to work
light-matters Dec 2, 2024
853ab9b
ramp functions were not boundary inclusive! Fixed.
light-matters Dec 2, 2024
0898ff5
renamed some variables
light-matters Dec 3, 2024
6cb448c
starting `anchor` update
light-matters Dec 3, 2024
32a5343
fixed bug: 'x is [None, None]' doesn't work
light-matters Dec 3, 2024
ebf9a1c
`previous` now looks for `startswith` rather than ==
light-matters Dec 3, 2024
38146fe
Merge branch 'main' of github.com:vukics/Wigner_Time into origin-API
light-matters Dec 3, 2024
3d48b7c
working anchor test
light-matters Dec 3, 2024
8e4a687
changed ANCHOR to a symbol
light-matters Dec 3, 2024
c4cc998
Merge remote-tracking branch 'origin/main' into origin-API
light-matters Dec 3, 2024
95417aa
started 'proper' testing with existing timelines
light-matters Dec 9, 2024
bfbbc3d
updated tests to reflect anchor symbol
light-matters Dec 10, 2024
24f8b85
all tests passing after removing origin default
light-matters Dec 10, 2024
9267522
now tested ramp (MOT detuned growth)
light-matters Dec 10, 2024
4bf94cf
started extending tests to molasses
light-matters Dec 10, 2024
cb46f4b
fixed a context selecting bug by changing `previous`
light-matters Dec 10, 2024
6fe388f
reconfigured tests +discovered bug
light-matters Dec 10, 2024
44ebf24
all tests passing
light-matters Dec 10, 2024
9639bac
separated tests from data
light-matters Dec 11, 2024
cf69f29
implemented `context` `origin` (anchor and 'last')
light-matters Dec 11, 2024
3fe2454
added context anchor test using the public API
light-matters Dec 11, 2024
594fdcf
removed flag for creating expanded ramps directly.
light-matters Dec 11, 2024
31f26bd
`ramp` doc and removed fargs and is_compact
light-matters Dec 12, 2024
f9db0ba
working on making the ramp more flexible
light-matters Dec 12, 2024
04f877e
removed possibility of inhomogenous array in ramp
light-matters Dec 13, 2024
6d89843
display works
light-matters Dec 13, 2024
4138757
connected the main `display` to avoid API breaks
light-matters Dec 13, 2024
bcb086b
added anchor utility namespace
light-matters Dec 13, 2024
c947c9f
Fixed adwin ambiguity and added anchor module
light-matters Dec 13, 2024
2505567
Added anchor origin as default for `update`
light-matters Dec 13, 2024
1255c46
fixed bug for multiple updates per variable
light-matters Dec 16, 2024
fdf0a80
more helpful error message in `origin`
light-matters Dec 16, 2024
ea3ea03
investigating timeline discrepancies
light-matters Dec 17, 2024
da5c249
comparing timelines by controlled time resolution
light-matters Dec 17, 2024
11b5728
'better' implementation of `expand`
light-matters Feb 12, 2025
9223fbe
added `do_show` to display function
light-matters Feb 13, 2025
7f56cc7
Fixed `expand`
light-matters Feb 14, 2025
43885d4
all tests run
light-matters Feb 17, 2025
a051102
updated origins to origin;origin2
light-matters Feb 17, 2025
c098c37
updated origin to use a list of defaults
light-matters Feb 17, 2025
5a9c1c9
context function and context display
light-matters Feb 19, 2025
308eca2
to_adbasic is now the super function
light-matters Feb 20, 2025
97840eb
added test for adbasic
light-matters Feb 20, 2025
c3baffe
fixed sanitize mistake
light-matters Feb 20, 2025
8a8e2d9
`to_adbasic` to `to_data` and context display
light-matters Feb 20, 2025
8500803
removed print statements and fixed test
light-matters Feb 20, 2025
ec4628d
Merge branch 'main' of github.com:vukics/Wigner_Time into origin-API
light-matters Feb 20, 2025
074d070
first pass at refactoring the `connection` module
light-matters Feb 20, 2025
30584e9
refactored `device` module
light-matters Feb 21, 2025
a889aa2
updated device conversion
light-matters Feb 21, 2025
aac5470
rejigged the `variable` module; adwin validation
light-matters Feb 21, 2025
bafa3e8
adwin specifications refactor
light-matters Feb 21, 2025
dff9612
linked digital module check to specifications
light-matters Feb 21, 2025
8487ea4
small notes and tests
light-matters Feb 24, 2025
ee65e04
added gain and fixed ADC conversion
light-matters Feb 24, 2025
40f44eb
working on nonlinear conversion
light-matters Feb 24, 2025
35fa460
linear conversion works using new device format
light-matters Feb 26, 2025
638764b
added note and changed type to Int32
light-matters Feb 26, 2025
a90338c
WIP combining device conversions
light-matters Feb 27, 2025
8f0168b
update to initialize (symmetric module numbers)
light-matters Feb 27, 2025
37be670
Merge branch 'origin-API' of github.com:vukics/Wigner_Time into restr…
light-matters Feb 27, 2025
fdb944d
merged
light-matters Feb 27, 2025
f623b56
updated conversion - all tests passing
light-matters Feb 27, 2025
2eadca9
Started generalizing and tidying `display` mods
light-matters Feb 28, 2025
5afd8c0
replaced specialst context shading
light-matters Feb 28, 2025
8f2d8b9
removed print statemetns
light-matters Feb 28, 2025
f289437
trying to merge with main
light-matters Mar 27, 2025
480128a
updated variables in to conform to regex
light-matters Mar 27, 2025
db30957
missed some...
light-matters Mar 27, 2025
721fd31
fixed display of only analogue or digital vars
light-matters Mar 27, 2025
746a794
now with dedicated (passing) display test
light-matters Mar 27, 2025
5999570
added realistic 'test' for AOM calibration
light-matters Mar 28, 2025
8ebbeab
changed analogue plots to (also) use `step`
light-matters Mar 28, 2025
38c0a09
Started to streamline the demonstration file.
light-matters Mar 28, 2025
1f357b2
started refactoring demo... as a pipeline
light-matters Mar 28, 2025
28b9aa7
working pipeline refactor
light-matters Mar 31, 2025
30f7bae
renaming/creating demo files
light-matters Mar 31, 2025
2727cdb
syncing
light-matters Apr 10, 2025
f9ab148
added warning and started dev notes
light-matters Nov 19, 2025
cd4eb0d
merge
light-matters Mar 28, 2026
ba0f0bc
updated to src layout
light-matters Mar 28, 2026
ed67dc6
fixed refactor typos (failing tests)
light-matters Mar 28, 2026
3faea6e
branch passes all tests
light-matters Mar 28, 2026
534125e
Merge branch 'main' of github.com:WignerQuantumOptics/Wigner_Time int…
light-matters Mar 28, 2026
c4ca5b6
Changed to a namespace package
light-matters Mar 28, 2026
f3014a4
bug in test_fullDemo from index 57
light-matters Mar 28, 2026
4993d1b
fixed bug in full experiment demo
light-matters Mar 30, 2026
b6769fb
draft flexible preparation function (blah)
light-matters Mar 30, 2026
444c8c3
flexible stack seems to work
light-matters Mar 30, 2026
9515e9d
tidied demo. Uses new flexible stack
light-matters Mar 30, 2026
ade0bc6
added `cascade` function
light-matters Mar 31, 2026
1a7b32c
refactored and debugged adwin subpackage
light-matters Mar 31, 2026
59f1281
draft save and load
light-matters Mar 31, 2026
4a5173f
updated pyarrow dependency
light-matters Apr 1, 2026
e7169bb
fixing automatic tests
light-matters Apr 2, 2026
e842486
restructured tests and implemented save and load
light-matters Apr 2, 2026
8e2682a
updated tests and demos to avoid conflicts
light-matters Apr 2, 2026
7932e56
fix github action failing?
light-matters Apr 2, 2026
587c829
fixing typo
light-matters Apr 2, 2026
b2bd6e8
removed print statement
light-matters Apr 7, 2026
16d09ac
fixed display bug; updated demo
light-matters Apr 8, 2026
f4936fc
moving `util` and `inherit` functions
light-matters Apr 13, 2026
2072c05
moved input and anchor util modules
light-matters Apr 13, 2026
4f6980f
updated doc string
light-matters Apr 13, 2026
103b765
fixed test import
light-matters Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # or whatever version your project uses
python-version: '3.11'

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install dependencies
run: poetry install --extras "display"
run: poetry install --with dev --all-extras

- name: Run tests
run: poetry run pytest
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ You want to digitally control an optical shutter and AOM.
For digital channels, simply *name* the ADwin ports using standard Python lists. These keep track of the physical connections.

``` python
from wigner_time.adwin import connection as adcon
from wigner_time import device
from wigner_time import conversion as conv
from wigner.time.adwin import connection as adcon
from wigner.time import device
from wigner.time import conversion as conv

connections = adcon.new(
["shutter_MOT", 1, 11],
Expand Down Expand Up @@ -207,7 +207,7 @@ tline = tl.stack(
The timeline can then be exported to an ADwin-compatible format.

``` python
from wigner_time.adwin import core as adwin
from wigner.time.adwin import core as adwin

adwin.to_data(tline)
```
Expand Down
150 changes: 150 additions & 0 deletions doc/demo__imaging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import sys
import pandas as pd
from munch import Munch

from wigner.time.adwin import connection as con
from wigner.time import timeline as tl

import demo__full_experiment as ex

# Note: make context explicit everywhere, otherwise there is a danger of squashing everything into the Finish context
# due to previous_context when appending to an already `finish`ed timeline

connections = pd.concat(
[
ex.connections,
con.new(
["shutter_imaging", 1, 13], ["AOM_imaging", 1, 5], ["trigger_camera", 1, 0]
),
]
)


# this is an upper estimate of the IDS ueye camera exposition delay
DELAY__CAMERA_EXPOSITION = 100e-6


def camera_exposition(exposition__AOM, delay__camera=DELAY__CAMERA_EXPOSITION):
return exposition__AOM + 2 * delay__camera


def init(**kwargs):
return ex.init(shutter_imaging=0, AOM_imaging=1, trigger_camera=0, **kwargs)


def finish(**kwargs):
return ex.finish(shutter_imaging=0, AOM_imaging=1, trigger_camera=0, **kwargs)


def trigger_camera(
t,
exposure,
context,
origin=None,
**kwargs # this can contain e.g. an already existing timeline
):
return tl.update(
"trigger_camera",
[[t, 1], [t + exposure, 0]],
context=context,
origin=origin,
**kwargs
)


# From this point onwards, exposure is AOM_exposure (so that camera and shutter exposure must be larger)
def flash_light(t, exposure__AOM, context, origin=None, **kwargs):
sf = ex.constants.safety_factor
return tl.stack(
tl.update(
"AOM_imaging",
[[t, 1], [t + exposure__AOM, 0]],
context=context,
origin=origin,
**kwargs
),
tl.update(
"shutter_imaging",
[
[t - exposure__AOM * (sf - 1) - ex.constants.AI.lag__shutter_on, 1],
[t + exposure__AOM * sf, 0],
],
context=context,
origin=origin,
),
)


def expose_camera(
t,
exposure__AOM,
context,
origin=None,
delay__camera=DELAY__CAMERA_EXPOSITION,
**kwargs
):
return tl.stack(
flash_light(t, exposure__AOM, context, origin, **kwargs),
trigger_camera(
t - delay__camera,
exposure__AOM + 2 * delay__camera,
context,
origin,
),
)


def image_plus_background(
t, exposure__AOM, delay__background, context, origin, **kwargs
):
return tl.stack(
expose_camera(t, exposure__AOM, context, origin, **kwargs), # taking At image
trigger_camera(
t + delay__background,
camera_exposition(exposure__AOM),
context,
origin,
), # taking Bg_At image
)


def absorption_image(
t,
exposure__AOM,
origin,
delay__background=50e-3,
delay__beam=0.2,
advance__AOM_off=0.1,
exposure__blow=1e-2,
context="imaging__absorption",
**kwargs
):
"""
An atomic absorption image is constructed from an image of the imaging beam, an image of the atoms and associated background images.
"""

return tl.stack(
tl.update(
AOM_imaging=0,
t=t - advance__AOM_off,
context=context,
origin=origin,
**kwargs
), # initializing the AOM
image_plus_background(
t, exposure__AOM, delay__background, context, origin
), # taking At + Bg_At image
(
flash_light(
t + delay__background + delay__beam / 2.0,
exposure__blow,
context,
origin,
)
if exposure__blow is not None
else None
), # blow out the atoms in between
image_plus_background(
t + delay__beam, exposure__AOM, delay__background, context, origin
), # taking Li + Bg_Li image
)
14 changes: 14 additions & 0 deletions doc/demo__tips_and_tricks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Here we highlight some convenient features that might not be obvious otherwise.
"""

from wigner.time import timeline as tl

tl.create(AOM_MOT=1, shutter_MOT=1, t=10, context="MOT")

tl.create(AOM_MOT=[0.1, 1], shutter_MOT=[0.0, 1], thing=40, context="MOT")

tl.create(AOM_MOT=[[0.1, 1], [0.2, 0]], context="MOT")
tl.create("AOM_MOT", 0.1, 1, "MOT")

tl.create([["AOM_MOT", 1, 0.1, "MOT"], ["AOM_imaging", 1, 0.0, "AI"]])
Loading
Loading