|
@@ -183,11 +183,23 @@ class CorticalParcellationStats:
|
|
|
|
|
|
@classmethod
|
|
|
def read(cls, path: typing.Union[str, pathlib.Path]) -> "CorticalParcellationStats":
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ (
|
|
|
+ path_or_buffer,
|
|
|
+ _,
|
|
|
+ _,
|
|
|
+ *instructions,
|
|
|
+ ) = pandas.io.common.get_filepath_or_buffer(path)
|
|
|
|
|
|
- path_or_buffer, _, _, should_close = pandas.io.common.get_filepath_or_buffer(
|
|
|
- path
|
|
|
- )
|
|
|
+
|
|
|
+ if instructions:
|
|
|
+ assert len(instructions) == 1, instructions
|
|
|
+ should_close = instructions[0]
|
|
|
+ else:
|
|
|
+ should_close = hasattr(path_or_buffer, "close")
|
|
|
stats = cls()
|
|
|
if hasattr(path_or_buffer, "readline"):
|
|
|
|