Skip to content

Commit 9ba8d5e

Browse files
authored
Merge pull request #78 from instamatic-dev/tweaks
Maintenance and documentation
2 parents 5fc2696 + ad001df commit 9ba8d5e

189 files changed

Lines changed: 508 additions & 404 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[bumpversion]
2-
current_version = 1.10.0
2+
current_version = 2.0.0
33

44
[comment]
55
comment = The contents of this file cannot be merged with that of setup.cfg until https://github.com/c4urself/bump2version/issues/185 is resolved
66

7-
[bumpversion:file:instamatic/__init__.py]
7+
[bumpversion:file:src/instamatic/__init__.py]
88
search = __version__ = '{current_version}'
99
replace = __version__ = '{new_version}'
1010

11-
[bumpversion:file:setup.cfg]
12-
search = version = {current_version}
13-
replace = version = {new_version}
11+
[bumpversion:file:pyproject.toml]
12+
search = version = "{current_version}"
13+
replace = version = "{new_version}"
1414

1515
[bumpversion:file:CITATION.cff]
1616
search = version: "{current_version}"

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-python@v4
1414
with:
15-
python-version: 3.9
15+
python-version: '3.11'
1616

1717
- name: Install dependencies
1818
run: |
1919
python -m pip install --upgrade pip
20-
pip install setuptools wheel twine
21-
python setup.py sdist bdist_wheel
20+
pip install -U build setuptools wheel
21+
python -m build --no-isolation
2222
2323
- name: Publish package
24-
uses: pypa/gh-action-pypi-publish@master
24+
uses: pypa/gh-action-pypi-publish@release/v1
2525
with:
2626
user: __token__
2727
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
id: cache-python-env
3838
with:
3939
path: ${{ env.pythonLocation }}
40-
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
40+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
4141

4242
- name: Install
4343
if: steps.cache-python-env.outputs.cache-hit != 'true'

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ doi: "10.5281/zenodo.1090388"
2727
license: "BSD-3-Clause"
2828
message: "If you use this software, please cite it using these metadata."
2929
title: Instamatic
30-
version: "1.10.0"
30+
version: "2.0.0"
3131
...

