deapi 5.3b5__tar.gz → 5.3.1__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.
Files changed (126) hide show
  1. {deapi-5.3b5 → deapi-5.3.1}/.github/workflows/build.yaml +16 -19
  2. deapi-5.3.1/.github/workflows/prepare_release.yml +192 -0
  3. {deapi-5.3b5 → deapi-5.3.1}/.pre-commit-config.yaml +1 -1
  4. deapi-5.3.1/CHANGES.rst +92 -0
  5. {deapi-5.3b5 → deapi-5.3.1}/PKG-INFO +10 -6
  6. {deapi-5.3b5 → deapi-5.3.1}/deapi/__init__.py +2 -1
  7. {deapi-5.3b5 → deapi-5.3.1}/deapi/buffer_protocols/__init__.py +1 -2
  8. {deapi-5.3b5 → deapi-5.3.1}/deapi/buffer_protocols/pb_3_19_3.py +1 -0
  9. {deapi-5.3b5 → deapi-5.3.1}/deapi/buffer_protocols/pb_3_23_3.py +1 -0
  10. deapi-5.3.1/deapi/buffer_protocols/pb_6_33_4.py +47 -0
  11. {deapi-5.3b5 → deapi-5.3.1}/deapi/client.py +367 -152
  12. {deapi-5.3b5 → deapi-5.3.1}/deapi/conf.py +0 -1
  13. {deapi-5.3b5 → deapi-5.3.1}/deapi/data_types.py +133 -0
  14. deapi-5.3.1/deapi/prop_dump.json +583 -0
  15. {deapi-5.3b5 → deapi-5.3.1}/deapi/simulated_server/fake_server.py +124 -10
  16. {deapi-5.3b5 → deapi-5.3.1}/deapi/simulated_server/initialize_server.py +33 -1
  17. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/conftest.py +25 -5
  18. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/05_swhwBinning.py +0 -1
  19. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/10_imageStatistics.py +0 -1
  20. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_client.py +53 -61
  21. deapi-5.3.1/deapi/tests/test_fake_server/test_partial_sends.py +92 -0
  22. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_fake_server/test_server.py +3 -1
  23. deapi-5.3.1/deapi/tests/test_fake_server/test_twin_server.py +96 -0
  24. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_file_saving/test_file_loading_libertem.py +5 -1
  25. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_file_saving/test_file_loading_rsciio.py +1 -1
  26. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_file_saving/test_scan_pattern_saving.py +1 -0
  27. deapi-5.3.1/deapi/tests/test_scanning/test_continual_scanning.py +496 -0
  28. deapi-5.3.1/deapi/tests/test_scanning/test_virtual_image_buffers.py +279 -0
  29. deapi-5.3.1/deapi/tests/test_utils/__init__.py +0 -0
  30. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_utils/test_utils.py +27 -35
  31. deapi-5.3.1/deapi/version.py +23 -0
  32. {deapi-5.3b5 → deapi-5.3.1}/deapi.egg-info/PKG-INFO +10 -6
  33. {deapi-5.3b5 → deapi-5.3.1}/deapi.egg-info/SOURCES.txt +15 -1
  34. {deapi-5.3b5 → deapi-5.3.1}/deapi.egg-info/requires.txt +12 -2
  35. deapi-5.3.1/doc/_static/ScanPatterns.png +0 -0
  36. deapi-5.3.1/doc/_static/digital_twin_holes.png +0 -0
  37. {deapi-5.3b5 → deapi-5.3.1}/doc/conf.py +1 -0
  38. {deapi-5.3b5 → deapi-5.3.1}/doc/help/pyDEServer.rst +24 -1
  39. {deapi-5.3b5 → deapi-5.3.1}/doc/reference/index.rst +8 -0
  40. deapi-5.3.1/doc/reference/scan_design.rst +727 -0
  41. deapi-5.3.1/examples/digital_twin/README.rst +6 -0
  42. deapi-5.3.1/examples/digital_twin/imaging_holes_with_the_digital_twin_sgskip.py +147 -0
  43. {deapi-5.3b5 → deapi-5.3.1}/examples/live_imaging/bright_spot_intensity.py +0 -1
  44. {deapi-5.3b5 → deapi-5.3.1}/pyproject.toml +59 -7
  45. deapi-5.3.1/upcoming_changes/.gitkeep +0 -0
  46. deapi-5.3.1/upcoming_changes/README.rst +92 -0
  47. deapi-5.3b5/CHANGES.rst +0 -21
  48. deapi-5.3b5/deapi/prop_dump.json +0 -570
  49. deapi-5.3b5/deapi/version.py +0 -3
  50. {deapi-5.3b5 → deapi-5.3.1}/.github/workflows/documentation.yaml +0 -0
  51. {deapi-5.3b5 → deapi-5.3.1}/.github/workflows/publish.yaml +0 -0
  52. {deapi-5.3b5 → deapi-5.3.1}/.github/workflows/test-publish.yaml +0 -0
  53. {deapi-5.3b5 → deapi-5.3.1}/LICENSE +0 -0
  54. {deapi-5.3b5 → deapi-5.3.1}/README.md +0 -0
  55. {deapi-5.3b5 → deapi-5.3.1}/deapi/Guide to use mamba.pdf +0 -0
  56. {deapi-5.3b5 → deapi-5.3.1}/deapi/buffer_protocols/pb_2_3_0.py +0 -0
  57. {deapi-5.3b5 → deapi-5.3.1}/deapi/buffer_protocols/pb_3_11_4.py +0 -0
  58. {deapi-5.3b5 → deapi-5.3.1}/deapi/buffer_protocols/pb_3_6_1.py +0 -0
  59. {deapi-5.3b5 → deapi-5.3.1}/deapi/fake_data/__init__.py +0 -0
  60. {deapi-5.3b5 → deapi-5.3.1}/deapi/fake_data/base_fake_data.py +0 -0
  61. {deapi-5.3b5 → deapi-5.3.1}/deapi/fake_data/grains.py +0 -0
  62. {deapi-5.3b5 → deapi-5.3.1}/deapi/index.rst +0 -0
  63. {deapi-5.3b5 → deapi-5.3.1}/deapi/python_3_instruction.txt +0 -0
  64. {deapi-5.3b5 → deapi-5.3.1}/deapi/release_notes.txt +0 -0
  65. {deapi-5.3b5 → deapi-5.3.1}/deapi/service/de_service.py +0 -0
  66. {deapi-5.3b5 → deapi-5.3.1}/deapi/simulated_server/__init__.py +0 -0
  67. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/__init__.py +0 -0
  68. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/01_fps.py +0 -0
  69. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/02_hwRoisize.py +0 -0
  70. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/03_hwBinning.py +0 -0
  71. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/04_swBinning.py +0 -0
  72. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/06_patternPixel.py +0 -0
  73. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/07_reference.py +0 -0
  74. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/08_virtmask.py +0 -0
  75. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/09_scanRoi.py +0 -0
  76. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/__init__.py +0 -0
  77. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/func.py +0 -0
  78. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/propertyName.py +0 -0
  79. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/original_tests/test_legacy.py +0 -0
  80. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/speed_tests/__init__.py +0 -0
  81. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/speed_tests/test_internal_file_saving.py +0 -0
  82. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/speed_tests/test_movie_buffer_transfer.py +0 -0
  83. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_binning_rois/__init__.py +0 -0
  84. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_binning_rois/test_rois.py +0 -0
  85. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_examples.py +0 -0
  86. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_fake_server/__init__.py +0 -0
  87. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_file_saving/__init__.py +0 -0
  88. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_file_saving/test_h5ebsd.py +0 -0
  89. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_insitu/__init__.py +0 -0
  90. {deapi-5.3b5 → deapi-5.3.1}/deapi/tests/test_insitu/test_start_stop.py +0 -0
  91. {deapi-5.3b5/deapi/tests/test_utils → deapi-5.3.1/deapi/tests/test_scanning}/__init__.py +0 -0
  92. {deapi-5.3b5 → deapi-5.3.1}/deapi/utils.py +0 -0
  93. {deapi-5.3b5 → deapi-5.3.1}/deapi/wrappers.py +0 -0
  94. {deapi-5.3b5 → deapi-5.3.1}/deapi.egg-info/dependency_links.txt +0 -0
  95. {deapi-5.3b5 → deapi-5.3.1}/deapi.egg-info/entry_points.txt +0 -0
  96. {deapi-5.3b5 → deapi-5.3.1}/deapi.egg-info/top_level.txt +0 -0
  97. {deapi-5.3b5 → deapi-5.3.1}/doc/Makefile +0 -0
  98. {deapi-5.3b5 → deapi-5.3.1}/doc/_static/de_api_icon.svg +0 -0
  99. {deapi-5.3b5 → deapi-5.3.1}/doc/_templates/autosummary/base.rst +0 -0
  100. {deapi-5.3b5 → deapi-5.3.1}/doc/_templates/custom-attribute-template.rst +0 -0
  101. {deapi-5.3b5 → deapi-5.3.1}/doc/_templates/custom-class-template.rst +0 -0
  102. {deapi-5.3b5 → deapi-5.3.1}/doc/_templates/custom-function-template.rst +0 -0
  103. {deapi-5.3b5 → deapi-5.3.1}/doc/_templates/custom-module-template.rst +0 -0
  104. {deapi-5.3b5 → deapi-5.3.1}/doc/_templates/custrom-method-template.rst +0 -0
  105. {deapi-5.3b5 → deapi-5.3.1}/doc/changes.rst +0 -0
  106. {deapi-5.3b5 → deapi-5.3.1}/doc/help/dev_guide.rst +0 -0
  107. {deapi-5.3b5 → deapi-5.3.1}/doc/help/help.rst +0 -0
  108. {deapi-5.3b5 → deapi-5.3.1}/doc/help/index.rst +0 -0
  109. {deapi-5.3b5 → deapi-5.3.1}/doc/index.rst +0 -0
  110. {deapi-5.3b5 → deapi-5.3.1}/doc/intro.rst +0 -0
  111. {deapi-5.3b5 → deapi-5.3.1}/doc/make.bat +0 -0
  112. {deapi-5.3b5 → deapi-5.3.1}/examples/README.rst +0 -0
  113. {deapi-5.3b5 → deapi-5.3.1}/examples/live_imaging/README.rst +0 -0
  114. {deapi-5.3b5 → deapi-5.3.1}/examples/live_imaging/taking_an_image_every_minute.py +0 -0
  115. {deapi-5.3b5 → deapi-5.3.1}/examples/live_imaging/viewing_the_sensor.py +0 -0
  116. {deapi-5.3b5 → deapi-5.3.1}/examples/live_imaging/viewing_the_sensor_tem.py +0 -0
  117. {deapi-5.3b5 → deapi-5.3.1}/examples/references/README.rst +0 -0
  118. {deapi-5.3b5 → deapi-5.3.1}/examples/setting_parameters/README.rst +0 -0
  119. {deapi-5.3b5 → deapi-5.3.1}/examples/setting_parameters/setting_up_stem.py +0 -0
  120. {deapi-5.3b5 → deapi-5.3.1}/examples/virtual_imaging/README.rst +0 -0
  121. {deapi-5.3b5 → deapi-5.3.1}/examples/virtual_imaging/setting_virtual_masks.py +0 -0
  122. {deapi-5.3b5 → deapi-5.3.1}/examples/virtual_imaging/vdf_vbf.py +0 -0
  123. {deapi-5.3b5 → deapi-5.3.1}/examples/visualization/README.rst +0 -0
  124. {deapi-5.3b5 → deapi-5.3.1}/examples/visualization/creating_a_simple_dashboard.py +0 -0
  125. {deapi-5.3b5 → deapi-5.3.1}/examples/visualization/using_get_result.py +0 -0
  126. {deapi-5.3b5 → deapi-5.3.1}/setup.cfg +0 -0
