scipp / tof

A simple tool to create time-of-flight chopper cascade diagrams
https://tof.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

`tof` does not work with `python<=3.8` #41

Closed nvaytet closed 1 year ago

nvaytet commented 1 year ago

Error on import is

File ~/opt/anaconda3/envs/scipp_env/lib/python3.8/site-packages/tof/result.py:142, in Result()
    138     self._masks = MappingProxyType(self._masks)
    139     self._arrival_times = MappingProxyType(self._arrival_times)
    141 @property
--> 142 def choppers(self) -> MappingProxyType[str, ChopperReading]:
    143     """The choppers in the model."""
    144     return self._choppers

TypeError: 'type' object is not subscriptable
nvaytet commented 1 year ago

This is because MappingProxyType only supports the syntax MappingProxyType[..., ...] for python==3.9 and above.

SimonHeybrock commented 1 year ago

This was the only error I got with 3.8, it worked fine when I removed that, everything else worked.