Skip to content

Commit e45a298

Browse files
author
Danilo Ferreira de Lima
committed
Keep grating mask backwards compatible. Increase the version number.
1 parent 3f7ba9c commit e45a298

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/extra/applications/grating.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class Grating1DCalibration(SerializableMixin):
5959
grating_calib.apply(new_run)
6060
```
6161
"""
62-
def __init__(self, offset: Optional[int]=None, min_pixel: int=0, max_pixel: int=1200, sigma: float=2.0):
63-
self._version = 1
62+
def __init__(self, offset: Optional[int]=None, min_pixel: int=0, max_pixel: int=1280, sigma: float=2.0):
63+
self._version = 2
6464
self.offset = offset
6565
self.min_pixel = min_pixel
6666
self.max_pixel = max_pixel
@@ -156,6 +156,8 @@ def _fromdict(cls, all_data):
156156
Rebuild object from dict.
157157
"""
158158
self = cls()
159+
# backwards compatibility
160+
self.grating_mask_key = ""
159161
for k, v in all_data.items():
160162
setattr(self, k, v)
161163
return self

0 commit comments

Comments
 (0)