@@ -9,26 +9,25 @@ env:
9
9
  MPLBACKEND: agg
10
10
 
11
11
  jobs:
12
- build-with-pip:
12
+ build-with-uv:
13
13
  name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }}
14
14
  runs-on: ${{ matrix.os }}
15
- timeout-minutes: 15
15
+ timeout-minutes: 20
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- os: [ubuntu-latest, windows-latest]
20
- python-version: ["3.12", "3.13", "3.14"]
19
+ os: [ubuntu-latest, windows-latest, macos-latest]
20
+ python-version: ["3.12", "3.13"]
21
21
  include:
22
22
  - os: ubuntu-latest
23
- python-version: 3.11
24
-
25
- DEPENDENCIES: protobuf==5.26.0
23
+ python-version: "3.10"
24
+ DEPENDENCIES: protobuf==6.33.5
26
25
  LABEL: -oldest
27
26
  steps:
28
- - uses: actions/checkout@v3
27
+ - uses: actions/checkout@v4
29
28
 
30
- - name: Set up Python ${{ matrix.python-version }}
31
- uses: actions/setup-python@v4
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@v5
32
31
  with:
33
32
  python-version: ${{ matrix.python-version }}
34
33
 
@@ -45,34 +44,32 @@ jobs:
45
44
  shell: python