MANIFEST.in

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ include setup_win.bat
1313
include tests/*.py
1414
include tests/config/*.yaml
1515
include tests/config/*/*.yaml
16-
include instamatic/camera/*.dll
17-
include instamatic/camera/*.h
18-
include instamatic/camera/*.lockfile
19-
include instamatic/camera/*.md
20-
include instamatic/camera/tpx/*.bpc
21-
include instamatic/camera/tpx/*.dacs
22-
include instamatic/camera/tpx/*.txt
23-
include instamatic/config/*.yaml
24-
include instamatic/config/alignments/*.yaml
25-
include instamatic/config/calibration/*.yaml
26-
include instamatic/config/camera/*.yaml
27-
include instamatic/config/microscope/*.yaml
28-
include instamatic/config/scripts/*.md
29-
include instamatic/neural_network/*.p
16+
include src/instamatic/camera/*.dll
17+
include src/instamatic/camera/*.h
18+
include src/instamatic/camera/*.lockfile
19+
include src/instamatic/camera/*.md
20+
include src/instamatic/camera/tpx/*.bpc
21+
include src/instamatic/camera/tpx/*.dacs
22+
include src/instamatic/camera/tpx/*.txt
23+
include src/instamatic/config/*.yaml
24+
include src/instamatic/config/alignments/*.yaml
25+
include src/instamatic/config/calibration/*.yaml
26+
include src/instamatic/config/camera/*.yaml
27+
include src/instamatic/config/microscope/*.yaml
28+
include src/instamatic/config/scripts/*.md
29+
include src/instamatic/neural_network/*.p

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ instamatic.autoconfig.exe
2626
```
2727
To help generate some of the input files (in particular templates for the microscope/calibration files).
2828

29-
Examples of configuration files can be found [here](https://github.com/instamatic-dev/instamatic/tree/main/instamatic/config).
29+
Examples of configuration files can be found [here](https://github.com/instamatic-dev/instamatic/tree/main/src/instamatic/config).
3030

3131
## settings.yaml
3232

docs/examples/montage_processing.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
" for i, image in enumerate(buffer):\n",
320320
" x, y, z, _, _ = stagepos[i]\n",
321321
" shape = image.shape\n",
322-
" # binsize = ctrl.cam.getBinning()\n",
322+
" # binsize = ctrl.cam.get_binning()\n",
323323
"\n",
324324
" d = {}\n",
325325
" d['StageXYZ'] = x / 1000, y / 1000, z / 1000\n",

docs/merlin.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The [MerlinEM detector](https://quantumdetectors.com/products/merlinem/) by Quan
44

55
Instamatic communicates with the Merlin control software via TCP/IP connection. This means that there is a fast connection with little overhead when collecting data.
66

7-
In continous read/write mode, instamatic can achieve gapless data acquisition `MerlinCamera.getMovie()`. When continuously collecting single images using `MerlinCamera.getImage()`, there is a ~3 ms overhead per frame.
7+
In continous read/write mode, instamatic can achieve gapless data acquisition `MerlinCamera.get_movie()`. When continuously collecting single images using `MerlinCamera.get_image()`, there is a ~3 ms overhead per frame.
88

99
## Setup
1010

@@ -16,7 +16,7 @@ camera: merlin
1616
1717
You can set up the parameters for the Merlin camera through `camera/merlin.yaml` in your config directory.
1818

19-
For an example config file, see: [`camera/merlin.yaml`](https://github.com/instamatic-dev/instamatic/blob/main/instamatic/config/camera/merlin.yaml). [Click here](/config.md#camerayaml) to go to the page with all common camera configuration parameters.
19+
For an example config file, see: [`camera/merlin.yaml`](https://github.com/instamatic-dev/instamatic/blob/main/src/instamatic/config/camera/merlin.yaml). [Click here](/config.md#camerayaml) to go to the page with all common camera configuration parameters.
2020

2121
In addition, the Merlin camera has the following parameters to configure:
2222

@@ -34,18 +34,24 @@ host: '10.0.0.123'
3434

3535
**detector_config**
3636
: The parameters under `detector_config` are directly sent to the Merlin software when instamatic starts.
37-
These can be used to put the Merlin in the desired state for data acquisition. Check the Merlin documention for more information.
37+
These can be used to put the Merlin in the desired state for data acquisition. Any command with a `SET` type can be adjusted. Check the Merlin EM documention for more information.
38+
39+
: The default sets continuous read-write mode and 12-bit mode to minimize the gap between frames. It also disables automatic file writing (`FILEENABLE`) and image processing by Merlin, and enables headless `RUNHEADLESS` mode for faster throughput. If you don't want this, you can delete these lines or modify them.
3840

39-
: For example:
41+
```yaml
42+
detector_config:
43+
CONTINUOUSRW: 1
44+
COUNTERDEPTH: 12
45+
FILEENABLE: 0
46+
RUNHEADLESS: 1
47+
```
48+
49+
: You could for example also set the thresholds and bias in the instamatic config by adding these lines:
4050
```yaml
4151
detector_config:
4252
THRESHOLD0: 120
4353
THRESHOLD1: 40
4454
HVBIAS: 511
45-
COUNTERDEPTH: 12
46-
FILEENABLE: 0
47-
CONTINUOUSRW: 1
48-
RUNHEADLESS: 0
4955
```
5056

5157
## Notes on using instamatic with Merlin

docs/programs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ instamatic.xdsserver [-h]
604604
605605
## instamatic.temserver_fei
606606
607-
Utility script to enable rotation control from a dmscript. See [https://github.com/instamatic-dev/instamatic/tree/master/dmscript] for usage.
607+
Utility script to enable rotation control from a dmscript. See [https://github.com/instamatic-dev/InsteaDMatic] for usage.
608608
609609
**Usage:**
610610
```bash

docs/tem_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ctrl = TEMController.initialize(tem_name='jeol', cam_name=None)
3131

3232
Once a `ctrl` (control) object has been initialized, it becomes possible to play around with the lenses and stage interactively. Type `ctrl.` and hit `tab` to see the autocomplete options. Or write use `?` to request the doc string for a function (e.g. `TEMController.initialize?`).
3333

34-
Based on this you can write your own python scripts to control the microscope and/or camera. See in `instamatic/instamatic/experiments/cred/experiment.py` for an idea how this is used. All the microscope control interface can be found in `instamatic/TEMController/`
34+
Based on this you can write your own python scripts to control the microscope and/or camera. See in `src/instamatic/experiments/cred/experiment.py` for an idea how this is used. All the microscope control interface can be found in `src/instamatic/TEMController/`
3535

3636
The `ctrl` object allows full control over the electron microscope. For example, to read out the position of the sample stage:
3737
```python

0 commit comments

Comments
 (0)