If running python from genie_python.bat directly on an instrument (but not if running python in GUI scripting window) you get the error
IPython 8.25.0 -- An enhanced Interactive Python. Type '?' for help.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[1], line 1
----> 1 ip.Completer.matchers.remove(ip.Completer.magic_matches)
ValueError: list.remove(x): x not in list
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[1], line 1
----> 1 ip.Completer.matchers.remove(ip.Completer.file_matches)
ValueError: list.remove(x): x not in list
It may or may not happen on a developer computer - this is because the modified ipython config is only installed by a kits$ built python, so if you have never installed this version locally (i.e. just used dev_build_python) then you will likely not have this file
Acceptance criteria
ipython_config.py fixed so error no longer occurs
dev_build_python fixed to install it on a developer computer
task created to update existing ipython_config.py on instruments (so they do not have to wait until next install, which is nearly a year away for some). We are running ipython 8.14 or higher on instruments, and the functions were renamed in ipython 8.6
To Test
updated dev_build_python will now copy new ipython_config.py to %PROFILEDEFAULT%\.ipython\profile_default - if your genie_python.bat does not currently error and you wish to see the error before updating, copy the original ipython_config.py to above place
If running python from
genie_python.bat
directly on an instrument (but not if running python in GUI scripting window) you get the errorThis is due to https://github.com/ISISComputingGroup/genie_python/blob/3a1669bdb7fd498eaf635a5fa7da6984421f81d3/package_builder/ipython_config.py#L35 - it seems the functions we are trying to remove from the list have been deprecated since ipython version 8.6 (October 2022)
It may or may not happen on a developer computer - this is because the modified ipython config is only installed by a
kits$
built python, so if you have never installed this version locally (i.e. just useddev_build_python
) then you will likely not have this fileAcceptance criteria
ipython_config.py
fixed so error no longer occurs/y
in https://github.com/ISISComputingGroup/genie_python/blob/3a1669bdb7fd498eaf635a5fa7da6984421f81d3/package_builder/genie_python_install.bat#L70) and also testing%errorlevel%
inside anif
doesn't work due to peculiarities of bat scripts, you would need tosetlocal EnableDelayedExpansion
and use!errorlevel!
insteadTo Test
updated dev_build_python will now copy new
ipython_config.py
to%PROFILEDEFAULT%\.ipython\profile_default
- if your genie_python.bat does not currently error and you wish to see the error before updating, copy the originalipython_config.py
to above place