46
45
 
47
46
  - name: Install dependencies and package
48
- shell: bash
49
47
  run: |
50
- pip install -U -e .'[tests]'
48
+ uv sync --extra tests
51
49
 
52
50
  - name: Install oldest supported versions
53
51
  if: contains(matrix.LABEL, 'oldest')
54
52
  run: |
55
- pip install ${{ matrix.DEPENDENCIES }}
53
+ uv pip install ${{ matrix.DEPENDENCIES }}
56
54
 
57
55
  - name: Display Python, pip and package versions
58
56
  run: |
59
- python -V
60
- pip -V
61
- pip list
57
+ uv run python -V
58
+ uv pip list
62
59
 
63
60
  - name: Run docstring tests
64
61
  continue-on-error: true
65
62
  run: |
66
- pytest --doctest-modules --doctest-continue-on-failure --ignore-glob=deapi/tests deapi
63
+ uv run pytest --doctest-modules --doctest-continue-on-failure --ignore-glob=deapi/tests deapi
67
64
 
68
65
  - name: Run tests
69
66
  run: |
70
- pytest --cov=. --cov-report=xml
67
+ uv run pytest --timeout=60 --cov=. --cov-report=xml
71
68
 
72
69
  - name: Generate line coverage
73
70
  if: ${{ matrix.os == 'ubuntu-latest' }}
