|
@@ -36,7 +36,7 @@ def remove_group_names_from_regex(regex_pattern: str) -> str:
|
|
return re.sub(r'\?P<.+?>', '', regex_pattern)
|
|
return re.sub(r'\?P<.+?>', '', regex_pattern)
|
|
|
|
|
|
|
|
|
|
-class SubfieldVolumeFile(metaclass=abc.ABCMeta):
|
|
+class VolumeFile(metaclass=abc.ABCMeta):
|
|
|
|
|
|
FILENAME_REGEX = NotImplemented
|
|
FILENAME_REGEX = NotImplemented
|
|
|
|
|
|
@@ -45,14 +45,6 @@ class SubfieldVolumeFile(metaclass=abc.ABCMeta):
|
|
def absolute_path(self):
|
|
def absolute_path(self):
|
|
raise NotImplementedError()
|
|
raise NotImplementedError()
|
|
|
|
|
|
- @abc.abstractmethod
|
|
|
|
- def read_volumes_mm3(self) -> typing.Dict[str, float]:
|
|
|
|
- raise NotImplementedError()
|
|
|
|
-
|
|
|
|
- @abc.abstractmethod
|
|
|
|
- def read_volumes_dataframe(self) -> pandas.DataFrame:
|
|
|
|
- raise NotImplementedError()
|
|
|
|
-
|
|
|
|
@classmethod
|
|
@classmethod
|
|
def find(cls, root_dir_path: str,
|
|
def find(cls, root_dir_path: str,
|
|
filename_regex: typing.Optional[typing.Pattern] = None,
|
|
filename_regex: typing.Optional[typing.Pattern] = None,
|
|
@@ -62,3 +54,14 @@ class SubfieldVolumeFile(metaclass=abc.ABCMeta):
|
|
for dirpath, _, filenames in os.walk(root_dir_path):
|
|
for dirpath, _, filenames in os.walk(root_dir_path):
|
|
for filename in filter(filename_regex.search, filenames):
|
|
for filename in filter(filename_regex.search, filenames):
|
|
yield cls(path=os.path.join(dirpath, filename))
|
|
yield cls(path=os.path.join(dirpath, filename))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class SubfieldVolumeFile(VolumeFile):
|
|
|
|
+
|
|
|
|
+ @abc.abstractmethod
|
|
|
|
+ def read_volumes_mm3(self) -> typing.Dict[str, float]:
|
|
|
|
+ raise NotImplementedError()
|
|
|
|
+
|
|
|
|
+ @abc.abstractmethod
|
|
|
|
+ def read_volumes_dataframe(self) -> pandas.DataFrame:
|
|
|
|
+ raise NotImplementedError()
|