Skip to content

Commit f21e16d

Browse files
authored
Merge pull request #390 from linien-org/release/v2.0.0
Release v2.0.0
2 parents fd961e3 + 6460c91 commit f21e16d

Some content is hidden

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

74 files changed

+1302
-1170
lines changed

.flake8

Lines changed: 0 additions & 5 deletions
This file was deleted.

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.bin filter=lfs diff=lfs merge=lfs -text
2-
*.sh eol=lf
2+
*.sh eol=lf
3+
mdio-tool filter=lfs diff=lfs merge=lfs -text

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 23.11.0
3+
rev: 24.3.0
44
hooks:
55
- id: black
66
exclude: ^(gateware/logic/|gateware/lowlevel/|gateware/linien_module.py|linien-server/linien_server/csrmap.py)
77

88
- repo: https://github.com/pycqa/isort
9-
rev: 5.12.0
9+
rev: 5.13.2
1010
hooks:
1111
- id: isort
1212
name: isort (python)
13+
14+
- repo: https://github.com/pycqa/flake8
15+
rev: 6.1.0
16+
hooks:
17+
- id: flake8
18+
exclude: linien-server/linien_server/csrmap.py
19+
additional_dependencies: [flake8-pyproject]

CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,29 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) in spirit but
7-
uses [PEP440](https://peps.python.org/pep-0440/) for the version identification.
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.0.0] - 2024-04-05
9+
10+
### Added
11+
* Use features of Python 3.10 available on RedPitaya OS 2.0 for `linien-server` by @bleykauf in https://github.com/linien-org/linien/pull/366
12+
* Add ability to start the server upon startup by @bleykauf in https://github.com/linien-org/linien/pull/387
13+
14+
### Changed
15+
* Use systemd instead of screen for running the server by @bleykauf in https://github.com/linien-org/linien/pull/387
16+
* Use json to store devices and parameters by @bleykauf in https://github.com/linien-org/linien/pull/357
17+
* Better error handling by @bleykauf in https://github.com/linien-org/linien/pull/350
18+
* Improve startup and installation process by @bleykauf in https://github.com/linien-org/linien/pull/372
19+
* Use official influxdb client by @bleykauf in https://github.com/linien-org/linien/pull/374
20+
* `mdio-tools` is now included in the `linien-server` package
21+
* Uses `rpyc==6.x` instead of `rpyc==4.x`
22+
23+
### Deprecated
24+
* Removed support for RedPitaya OS 1.0: RedPitaya OS 2.0 is now necessary.
25+
26+
### Fixed
27+
28+
* Fix and enforce flake8 by @bleykauf in https://github.com/linien-org/linien/pull/368
829

930
## [1.0.2] - 2024-04-05
1031

