changes before migration

This commit is contained in:
2025-09-03 18:17:39 +02:00
parent ed090be840
commit d397a9668b
4 changed files with 55 additions and 8 deletions

1
.gitignore vendored
View File

@@ -37,6 +37,7 @@ htmlcov/*
junit*.xml
coverage.xml
.pytest_cache/
tests/cache_test/
# Build and docs folder/files
build/*

View File

@@ -1 +1,36 @@
print("p22478 module imported.")
import os
import json
from pathlib import Path
from collections import defaultdict, deque
from copy import copy
import time
import scipy
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
import re
from pathlib import Path
import warnings
from matplotlib import pyplot as plt
import matplotlib as mpl
import cristallina.utils as cu
import cristallina as cr
from loguru import logger
from cristallina.uscan import UnfinishedScan
from joblib import Parallel, delayed, Memory
import sfdata
from sfdata import SFProcFile, SFDataFile, SFDataFiles, SFScanInfo
memory = Memory(location="/sf/cristallina/data/p22478/work/joblib", compress=2, verbose=2)
pgroup = "p22478"
print(f"p22478 module imported.")

View File

@@ -22,15 +22,26 @@ class UnfinishedScan(SFScanInfo):
parser = JSONParser()
self.info = info = parser.parse(content)
self.files = info["scan_files"]
self.parameters = info["scan_parameters"]
try:
self.parameters = info["scan_parameters"]
except KeyError:
self.parameters = None
values = info["scan_values"]
values = [v for v in values if v]
try:
values = info["scan_values"]
values = [v for v in values if v]
except KeyError:
values = None
readbacks = info["scan_readbacks"]
readbacks = [r for r in readbacks if r]
try:
readbacks = info["scan_readbacks"]
readbacks = [r for r in readbacks if r]
except KeyError:
readbacks = None
self.values = sfdata.utils.adjust_shape(values)
self.readbacks = sfdata.utils.adjust_shape(readbacks)

View File

@@ -454,7 +454,7 @@ class ROI:
def height(self):
return self.top - self.bottom
def shift(self, x: float, y: float, inplace=False):
def shift(self, x: float = 0, y: float = 0, inplace=False):
""" Returns a new ROI that is shifted
by x to the left and by y pixels up.
@@ -473,7 +473,7 @@ class ROI:
self.top = self.top + y
def expand(self, x: float, y: float, inplace=False):
def expand(self, x: float = 0, y: float = 0, inplace=False):
""" Returns a new ROI that is expanded in x
to the left and right, and in y to the
top and bottom.