74
71
  run: |
75
- coverage report --show-missing
72
+ uv run coverage report --show-missing
76
73
 
77
74
  - name: Upload coverage to Codecov
78
75
  if: ${{ always() }}
@@ -0,0 +1,192 @@
1
+ name: Prepare Release
2
+
3
+ # Run manually from the Actions tab.
4
+ # Opens a PR that bumps the version in pyproject.toml and builds CHANGES.rst from
5
+ # the towncrier fragments in upcoming_changes/. After merging it, create the GitHub
6
+ # Release by hand (tag v<version>); publishing the release triggers publish.yaml,
7
+ # which uploads to PyPI.
8
+ on:
9
+ workflow_dispatch:
10
+ inputs:
11
+ bump:
12
+ description: "Version component to bump"
13
+ required: true
14
+ type: choice
15
+ options:
16
+ - pre-release # increments the bN counter on the current base version (5.3b6 -> 5.3.0b7)
17
+ - finalize # drop the bN suffix: release the current beta's base as stable (5.3b6 -> 5.3.0)
18
+ - minor
19
+ - bugfix
20
+ - major
21
+ beta:
22
+ description: "Mark as beta pre-release (adds bN suffix). Ignored for 'pre-release' (always beta) and 'finalize' (always stable)."
23
+ required: false
24
+ type: boolean
25
+ default: false
26
+
27
+ permissions:
28
+ contents: write # push branch
29
+ pull-requests: write # open PR
30
+
31
+ jobs:
32
+ prepare:
33
+ name: Prepare release PR
34
+ runs-on: ubuntu-latest
35
+
36
+ steps:
37
+ - name: Checkout repository
38
+ uses: actions/checkout@v4
39
+ with:
40
+ fetch-depth: 0
41
+
42
+ - name: Set up uv
43
+ uses: astral-sh/setup-uv@v5
44
+ with:
45
+ python-version: "3.13"
46
+ enable-cache: true
47
+
48
+ # ── Compute the new version ──────────────────────────────────────────
49
+ - name: Compute new version
50
+ id: version
51
+ env:
52
+ BUMP: ${{ inputs.bump }}
53
+ IS_BETA: ${{ inputs.beta }}
54
+ run: |
55
+ CURRENT=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
56
+ export CURRENT_VERSION="$CURRENT"
57
+
58
+ NEW_VERSION=$(python3 - <<'PYEOF'
59
+ import re, os
60
+
61
+ current = os.environ["CURRENT_VERSION"]
62
+ bump = os.environ["BUMP"]
63
+ is_beta = os.environ["IS_BETA"].lower() == "true"
64
+
65
+ # deapi's versions have had no patch component (5.3b6); read it as 0 and
66
+ # always write major.minor.patch from here on (5.3b6 == 5.3.0b6 in PEP 440).
67
+ m = re.match(r"^(\d+)\.(\d+)(?:\.(\d+))?(?:b(\d+))?$", current)
68
+ if not m:
69
+ raise SystemExit(f"cannot parse the current version {current!r}")
70
+ major = int(m.group(1))
71
+ minor = int(m.group(2))
72
+ patch = int(m.group(3) or 0)
73
+ beta_n = int(m.group(4)) if m.group(4) else None
74
+ on_beta = beta_n is not None
75
+
76
+ if bump == "finalize":
77
+ # Release the current beta's base as stable: just drop the bN
78
+ # suffix, keep major.minor.patch. e.g. 5.3.0b7 -> 5.3.0.
79
+ if not on_beta:
80
+ raise SystemExit(
81
+ f"'finalize' requires a beta base version, but current "
82
+ f"version {current!r} has no bN suffix. Use minor / bugfix "
83
+ f"/ major to start a new release instead."
84
+ )
85
+ is_beta = False
86
+ elif bump == "pre-release":
87
+ # Keep the same base; just walk the beta counter forward.
88
+ is_beta = True
89
+ beta_n = (beta_n or 0) + 1
90
+ elif on_beta:
91
+ # We are on a beta of the NEXT release (e.g. 5.3.0b7). The base
92
+ # major.minor.patch is that upcoming version, so minor/bugfix/major
93
+ # would skip it entirely. The common intent from a beta is
94
+ # 'finalize', so steer the user there rather than guess.
95
+ raise SystemExit(
96
+ f"Current version {current!r} is a beta of the upcoming "
97
+ f"{major}.{minor}.{patch} release. To ship it, use bump="
98
+ f"'finalize' (-> {major}.{minor}.{patch}). A '{bump}' bump from "
99
+ f"a beta would skip {major}.{minor}.{patch} entirely; "
100
+ f"that is almost never intended."
101
+ )
102
+ elif bump == "major":
103
+ major, minor, patch = major + 1, 0, 0
104
+ elif bump == "minor":
105
+ minor, patch = minor + 1, 0
106
+ elif bump == "bugfix":
107
+ patch += 1
108
+
109
+ if is_beta:
110
+ if bump != "pre-release":
111
+ beta_n = 1 # fresh beta series for the new base
112
+ print(f"{major}.{minor}.{patch}b{beta_n}", end="")
113
+ else:
114
+ print(f"{major}.{minor}.{patch}", end="")
115
+ PYEOF
116
+ )
117
+
118
+ # Derive is_beta from the COMPUTED version (ends in bN?), not the raw input.
119
+ if [[ "$NEW_VERSION" =~ b[0-9]+$ ]]; then IS_BETA_OUT=true; else IS_BETA_OUT=false; fi
120
+
121
+ echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
122
+ echo "tag=v$NEW_VERSION" >> "$GITHUB_OUTPUT"
123
+ echo "branch=release/v$NEW_VERSION" >> "$GITHUB_OUTPUT"
124
+ echo "is_beta=$IS_BETA_OUT" >> "$GITHUB_OUTPUT"
125
+ echo "Bumping (${{ inputs.bump }}): $CURRENT → $NEW_VERSION"
126
+
127
+ # ── Bump version strings ─────────────────────────────────────────────
128
+ # Only the package version: deapi/version.py holds the client's protocol
129
+ # version (sent to DE-Server), which does not follow package releases.
130
+ - name: Bump version in pyproject.toml
131
+ run: |
132
+ sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.new_version }}"/' pyproject.toml
133
+
134
+ # ── Build changelog ──────────────────────────────────────────────────
135
+ - name: Build changelog with towncrier
136
+ run: |
137
+ FRAGMENT_COUNT=$(find upcoming_changes -maxdepth 1 -name "*.rst" \
138
+ ! -name "README.rst" | wc -l)
139
+ if [ "$FRAGMENT_COUNT" -eq 0 ]; then
140
+ echo "⚠ No news fragments found — skipping towncrier (CHANGES.rst unchanged)."
141
+ else
142
+ uvx towncrier build --yes --version "${{ steps.version.outputs.new_version }}"
143
+ fi
144
+
145
+ # ── Commit and push ──────────────────────────────────────────────────
146
+ - name: Configure git
147
+ run: |
148
+ git config user.name "github-actions[bot]"
149
+ git config user.email "github-actions[bot]@users.noreply.github.com"
150
+
151
+ - name: Commit release changes
152
+ run: |
153
+ git checkout -b "${{ steps.version.outputs.branch }}"
154
+
155
+ # Stage the version bump, updated changelog, and consumed fragments.
156
+ git add pyproject.toml CHANGES.rst
157
+ git add -A upcoming_changes/ # stages deleted fragment files
158
+
159
+ git commit -m "chore: prepare release ${{ steps.version.outputs.tag }}"
160
+ git push origin "${{ steps.version.outputs.branch }}"
161
+
162
+ # ── Open pull request ────────────────────────────────────────────────
163
+ - name: Open pull request
164
+ env:
165
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166
+ TAG: ${{ steps.version.outputs.tag }}
167
+ BRANCH: ${{ steps.version.outputs.branch }}
168
+ IS_BETA: ${{ steps.version.outputs.is_beta }}
169
+ run: |
170
+ if [ "$IS_BETA" = "true" ]; then PRE="tick **Set as a pre-release**"; else PRE="leave **Set as a pre-release** unticked"; fi
171
+ gh pr create \
172
+ --title "Release ${TAG}" \
173
+ --base main \
174
+ --head "${BRANCH}" \
175
+ --body "## Release ${TAG}
176
+
177
+ > Auto-generated by the **Prepare Release** workflow.
178
+
179
+ ### What changed
180
+ - Version bumped to \`${TAG#v}\` in \`pyproject.toml\`
181
+ - \`CHANGES.rst\` updated from the towncrier fragments in \`upcoming_changes/\`
182
+
183
+ ### Review checklist
184
+ - [ ] \`CHANGES.rst\` reads well — edit the text directly in this PR if needed
185
+ - [ ] The version in \`pyproject.toml\` is correct
186
+ - [ ] CI passes
187
+
188
+ ### After merging
189
+ Create the GitHub Release by hand: **Releases → Draft a new release**, tag
190
+ \`${TAG}\` on \`main\`, paste this version's section of \`CHANGES.rst\` as the
191
+ notes, ${PRE}, and publish. Publishing it runs \`publish.yaml\`, which uploads
192
+ to PyPI."
@@ -1,7 +1,7 @@
1
1
  repos:
2
2
  - repo: https://github.com/psf/black-pre-commit-mirror
3
3
  # Version can be updated by running "pre-commit autoupdate"
4
- rev: 25.9.0
4
+ rev: 26.5.1
5
5
  hooks:
6
6
  - id: black
7
7
  ci:
@@ -0,0 +1,92 @@
1
+ .. _changelog:
2
+
3
+ Changelog
4
+ *********
5
+
6
+ This document describes the changes in the DEAPI library.
7
+
8
+ Changes are filed as fragment files in ``upcoming_changes/`` and assembled into this
9
+ file by `towncrier <https://towncrier.readthedocs.io/>`_ when a release is prepared
10
+ (see ``upcoming_changes/README.rst``).
11
+
12
+ .. towncrier release notes start
13
+
14
+ 5.3.1 (2026-09-25)
15
+ ==================
16
+
17
+ Maintenance
18
+ -----------
19
+
20
+ - Bumped the google protobuf version to 6.33 and dropped support for Python < 3.10. Closes #3691 (`#64 <https://github.com/directelectron/deapi/pull/64>`_)
21
+
22
+
23
+ 5.3.0 (2026-09-24)
24
+ ==================
25
+
26
+ New Features
27
+ ------------
28
+
29
+ - ``pydeserver --twin`` serves frames rendered by the `de-twin <https://github.com/directelectron/de-twin>`_ digital twin instead of the built-in fake data: a simulated microscope, specimen and detector, with a DE-TEM-Channel (``--soap-port``) so stage and optics changes show up in the images. Install it with ``pip install "deapi[twin]"``. (`#59 <https://github.com/directelectron/deapi/pull/59>`_)
30
+
31
+
32
+ Bug Fixes
33
+ ---------
34
+
35
+ - Fixed virtual masks and XY scan arrays sometimes arriving incomplete, which hung the connection (seen on macOS): the client now sends every byte of them. (`#60 <https://github.com/directelectron/deapi/pull/60>`_)
36
+
37
+
38
+ Documentation
39
+ -------------
40
+
41
+ - Added an example that moves the stage with ``de_microscope`` and images holes in a grid, run against the digital twin. (`#59 <https://github.com/directelectron/deapi/pull/59>`_)
42
+
43
+
44
+ Maintenance
45
+ -----------
46
+
47
+ - The simulated server closes a connection after an error, so the client gets an error instead of waiting; the test suite only stops deapi's own simulated server on port 13240, never a real DE-Server. (`#60 <https://github.com/directelectron/deapi/pull/60>`_)
48
+ - Releases are prepared by the **Prepare Release** workflow, and the changelog is assembled from towncrier fragments in ``upcoming_changes/``, as in the other Direct Electron Python packages. (`#61 <https://github.com/directelectron/deapi/pull/61>`_)
49
+
50
+
51
+ 5.3.beta6
52
+ =========
53
+ - Fixed invalid property errors and bugs in set_binning
54
+ - Updated get_property_specifications
55
+ - Do not automatically set attributes.windowWidth and attributes.windowHeight
56
+ - Return pattern index for get_result and get_virtual_image_buffer
57
+
58
+ 5.3.beta5
59
+ =========
60
+ - Modify gain acquisition
61
+
62
+ 5.3.beta4
63
+ =========
64
+ - Add GetEvent functionality to client.py
65
+ - Fixed bug in set_binning
66
+
67
+ 5.3.beta3
68
+ =========
69
+ - Fix the problem that the set_binning function could not set HW binning to 1
70
+
71
+ 5.3.beta2
72
+ =========
73
+ - Add access register
74
+
75
+ 5.3.beta1
76
+ =========
77
+ - Create a Result Class to handle Result + Histogram
78
+
79
+ 5.3.beta0
80
+ =========
81
+ - Add support for binning in x/ y dimensions when returning a result (#19)
82
+
83
+ 5.2.2
84
+ ==========
85
+ - Initial release
86
+ - Renamed `Client` functions from CamelCase to snake_case (Legacy functions are still available)
87
+ - Added buffer_protocol module for handling different buffer protocol files
88
+ - Added a data_types module for handling different data types
89
+ - Added a python based DEServer for testing purposes
90
+ - Update the Testing to allow for a real DEServer to be used for testing (#7)
91
+ - Add support for `@pytest.mark.server` decorator for tests that require a full DEServer to be running (#7)
92
+ - Add a commandline interface for the pydeserver. (#8) Running `pydeserver --port 13241` will start the server on port 13241
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deapi
3
- Version: 5.3b5
3
+ Version: 5.3.1
4
4
  Summary: API for DE Server
5
5
  Author: Direct Electron
6
6
  Project-URL: Bug Reports, https://github.com/directelectron/deapi/issues
@@ -12,21 +12,21 @@ Keywords: EELS,STEM,TEM,hyperspy,microscopy,Cryo EM,4D STEM
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Science/Research
14
14
  Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
15
  Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
20
19
  Classifier: Topic :: Scientific/Engineering
21
- Requires-Python: >=3.8
20
+ Requires-Python: >=3.10
22
21
  License-File: LICENSE
23
22
  Requires-Dist: numpy>=1.20.0
24
- Requires-Dist: protobuf
23
+ Requires-Dist: protobuf<7,>=6.33.5
25
24
  Requires-Dist: pillow
26
25
  Requires-Dist: matplotlib
27
26
  Requires-Dist: scipy
28
27
  Requires-Dist: scikit-image
29
28
  Requires-Dist: sympy
29
+ Requires-Dist: pywin32; platform_system == "Windows"
30
30
  Provides-Extra: tests
31
31
  Requires-Dist: pytest-instafail; extra == "tests"
32
32
  Requires-Dist: pytest-mpl; extra == "tests"
@@ -36,12 +36,16 @@ Requires-Dist: pytest>=3.6; extra == "tests"
36
36
  Requires-Dist: setuptools_scm; extra == "tests"
37
37
  Requires-Dist: pytest-cov; extra == "tests"
38
38
  Requires-Dist: pytest-xprocess; extra == "tests"
39
- Requires-Dist: libertem; extra == "tests"
39
+ Requires-Dist: pytest-timeout; extra == "tests"
40
40
  Requires-Dist: hyperspy; extra == "tests"
41
+ Requires-Dist: psutil; extra == "tests"
41
42
  Provides-Extra: service
42
43
  Requires-Dist: pyqt6; extra == "service"
44
+ Provides-Extra: twin
45
+ Requires-Dist: de-twin>=0.1.1; python_version >= "3.10" and extra == "twin"
43
46
  Provides-Extra: doc
44
47
  Requires-Dist: sphinx; extra == "doc"
45
48
  Requires-Dist: pydata_sphinx_theme; extra == "doc"
46
49
  Requires-Dist: sphinx-gallery; extra == "doc"
50
+ Requires-Dist: sphinx-tabs; extra == "doc"
47
51
  Dynamic: license-file
@@ -7,6 +7,7 @@ from deapi.data_types import (
7
7
  DataType,
8
8
  MovieBufferStatus,
9
9
  MovieBufferInfo,
10
+ VirtualImageInfo,
10
11
  VirtualMask,
11
12
  ContrastStretchType,
12
13
  Attributes,
@@ -15,7 +16,6 @@ from deapi.data_types import (
15
16
  PropertyCollection,
16
17
  )
17
18
 
18
-
19
19
  __all__ = [
20
20
  "Client",
21
21
  "__version__",
@@ -24,6 +24,7 @@ __all__ = [
24
24
  "DataType",
25
25
  "MovieBufferStatus",
26
26
  "MovieBufferInfo",
27
+ "VirtualImageInfo",
27
28
  "VirtualMask",
28
29
  "ContrastStretchType",
29
30
  "Attributes",
@@ -17,8 +17,7 @@ else:
17
17
 
18
18
  long = int # python 3 no longer has int
19
19
  if int(pyVersion[1]) >= 10:
20
- # import pb_3_19_3 as pb
21
- import deapi.buffer_protocols.pb_3_23_3 as pb
20
+ import deapi.buffer_protocols.pb_6_33_4 as pb
22
21
  elif int(pyVersion[1]) >= 8:
23
22
  import deapi.buffer_protocols.pb_3_11_4 as pb
24
23
  else:
@@ -2,6 +2,7 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: DE.proto
4
4
  """Generated protocol buffer code."""
5
+
5
6
  from google.protobuf import descriptor as _descriptor
6
7
  from google.protobuf import descriptor_pool as _descriptor_pool
7
8
  from google.protobuf import message as _message
@@ -2,6 +2,7 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: DE.proto
4
4
  """Generated protocol buffer code."""
5
+
5
6
  from google.protobuf import descriptor as _descriptor
6
7
  from google.protobuf import descriptor_pool as _descriptor_pool
7
8
  from google.protobuf import symbol_database as _symbol_database
@@ -0,0 +1,47 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: DE.proto
5
+ # Protobuf Python Version: 6.33.4
6
+ """Generated protocol buffer code."""
7
+
8
+ from google.protobuf import descriptor as _descriptor
9
+ from google.protobuf import descriptor_pool as _descriptor_pool
10
+ from google.protobuf import runtime_version as _runtime_version
11
+ from google.protobuf import symbol_database as _symbol_database
12
+ from google.protobuf.internal import builder as _builder
13
+
14
+ _runtime_version.ValidateProtobufRuntimeVersion(
15
+ _runtime_version.Domain.PUBLIC, 6, 33, 4, "", "DE.proto"
16
+ )
17
+ # @@protoc_insertion_point(imports)
18
+
19
+ _sym_db = _symbol_database.Default()
20
+
21
+
22
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
23
+ b'\n\x08\x44\x45.proto\x12\x0b\x44\x45Messaging"\xbd\x02\n\x08\x44\x45Packet\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.DEMessaging.DEPacket.Type\x12\x19\n\x11\x63\x61mera_identifier\x18\x02 \x01(\r\x12+\n\x07\x63ommand\x18\x03 \x03(\x0b\x32\x1a.DEMessaging.SingleCommand\x12\x33\n\x0b\x61\x63knowledge\x18\x04 \x03(\x0b\x32\x1e.DEMessaging.SingleAcknowledge\x12,\n\x0b\x64\x61ta_header\x18\x05 \x01(\x0b\x32\x17.DEMessaging.DataHeader\x12\x13\n\x0b\x63\x61mera_name\x18\x06 \x01(\t"G\n\x04Type\x12\n\n\x06P_NULL\x10\x00\x12\r\n\tP_COMMAND\x10\x01\x12\x11\n\rP_ACKNOWLEDGE\x10\x02\x12\x11\n\rP_DATA_HEADER\x10\x03"g\n\rSingleCommand\x12\x12\n\ncommand_id\x18\x01 \x01(\r\x12\x14\n\x0c\x63ommand_name\x18\x02 \x01(\t\x12,\n\tparameter\x18\x03 \x03(\x0b\x32\x19.DEMessaging.AnyParameter"\xf0\x01\n\x0c\x41nyParameter\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.DEMessaging.AnyParameter.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05p_int\x18\x03 \x01(\x11\x12\x0e\n\x06p_bool\x18\x04 \x01(\x08\x12\x10\n\x08p_string\x18\x05 \x01(\t\x12\x0f\n\x07p_float\x18\x06 \x01(\x02\x12\x0f\n\x07p_bytes\x18\x07 \x01(\x0c"Q\n\x04Type\x12\n\n\x06P_NULL\x10\x00\x12\t\n\x05P_INT\x10\x01\x12\n\n\x06P_BOOL\x10\x02\x12\x0c\n\x08P_STRING\x10\x03\x12\x0b\n\x07P_FLOAT\x10\x04\x12\x0b\n\x07P_BYTES\x10\x05"]\n\x0b\x41\x63knowledge\x12\x19\n\x11\x63\x61mera_identifier\x18\x01 \x01(\r\x12\x33\n\x0b\x61\x63knowledge\x18\x02 \x03(\x0b\x32\x1e.DEMessaging.SingleAcknowledge"\x91\x01\n\x11SingleAcknowledge\x12\r\n\x05\x65rror\x18\x01 \x01(\x08\x12\x12\n\ncommand_id\x18\x02 \x01(\r\x12\x14\n\x0c\x63ommand_name\x18\x03 \x01(\t\x12\x15\n\rerror_message\x18\x04 \x01(\t\x12,\n\tparameter\x18\x05 \x03(\x0b\x32\x19.DEMessaging.AnyParameter"2\n\nDataHeader\x12\x10\n\x08\x62ytesize\x18\x01 \x01(\x04\x12\x12\n\nidentifier\x18\x02 \x01(\tb\x06proto3'
24
+ )
25
+
26
+ _globals = globals()
27
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
28
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "DE_pb2", _globals)
29
+ if not _descriptor._USE_C_DESCRIPTORS:
30
+ DESCRIPTOR._loaded_options = None
31
+ _globals["_DEPACKET"]._serialized_start = 26
32
+ _globals["_DEPACKET"]._serialized_end = 343
33
+ _globals["_DEPACKET_TYPE"]._serialized_start = 272
34
+ _globals["_DEPACKET_TYPE"]._serialized_end = 343
35
+ _globals["_SINGLECOMMAND"]._serialized_start = 345
36
+ _globals["_SINGLECOMMAND"]._serialized_end = 448
37
+ _globals["_ANYPARAMETER"]._serialized_start = 451
38
+ _globals["_ANYPARAMETER"]._serialized_end = 691
39
+ _globals["_ANYPARAMETER_TYPE"]._serialized_start = 610
40
+ _globals["_ANYPARAMETER_TYPE"]._serialized_end = 691
41
+ _globals["_ACKNOWLEDGE"]._serialized_start = 693
42
+ _globals["_ACKNOWLEDGE"]._serialized_end = 786
43
+ _globals["_SINGLEACKNOWLEDGE"]._serialized_start = 789
44
+ _globals["_SINGLEACKNOWLEDGE"]._serialized_end = 934
45
+ _globals["_DATAHEADER"]._serialized_start = 936
46
+ _globals["_DATAHEADER"]._serialized_end = 986
47
+ # @@protoc_insertion_point(module_scope)