Skip to content

Commit

Permalink
Merge pull request #390 from linien-org/release/v2.0.0
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
bleykauf authored Apr 8, 2024
2 parents fd961e3 + 6460c91 commit f21e16d
Show file tree
Hide file tree
Showing 74 changed files with 1,302 additions and 1,170 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.bin filter=lfs diff=lfs merge=lfs -text
*.sh eol=lf
*.sh eol=lf
mdio-tool filter=lfs diff=lfs merge=lfs -text
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.3.0
hooks:
- id: black
exclude: ^(gateware/logic/|gateware/lowlevel/|gateware/linien_module.py|linien-server/linien_server/csrmap.py)

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
exclude: linien-server/linien_server/csrmap.py
additional_dependencies: [flake8-pyproject]
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,29 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) in spirit but
uses [PEP440](https://peps.python.org/pep-0440/) for the version identification.
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2024-04-05

### Added
* 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
* Add ability to start the server upon startup by @bleykauf in https://github.com/linien-org/linien/pull/387

### Changed
* Use systemd instead of screen for running the server by @bleykauf in https://github.com/linien-org/linien/pull/387
* Use json to store devices and parameters by @bleykauf in https://github.com/linien-org/linien/pull/357
* Better error handling by @bleykauf in https://github.com/linien-org/linien/pull/350
* Improve startup and installation process by @bleykauf in https://github.com/linien-org/linien/pull/372
* Use official influxdb client by @bleykauf in https://github.com/linien-org/linien/pull/374
* `mdio-tools` is now included in the `linien-server` package
* Uses `rpyc==6.x` instead of `rpyc==4.x`

### Deprecated
* Removed support for RedPitaya OS 1.0: RedPitaya OS 2.0 is now necessary.

### Fixed

* Fix and enforce flake8 by @bleykauf in https://github.com/linien-org/linien/pull/368

## [1.0.2] - 2024-04-05

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


[2.0.0]: https://github.com/linien-org/linien/compare/v1.0.2...v2.0.0
[1.0.2]: https://github.com/linien-org/linien/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/linien-org/linien/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/linien-org/linien/compare/v0.8.0...v1.0.0
Expand Down
70 changes: 57 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,21 @@ Features

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

Getting started: install Linien
---------------
## Getting started: Install Linien

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

Both RedPitaya OS 1.x and 2.x are supported. However, support for OS 1.x will be dropped starting
with Linien 2.x

If you want to use the python interface you should [install it using pip](#installation-with-pip).
Starting with Linien 2.0, only RedPitaya OS 2.x is supported. Linien 1.x works on RedPitaya OS
but is no longer actively maintain.

### Standalone binary

You can download standalone binaries for Windows on [the
releases
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.
You can download standalone binaries for Windows on
[the releases 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 of `linien-gui` via pip.

### Installation with pip

Expand All @@ -72,12 +69,57 @@ linien

in a terminal (on both Linux and Windows).

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:
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:

```bash
pip install linien-client
```

### Installation of the server on the RedPitaya

The easiest way to install the server component of Linien on the RedPitaya, is to use the graphical
user interface. The first time you are connecting to the RedPitaya, the server is automatically
installed.

In case you are using the `linien-client`, the server can be installed with

```python
from linien_client.device import Device
from linien_client.deploy import install_remote_server

device = Device(
host="rp-xxxxxx.local",
user="root",
password="root"
)
instalL_remote_server(device)
```

Finally, you can install the server manually, by connecting to the RedPitaya via SSH and
then running

```bash
pip install linien-server
```

The server can then be started as a systemd service by running

```bash
linien-server start
```

on the RedPitaya. To check the status of the server, run


```bash
linien-server status
```

For more options, run

```bash
linien-server --help
```

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

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

c = LinienClient(
dev = Device(
host="rp-xxxxxx.local",
user="root",
password="root"
password="root"
)
c = LinienClient(dev)
c.connect(autostart_server=True, use_parameter_cache=True)

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

Copyright © 2014-2015 Robert Jördens\
Copyright © 2018-2022 Benjamin Wiegand\
Copyright © 2021-2023 Bastian Leykauf\
Copyright © 2021-2024 Bastian Leykauf\
Copyright © 2022 Christian Freier

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.
Expand Down
4 changes: 2 additions & 2 deletions gateware/fpga_image_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
# use `build_fpga_image.sh`
from pathlib import Path

REPO_ROOT_DIR = Path(__file__).resolve().parents[1]

from .bit2bin import bit2bin
from .hw_platform import Platform
from .linien_module import RootModule

REPO_ROOT_DIR = Path(__file__).resolve().parents[1]


def py_csrconstants(map, fil):
fil.write("csr_constants = {\n")
Expand Down
8 changes: 4 additions & 4 deletions gateware/logic/autolock.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,19 @@ def init_csr(self, N_points):

peak_height_bit = len(self.sum_diff_calculator.sum_value)
self.peak_heights = [
CSRStorage(peak_height_bit, name="peak_height_%d" % idx)
CSRStorage(peak_height_bit, name=f"peak_height_{idx}")
for idx in range(AUTOLOCK_MAX_N_INSTRUCTIONS)
]
for idx, peak_height in enumerate(self.peak_heights):
setattr(self, "peak_height_%d" % idx, peak_height)
setattr(self, f"peak_height_{idx}", peak_height)

x_data_length_bit = bits_for(N_points)
self.wait_for = [
CSRStorage(x_data_length_bit, name="wait_for_%d" % idx)
CSRStorage(x_data_length_bit, name=f"wait_for_{idx}")
for idx in range(AUTOLOCK_MAX_N_INSTRUCTIONS)
]
for idx, wait_for in enumerate(self.wait_for):
setattr(self, "wait_for_%d" % idx, wait_for)
setattr(self, f"wait_for_{idx}", wait_for)

return peak_height_bit, x_data_length_bit

Expand Down
4 changes: 2 additions & 2 deletions gateware/logic/delta_sigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, out, **kwargs):
for i, o in enumerate(out):
ds = DeltaSigma(**kwargs)
self.submodules += ds
cs = CSRStorage(len(ds.data), name="data%i" % i)
cs = CSRStorage(len(ds.data), name=f"data{i}")
# atomic_write=True
setattr(self, "r_data%i" % i, cs)
setattr(self, f"r_data{i}", cs)
self.sync += ds.data.eq(cs.storage), o.eq(ds.out)
10 changes: 5 additions & 5 deletions gateware/logic/iir.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(
self.c = c = {}
for i in "ab":
for j in range(order + 1):
name = "%s%i" % (i, j)
name = f"{i}{j}"
if name == "a0":
continue
ci = Signal((coeff_width, True), name=name)
Expand Down Expand Up @@ -83,8 +83,8 @@ def __init__(
]

if mode == "pipelined":
r = [("b%i" % i, self.x) for i in reversed(range(order + 1))]
r += [("a%i" % i, y) for i in reversed(range(1, order + 1))]
r = [(f"b{i}", self.x) for i in reversed(range(order + 1))]
r += [(f"a{i}", y) for i in reversed(range(1, order + 1))]
for coeff, signal in r:
zr = Signal.like(z)
self.sync += zr.eq(z)
Expand All @@ -105,10 +105,10 @@ def __init__(
steps = []
x = [self.x] + [Signal.like(self.x) for i in range(order + 1)]
for i in reversed(range(order + 1)):
steps.append([x[i + 1].eq(x[i]), ma.eq(x[i]), mb.eq(c["b%i" % i])])
steps.append([x[i + 1].eq(x[i]), ma.eq(x[i]), mb.eq(c[f"b{i}"])])
y = [None, y] + [Signal.like(y) for i in range(1, order + 1)]
for i in reversed(range(1, order + 1)):
steps.append([y[i + 1].eq(y[i]), ma.eq(y[i]), mb.eq(c["a%i" % i])])
steps.append([y[i + 1].eq(y[i]), ma.eq(y[i]), mb.eq(c[f"a{i}"])])
steps[1].append(mc.eq(z))
latency = order + 4
if order == 1:
Expand Down
102 changes: 0 additions & 102 deletions linien-client/linien_client/communication.py

This file was deleted.

Loading

0 comments on commit f21e16d

Please sign in to comment.