16
16
from sans .common .constant_containers import SANSInstrument_string_as_key_NoInstrument
17
17
from sans .common .enums import SaveType
18
18
19
+ FILE_FORMAT_DOC_SUFFIX = (
20
+ "Note that if file formats of the same type, e.g. .xml are chosen, then the file format is appended to the file name."
21
+ )
22
+
19
23
20
24
class SANSSave (DataProcessorAlgorithm ):
21
25
def category (self ):
@@ -50,49 +54,43 @@ def PyInit(self):
50
54
"Nexus" ,
51
55
False ,
52
56
direction = Direction .Input ,
53
- doc = "Save as nexus format. "
54
- "Note that if file formats of the same type, e.g. .xml are chosen, then the "
55
- "file format is appended to the file name." ,
57
+ doc = "Save as nexus format. " + FILE_FORMAT_DOC_SUFFIX ,
56
58
)
57
59
self .declareProperty (
58
60
"CanSAS" ,
59
61
False ,
60
62
direction = Direction .Input ,
61
- doc = "Save as CanSAS xml format."
62
- "Note that if file formats of the same type, e.g. .xml are chosen, then the "
63
- "file format is appended to the file name." ,
63
+ doc = "Save as CanSAS xml format. " + FILE_FORMAT_DOC_SUFFIX ,
64
64
)
65
65
self .declareProperty (
66
66
"NXcanSAS" ,
67
67
False ,
68
68
direction = Direction .Input ,
69
- doc = "Save as NXcanSAS format."
70
- "Note that if file formats of the same type, e.g. .xml are chosen, then the "
71
- "file format is appended to the file name." ,
69
+ doc = "Save as NXcanSAS format. " + FILE_FORMAT_DOC_SUFFIX ,
70
+ )
71
+ self .declareProperty (
72
+ "PolarizedNXcanSAS" ,
73
+ False ,
74
+ direction = Direction .Input ,
75
+ doc = "Save in PolarizedNXcanSAS format. " + FILE_FORMAT_DOC_SUFFIX ,
72
76
)
73
77
self .declareProperty (
74
78
"NistQxy" ,
75
79
False ,
76
80
direction = Direction .Input ,
77
- doc = "Save as Nist Qxy format."
78
- "Note that if file formats of the same type, e.g. .xml are chosen, then the "
79
- "file format is appended to the file name." ,
81
+ doc = "Save as Nist Qxy format. " + FILE_FORMAT_DOC_SUFFIX ,
80
82
)
81
83
self .declareProperty (
82
84
"RKH" ,
83
85
False ,
84
86
direction = Direction .Input ,
85
- doc = "Save as RKH format."
86
- "Note that if file formats of the same type, e.g. .xml are chosen, then the "
87
- "file format is appended to the file name." ,
87
+ doc = "Save as RKH format. " + FILE_FORMAT_DOC_SUFFIX ,
88
88
)
89
89
self .declareProperty (
90
90
"CSV" ,
91
91
False ,
92
92
direction = Direction .Input ,
93
- doc = "Save as CSV format."
94
- "Note that if file formats of the same type, e.g. .xml are chosen, then the "
95
- "file format is appended to the file name." ,
93
+ doc = "Save as CSV format. " + FILE_FORMAT_DOC_SUFFIX ,
96
94
)
97
95
98
96
self .setPropertyGroup ("Nexus" , "FileFormats" )
@@ -275,6 +273,7 @@ def _get_file_formats(self):
275
273
self ._check_file_types (file_types , "Nexus" , SaveType .NEXUS )
276
274
self ._check_file_types (file_types , "CanSAS" , SaveType .CAN_SAS )
277
275
self ._check_file_types (file_types , "NXcanSAS" , SaveType .NX_CAN_SAS )
276
+ self ._check_file_types (file_types , "PolarizedNXcanSAS" , SaveType .POL_NX_CAN_SAS )
278
277
self ._check_file_types (file_types , "NistQxy" , SaveType .NIST_QXY )
279
278
self ._check_file_types (file_types , "RKH" , SaveType .RKH )
280
279
self ._check_file_types (file_types , "CSV" , SaveType .CSV )
@@ -289,6 +288,9 @@ def _get_file_formats(self):
289
288
# SaveNXcanSAS clashes with SaveNexusProcessed
290
289
self .add_file_format_with_appended_name_requirement (file_formats , SaveType .NX_CAN_SAS , file_types , [])
291
290
291
+ # SavePolarizedNXcanSAS clashes with SaveNXcanSAS
292
+ self .add_file_format_with_appended_name_requirement (file_formats , SaveType .POL_NX_CAN_SAS , file_types , [SaveType .NX_CAN_SAS ])
293
+
292
294
# SaveNISTDAT clashes with SaveRKH, both can save to .dat
293
295
self .add_file_format_with_appended_name_requirement (file_formats , SaveType .NIST_QXY , file_types , [SaveType .RKH ])
294
296
0 commit comments