From 0856cd345ba45aba0f7ea6f4bf7573f6551dd5ea Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 12 Dec 2023 16:36:27 +0100 Subject: [PATCH 1/3] build: require python3.9 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bf71b83..ac2cfb3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,7 @@ classifiers = package_dir = = . packages = find: -python_requires = >=3.8 +python_requires = >=3.9 [options.packages.find] where = . From e7246b44ba36271923e1e1adc563d40d3094d218 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 12 Dec 2023 16:42:00 +0100 Subject: [PATCH 2/3] refactor: replace deprecated imports from typing https://peps.python.org/pep-0585/#implementation --- bec_plugins/utils/saxs_params.py | 5 +++-- bec_plugins/utils/saxs_params_start_stop.py | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bec_plugins/utils/saxs_params.py b/bec_plugins/utils/saxs_params.py index c971868..ab7950b 100755 --- a/bec_plugins/utils/saxs_params.py +++ b/bec_plugins/utils/saxs_params.py @@ -1,7 +1,8 @@ import csv -from collections import defaultdict import os -from typing import Callable +from collections import defaultdict +from collections.abc import Callable + import numpy as np diff --git a/bec_plugins/utils/saxs_params_start_stop.py b/bec_plugins/utils/saxs_params_start_stop.py index 28ddcfd..f63ab64 100755 --- a/bec_plugins/utils/saxs_params_start_stop.py +++ b/bec_plugins/utils/saxs_params_start_stop.py @@ -1,11 +1,11 @@ -from typing import List import csv -from collections import defaultdict import os -from typing import Callable -import numpy as np +from collections import defaultdict +from collections.abc import Callable from copy import deepcopy +import numpy as np + class ScanItem: def __init__(self, offset_xy: Callable) -> None: @@ -13,7 +13,7 @@ class ScanItem: self.offset_xy = offset_xy self.split_upon_points = 8000 - def to_scan_params(self) -> List[dict]: + def to_scan_params(self) -> list[dict]: interval_x = int( np.round( np.abs(float(self.entry["X [start]"]) - float(self.entry["X [end]"])) From abe778c49bf7dd8a6488ddf115f715ae0ef7a854 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 12 Dec 2023 16:52:01 +0100 Subject: [PATCH 3/3] refactor: update to psi-python39/2021.11 in deploy scripts --- bin/setup_bec.sh | 6 ++---- bin/setup_bec_widgets.sh | 4 ++-- deployment/deploy.sh | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/setup_bec.sh b/bin/setup_bec.sh index 66bbb89..acec301 100755 --- a/bin/setup_bec.sh +++ b/bin/setup_bec.sh @@ -4,7 +4,7 @@ if [ "pc15543.psi.ch" != "$(hostname)" ]; then exit 1 fi -module add psi-python38/2020.11 +module add psi-python39/2021.11 echo module add tmux/3.2 >> ~/.bashrc echo module add redis/7.0.12 >> ~/.bashrc @@ -35,7 +35,7 @@ read -p "Do you want to set the current BEC account to $(whoami)? (yes/no) " yn val=$(whoami) -case $yn in +case $yn in yes ) echo ok, setting account to $val; redis-cli SET internal/account:val $val;; no ) echo ;; @@ -45,5 +45,3 @@ esac $(pwd)/open_tunnel.sh - - diff --git a/bin/setup_bec_widgets.sh b/bin/setup_bec_widgets.sh index 35016f5..719073e 100755 --- a/bin/setup_bec_widgets.sh +++ b/bin/setup_bec_widgets.sh @@ -1,4 +1,4 @@ -module add psi-python38/2020.11 +module add psi-python39/2021.11 cd ~/Data10/software python -m venv ./bec_widgets_venv @@ -13,4 +13,4 @@ pip install -e . cd ~/Data10/software/bec-widgets pip install -e . -echo "For the moment widgets only run on beamline consoles comp1/2 and cons1" +echo "For the moment widgets only run on beamline consoles comp1/2 and cons1" diff --git a/deployment/deploy.sh b/deployment/deploy.sh index 6591502..e14dbca 100755 --- a/deployment/deploy.sh +++ b/deployment/deploy.sh @@ -4,7 +4,7 @@ # BEAMLINE_REPO=gitlab.psi.ch:bec/csaxs-bec.git # git clone git@$BEAMLINE_REPO -module add psi-python38/2020.11 +module add psi-python39/2021.11 # start redis docker run --network=host --name redis-bec -d redis @@ -25,4 +25,3 @@ source ./bin/install_bec_dev.sh cd ../ # start the BEC server bec-server start --config ./csaxs-bec/deployment/bec-server-config.yaml -