|
55 | 55 | Not a lot of memory optimization effort was put into this module. You should |
56 | 56 | expect a big memory usage when loading data with this module |
57 | 57 |
|
58 | | -:attribute __FOLLOW_SPEC: the AlphaOmega specifiction describe some field that |
59 | | - seems to be different in the recorded data. If True it |
60 | | - will follow the look-alike buggy spec implementation. |
61 | | - Default to False. Be aware that this affects only when |
62 | | - the module is loaded so changing this attribute will |
63 | | - have no effect once it's loaded. You should change it |
64 | | - in the source code. |
65 | | -:type __FOLLOW_SPEC: bool |
66 | | -:attribute __IGNORE_UNKNOWN_BLOCK__: if True (the default) will not read the |
67 | | - unknown block types. This should be faster if there are a lot of them. |
68 | | -:type __IGNORE_UNKNOWN_BLOCK__: bool |
69 | | -
|
70 | 58 | .. todo:: |
71 | 59 | 1. First search TODO in this file. |
72 | 60 | 2. add IO class with :py:class:`neo.io.basefromrawio.BaseFromRaw` |
|
99 | 87 | ) |
100 | 88 |
|
101 | 89 |
|
102 | | -__FOLLOW_SPEC = False |
103 | | -__IGNORE_UNKNOWN_BLOCK__ = True |
104 | | - |
105 | | - |
106 | 90 | class AlphaOmegaRawIO(BaseRawIO): |
107 | 91 | """ |
108 | 92 | Handles several blocks and segments. |
@@ -148,6 +132,7 @@ def __init__(self, dirname, prune_channels=True): |
148 | 132 | self.logger.error(f"{self.dirname} is not a folder") |
149 | 133 | self._prune_channels = prune_channels |
150 | 134 | self._opened_files = {} |
| 135 | + self._ignore_unknown_blocks = True # internal debug property |
151 | 136 |
|
152 | 137 | def _explore_folder(self): |
153 | 138 | """ |
@@ -553,7 +538,7 @@ def _read_file_blocks(self, filename, prune_channels=True): |
553 | 538 | } |
554 | 539 | ) |
555 | 540 | else: |
556 | | - if not __IGNORE_UNKNOWN_BLOCK__: |
| 541 | + if not self._ignore_unknown_blocks: |
557 | 542 | try: |
558 | 543 | bt = block_type.decode() |
559 | 544 | self.logger.debug( |
@@ -1258,19 +1243,18 @@ def get_name(f, name_length): |
1258 | 1243 | - sample_number (ulong): the sample number of the event |
1259 | 1244 | - value (short): value of the event |
1260 | 1245 | """ |
1261 | | -if __FOLLOW_SPEC: |
1262 | | - SDataChannelPort = struct.Struct("<Lh") |
1263 | | -else: |
1264 | | - SDataChannelPort = struct.Struct("<HL") |
1265 | | - """ |
1266 | | - Then for digital ports: |
1267 | | - - value (ushort) |
1268 | | - - sample_number (ulong) |
1269 | | -
|
1270 | | - .. warning:: |
1271 | | - The specification says that for port channels it should be the same as for |
1272 | | - digital channels but the data says otherwise |
1273 | | - """ |
| 1246 | +SDataChannelPort = struct.Struct("<HL") |
| 1247 | +""" |
| 1248 | +Then for digital ports: |
| 1249 | + - value (ushort) |
| 1250 | + - sample_number (ulong) |
| 1251 | +
|
| 1252 | +.. warning:: |
| 1253 | + The specification says that for port channels it should be the same as for |
| 1254 | + digital channels but the data (and AO engineers) says otherwise. According |
| 1255 | + to AlphaOmega engineer, this could change in a future logging software |
| 1256 | + release and could break this reader. |
| 1257 | +""" |
1274 | 1258 |
|
1275 | 1259 | SAOEvent = struct.Struct("<cL") |
1276 | 1260 | """Type E: stream data block: |
|
0 commit comments