[WIP] work on curses cfg editor
state as of 2026-01-28 Change-Id: I73d2fa4e6fda8820a95fe4e7256c7a23bf565f67
This commit is contained in:
@@ -22,8 +22,6 @@ import time
|
||||
import math
|
||||
import random
|
||||
import threading
|
||||
import numpy as np
|
||||
from numpy.testing import assert_approx_equal
|
||||
|
||||
from frappy.core import Module, Readable, Parameter, Property, \
|
||||
HasIO, StringIO, Writable, IDLE, ERROR, BUSY, DISABLED, nopoll, Attached
|
||||
@@ -32,11 +30,14 @@ from frappy.datatypes import IntRange, FloatRange, StringType, \
|
||||
from frappy.errors import CommunicationFailedError, ConfigError, \
|
||||
HardwareError, DisabledError, ImpossibleError, secop_error, SECoPError
|
||||
from frappy.lib.units import NumberWithUnit, format_with_unit
|
||||
from frappy.lib import formatStatusBits
|
||||
from frappy.lib import formatStatusBits, LazyImport
|
||||
from frappy_psi.convergence import HasConvergence
|
||||
from frappy.mixins import HasOutputModule, HasControlledBy
|
||||
from frappy.extparams import StructParam
|
||||
from frappy_psi.calcurve import CalCurve
|
||||
|
||||
np = LazyImport('numpy')
|
||||
np_testing = LazyImport('numpy.testing')
|
||||
calcurve_module = LazyImport('frappy_psi.calcurve')
|
||||
|
||||
|
||||
def string_to_num(string):
|
||||
@@ -419,7 +420,7 @@ class Device(HasLscIO, Module):
|
||||
"""check whether a returned calibration point is equal within curve point precision"""
|
||||
for v1, v2, eps in zip(left, right, fixeps):
|
||||
try:
|
||||
assert_approx_equal(v1, v2, significant, verbose=False)
|
||||
np_testing.assert_approx_equal(v1, v2, significant, verbose=False)
|
||||
except AssertionError:
|
||||
return abs(v1 - v2) < eps
|
||||
return True
|
||||
@@ -464,7 +465,7 @@ class CurveRequest:
|
||||
self.action = device.find_curve
|
||||
self.new_sensors = set()
|
||||
self.sensors = {sensor.channel: sensor}
|
||||
calcurve = CalCurve(sensor.calcurve)
|
||||
calcurve = calcurve_module.CalCurve(sensor.calcurve)
|
||||
equipment_id = device.propertyValues.get('original_id') or device.secNode.equipment_id
|
||||
name = f"{equipment_id.split('.')[0]}.{sensor.name}"
|
||||
sn = calcurve.calibname
|
||||
|
||||
Reference in New Issue
Block a user