Ticket8445 handle removal of defaults from config#444
Ticket8445 handle removal of defaults from config#444LowriJenkins wants to merge 9 commits intomasterfrom
Conversation
075b0f9 to
6795375
Compare
6795375 to
0ca0d0d
Compare
936545d to
ebd365c
Compare
Tom-Willemsen
left a comment
There was a problem hiding this comment.
Unfortunately, this branch completely crashes my local blockserver with:
Exception in thread Thread-11 (consume_write_queue):
[2026-02-12 17:33:18.604585] MINOR: ComponentSwitcher: component_switcher config file at C:/Instrument/Settings/config/NDW2922/configurations\ComponentSwitcher\component_switcher.json does not exist - assuming empty config
Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\Lib\threading.py", line 1043, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "C:\Instrument\Apps\Python3\Lib\threading.py", line 994, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\\block_server.py", line 737, in consume_write_queue
self.update_server_status(state)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\\block_server.py", line 678, in update_server_status
raise RuntimeError
RuntimeError
Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\Lib\site-packages\pcaspy\driver.py", line 631, in getValue
newValue = driver.read(self.info.reason)
File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\\block_server.py", line 288, in read
raise RuntimeError
RuntimeError
Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\Lib\site-packages\pcaspy\cas.py", line 582, in read
return _cas.PV_read(self, ctx, protoIn)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
RuntimeError: SWIG director method error. Exception Calling Python Code
RuntimeError: SWIG director method error. Exception Calling Python Code
The above exception was the direct cause of the following exception:
SystemError: <function SimplePV.interestDelete at 0x000001A39A011BC0> returned a result with an exception set
This crash does not occur on the master branch.
| from typing import Any, Callable, Dict, Iterable, List, Optional, Set | ||
|
|
||
| from BlockServer.core.config_list_manager import ConfigListManager | ||
| from genie_python.genie import PVValue |
There was a problem hiding this comment.
I'm somewhat sceptical about importing genie_python in the blockserver... seems like a recipe to get conflicting channel access libraries etc.
| from genie_python.genie import PVValue | |
| type PVBaseValue = bool | int | float | str | |
| type PVValue = PVBaseValue | list[PVBaseValue] | NDArray | None |
There was a problem hiding this comment.
would it be more sensible to handle this in a if TYPE_CHECKING: block rather than redefining the type?
There was a problem hiding this comment.
My preference would be to avoid the dependency on genie_python alltogether - it's quite a big dependency to pull in for a 2-line type definition. But if you really prefer then this shouldn't block the merge if you use if TYPE_CHECKING
There was a problem hiding this comment.
Ok, I guess I'm just unsure when avoiding a large dependency import is more important than avoiding code duplication, especially in this case as I believe the pyright error in the system tests shows that we do actaully need to alter our PVValue definition to allow the Byte type (The old error in the tests was caused by me passing the bytes as a string)
There was a problem hiding this comment.
An alternative would be to factor out the definition of PVValue into ibex-non-ca-helpers, and depend on that common definition both here and in genie_python.
There was a problem hiding this comment.
I might create a friday ticket to do this, as it would require changing this everywhere we import it?
There was a problem hiding this comment.
Not sure it's actually that many places outside genie_python, but yeah. Up to you - I don't want to get too hung up on this review comment, the main blocker was the comment above about blockserver crashing, this is a nicety.
d5dc293 to
57a1d58
Compare
|
doing some more bugfixing for some errors introduced during pyright/ruff have led to another file needing pyright checking, but once thats done this should be ready to go |
Description of work
Add a check when adding macros to the blockserver configs to not create them if the gui passes them with the
useDefaultvalue set to true. And run ruff format and check.To test
Which ticket does this PR fix?
Acceptance criteria
List the acceptance criteria for the PR
Code Review
Functional Tests
Final steps