@@ -185,6 +206,7 @@ uses [PEP440](https://peps.python.org/pep-0440/) for the version identification.
185206
* **Bug fixes and performance improvements**
186207

187208

209+
[2.0.0]: https://github.com/linien-org/linien/compare/v1.0.2...v2.0.0
188210
[1.0.2]: https://github.com/linien-org/linien/compare/v1.0.1...v1.0.2
189211
[1.0.1]: https://github.com/linien-org/linien/compare/v1.0.0...v1.0.1
190212
[1.0.0]: https://github.com/linien-org/linien/compare/v0.8.0...v1.0.0

README.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,21 @@ Features
3737

3838
![image](https://raw.githubusercontent.com/linien-org/linien/master/docs/screencast.gif)
3939

40-
Getting started: install Linien
41-
---------------
40+
## Getting started: Install Linien
4241

4342
Linien runs on Windows and Linux. For Windows users the [standalone
4443
binaries](#standalone-binary) containing the graphical user interface
4544
are recommended.
4645
These binaries run on your lab PC and contain everything to get Linien running on your RedPitaya.
4746

48-
Both RedPitaya OS 1.x and 2.x are supported. However, support for OS 1.x will be dropped starting
49-
with Linien 2.x
50-
51-
If you want to use the python interface you should [install it using pip](#installation-with-pip).
47+
Starting with Linien 2.0, only RedPitaya OS 2.x is supported. Linien 1.x works on RedPitaya OS
48+
but is no longer actively maintain.
5249

5350
### Standalone binary
5451

55-
You can download standalone binaries for Windows on [the
56-
releases
57-
page](https://github.com/linien-org/linien/releases) (download the binary in the assets section of the latest version). For Linux users, we recommend installation via pip.
52+
You can download standalone binaries for Windows on
53+
[the releases page](https://github.com/linien-org/linien/releases) (download the binary in the assets
54+
section of the latest version). For Linux users, we recommend installation of `linien-gui` via pip.
5855

5956
### Installation with pip
6057

@@ -72,12 +69,57 @@ linien
7269

7370
in a terminal (on both Linux and Windows).
7471

75-
In case you're only interested in the python client and don't want to install the graphical application, you may use the `linien-client` package:
72+
In case you're only interested in the Python client and don't want to install the graphical application, you may use the `linien-client` package:
7673

7774
```bash
7875
pip install linien-client
7976
```
8077

78+
### Installation of the server on the RedPitaya
79+
80+
The easiest way to install the server component of Linien on the RedPitaya, is to use the graphical
81+
user interface. The first time you are connecting to the RedPitaya, the server is automatically
82+
installed.
83+
84+
In case you are using the `linien-client`, the server can be installed with
85+
86+
```python
87+
from linien_client.device import Device
88+
from linien_client.deploy import install_remote_server
89+
90+
device = Device(
91+
host="rp-xxxxxx.local",
92+
user="root",
93+
password="root"
94+
)
95+
instalL_remote_server(device)
96+
```
97+
98+
Finally, you can install the server manually, by connecting to the RedPitaya via SSH and
99+
then running
100+
101+
```bash
102+
pip install linien-server
103+
```
104+
105+
The server can then be started as a systemd service by running
106+
107+
```bash
108+
linien-server start
109+
```
110+
111+
on the RedPitaya. To check the status of the server, run
112+
113+
114+
```bash
115+
linien-server status
116+
```
117+
118+
For more options, run
119+
120+
```bash
121+
linien-server --help
122+
```
81123

82124
Physical setup
83125
--------------
@@ -192,14 +234,16 @@ Then, you should start the Linien server on your RedPitaya. This can be done by
192234

193235
Once the server is up and running, you can connect using python:
194236
```python
237+
from linien_client.device import Device
195238
from linien_client.connection import LinienClient
196239
from linien_common.common import MHz, Vpp, ANALOG_OUT_V
197240

198-
c = LinienClient(
241+
dev = Device(
199242
host="rp-xxxxxx.local",
200243
user="root",
201-
password="root"
244+
password="root"
202245
)
246+
c = LinienClient(dev)
203247
c.connect(autostart_server=True, use_parameter_cache=True)
204248

205249
# read out the modulation frequency
@@ -452,7 +496,7 @@ Linien ‒ User-friendly locking of lasers using RedPitaya (STEMlab 125-14) that
452496

453497
Copyright © 2014-2015 Robert Jördens\
454498
Copyright © 2018-2022 Benjamin Wiegand\
455-
Copyright © 2021-2023 Bastian Leykauf\
499+
Copyright © 2021-2024 Bastian Leykauf\
456500
Copyright © 2022 Christian Freier
457501

458502
Linien is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

gateware/fpga_image_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
# use `build_fpga_image.sh`
2121
from pathlib import Path
2222

23-
REPO_ROOT_DIR = Path(__file__).resolve().parents[1]
24-
2523
from .bit2bin import bit2bin
2624
from .hw_platform import Platform
2725
from .linien_module import RootModule
2826

27+
REPO_ROOT_DIR = Path(__file__).resolve().parents[1]
28+
2929

3030
def py_csrconstants(map, fil):
3131
fil.write("csr_constants = {\n")

gateware/logic/autolock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,19 @@ def init_csr(self, N_points):
247247

248248
peak_height_bit = len(self.sum_diff_calculator.sum_value)
249249
self.peak_heights = [
250-
CSRStorage(peak_height_bit, name="peak_height_%d" % idx)
250+
CSRStorage(peak_height_bit, name=f"peak_height_{idx}")
251251
for idx in range(AUTOLOCK_MAX_N_INSTRUCTIONS)
252252
]
253253
for idx, peak_height in enumerate(self.peak_heights):
254-
setattr(self, "peak_height_%d" % idx, peak_height)
254+
setattr(self, f"peak_height_{idx}", peak_height)
255255

256256
x_data_length_bit = bits_for(N_points)
257257
self.wait_for = [
258-
CSRStorage(x_data_length_bit, name="wait_for_%d" % idx)
258+
CSRStorage(x_data_length_bit, name=f"wait_for_{idx}")
259259
for idx in range(AUTOLOCK_MAX_N_INSTRUCTIONS)
260260
]
261261
for idx, wait_for in enumerate(self.wait_for):
262-
setattr(self, "wait_for_%d" % idx, wait_for)
262+
setattr(self, f"wait_for_{idx}", wait_for)
263263

264264
return peak_height_bit, x_data_length_bit
265265

gateware/logic/delta_sigma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, out, **kwargs):
5454
for i, o in enumerate(out):
5555
ds = DeltaSigma(**kwargs)
5656
self.submodules += ds
57-
cs = CSRStorage(len(ds.data), name="data%i" % i)
57+
cs = CSRStorage(len(ds.data), name=f"data{i}")
5858
# atomic_write=True
59-
setattr(self, "r_data%i" % i, cs)
59+
setattr(self, f"r_data{i}", cs)
6060
self.sync += ds.data.eq(cs.storage), o.eq(ds.out)

gateware/logic/iir.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
self.c = c = {}
5252
for i in "ab":
5353
for j in range(order + 1):
54-
name = "%s%i" % (i, j)
54+
name = f"{i}{j}"
5555
if name == "a0":
5656
continue
5757
ci = Signal((coeff_width, True), name=name)
@@ -83,8 +83,8 @@ def __init__(
8383
]
8484

8585
if mode == "pipelined":
86-
r = [("b%i" % i, self.x) for i in reversed(range(order + 1))]
87-
r += [("a%i" % i, y) for i in reversed(range(1, order + 1))]
86+
r = [(f"b{i}", self.x) for i in reversed(range(order + 1))]
87+
r += [(f"a{i}", y) for i in reversed(range(1, order + 1))]
8888
for coeff, signal in r:
8989
zr = Signal.like(z)
9090
self.sync += zr.eq(z)
@@ -105,10 +105,10 @@ def __init__(
105105
steps = []
106106
x = [self.x] + [Signal.like(self.x) for i in range(order + 1)]
107107
for i in reversed(range(order + 1)):
108-
steps.append([x[i + 1].eq(x[i]), ma.eq(x[i]), mb.eq(c["b%i" % i])])
108+
steps.append([x[i + 1].eq(x[i]), ma.eq(x[i]), mb.eq(c[f"b{i}"])])
109109
y = [None, y] + [Signal.like(y) for i in range(1, order + 1)]
110110
for i in reversed(range(1, order + 1)):
111-
steps.append([y[i + 1].eq(y[i]), ma.eq(y[i]), mb.eq(c["a%i" % i])])
111+
steps.append([y[i + 1].eq(y[i]), ma.eq(y[i]), mb.eq(c[f"a{i}"])])
112112
steps[1].append(mc.eq(z))
113113
latency = order + 4
114114
if order == 1:

linien-client/linien_client/communication.py

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)