I used Channels.save_analysis and Channels.load_analysis to save and load an analysis. On the same computer it worked fine. When I tried to open it on Adrika's computer then we got an error. This is probably related to pkl files (and dill pkl files) being fragile, though I did make sure we had the same version of mass2. I suspect (based on AI chat analysis) this is a polars version mismatch between the two computers, relevant because we probably stored plt.col("x")==4 or something like that inside the Channel in good_expr or similar. I don't know if we should try to assert version matching or not.
This may not be something we should try to fix, but we'll leave it up for now.
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_256908/1049559426.py in ?()
----> 1 data1 = mass2.Channels.load_analysis(os.path.expanduser("/home/adrika/mass2/data/20251203_ch5_linescape_power_sweep
~/mass2/.mass2env/src/mass2/mass2/core/channels.py in ?(path)
794
795 with ZipFile(path, "r") as zf:
796 pickle_file = "data_all.pkl"
797 pickle_bytes = zf.read(pickle_file)
--> 798 data: Channels = dill.loads(pickle_bytes)
799
800 restored_channels = {}
801 for ch_num, ch in data.channels.items():
~/mass2/.mass2env/lib/python3.10/site-packages/dill/_dill.py in ?(str, ignore, **kwds)
307
308 Default values for keyword arguments can be set in :mod:`dill.settings`.
309 """
310 file = StringIO(str)
--> 311 return load(file, ignore, **kwds)
~/mass2/.mass2env/lib/python3.10/site-packages/dill/_dill.py in ?(file, ignore, **kwds)
293 Unpickle an object from a file.
294
...
305 def __setstate__(self, state: bytes) -> None:
306 self._pyexpr = F.lit(0)._pyexpr # Initialize with a dummy
--> 307 self._pyexpr.__setstate__(state)
RuntimeError: BindingsError: "OtherString(\"invalid value: integer `13`, expected variant index 0 <= i < 10\")"
I used
Channels.save_analysisandChannels.load_analysisto save and load an analysis. On the same computer it worked fine. When I tried to open it on Adrika's computer then we got an error. This is probably related to pkl files (and dill pkl files) being fragile, though I did make sure we had the same version of mass2. I suspect (based on AI chat analysis) this is a polars version mismatch between the two computers, relevant because we probably storedplt.col("x")==4or something like that inside theChannelingood_expror similar. I don't know if we should try to assert version matching or not.This may not be something we should try to fix, but we'll leave it up for now.