@@ -1026,6 +1026,8 @@ def validate(
10261026 :raises ValueError: if a validation error is encountered (and `log` is `None`).
10271027 :return: Flag signaling whether schema and data are valid.
10281028 """
1029+ # We must import components with custom validation to make sure they can be detected as
1030+ # subclasses of ComponentWithValidation.
10291031 from pycldf .media import MediaTable
10301032 from pycldf .trees import TreeTable
10311033
@@ -1311,6 +1313,9 @@ def sentences(self) -> typing.List[orm.Example]:
13111313
13121314
13131315class ComponentWithValidation :
1316+ """
1317+ A virtual base class for custom, component-centered validation.
1318+ """
13141319 def __init__ (self , ds : Dataset ):
13151320 self .ds = ds
13161321 self .component = self .__class__ .__name__
@@ -1347,11 +1352,11 @@ def sniff(p: pathlib.Path) -> bool:
13471352 return d .get ('dc:conformsTo' , '' ).startswith (TERMS_URL )
13481353
13491354
1350- def iter_datasets (d : pathlib .Path ) -> typing .Iterator [Dataset ]:
1355+ def iter_datasets (d : pathlib .Path ) -> typing .Generator [Dataset , None , None ]:
13511356 """
13521357 Discover CLDF datasets - by identifying metadata files - in a directory.
13531358
1354- :param d: directory
1359+ :param d: directory in which to look for CLDF datasets (recursively).
13551360 :return: generator of `Dataset` instances.
13561361 """
13571362 for p in walk (d , mode = 'files' ):
0 commit comments