Formatting
This commit is contained in:
@@ -107,8 +107,9 @@ def evaluate(dataset, offset, limit):
|
||||
|
||||
miss_counts = []
|
||||
for cat in cats:
|
||||
miss_counts.append((cat, len([x for x in results
|
||||
if x['catid'] == cat and x['result'] == 'MISS'])))
|
||||
miss_counts.append(
|
||||
(cat, len([x for x in results
|
||||
if x['catid'] == cat and x['result'] == 'MISS'])))
|
||||
|
||||
miss_counts = sorted(miss_counts, key=lambda x: x[1])
|
||||
|
||||
|
@@ -66,12 +66,14 @@ def build_ucs(components: UcsNameComponents, extension: str) -> str:
|
||||
"""
|
||||
Build a UCS filename
|
||||
"""
|
||||
assert components.validate(), "UcsNameComponents contains invalid characters"
|
||||
assert components.validate(), \
|
||||
"UcsNameComponents contains invalid characters"
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
def parse_ucs(rootname: str, catid_list: list[str]) -> Optional[UcsNameComponents]:
|
||||
def parse_ucs(rootname: str,
|
||||
catid_list: list[str]) -> Optional[UcsNameComponents]:
|
||||
"""
|
||||
Parse the UCS components from a file name root.
|
||||
|
||||
@@ -80,11 +82,12 @@ def parse_ucs(rootname: str, catid_list: list[str]) -> Optional[UcsNameComponent
|
||||
:returns: the components, or `None` if the filename is not in UCS format
|
||||
"""
|
||||
|
||||
regexp1 = r"^(?P<CatID>[A-z]+)(-(?P<UserCat>[^_]+))?_((?P<VendorCat>[^-]+)-)?(?P<FXName>[^_]+)"
|
||||
regexp1 = r"^(?P<CatID>[A-z]+)(-(?P<UserCat>[^_]+))?_"
|
||||
regexp2 = r"((?P<VendorCat>[^-]+)-)?(?P<FXName>[^_]+)"
|
||||
regexp3 = r"(_(?P<CreatorID>[^_]+)(_(?P<SourceID>[^_]+)"
|
||||
regexp4 = r"(_(?P<UserData>[^.]+))?)?)?"
|
||||
|
||||
regexp2 = r"(_(?P<CreatorID>[^_]+)(_(?P<SourceID>[^_]+)(_(?P<UserData>[^.]+))?)?)?"
|
||||
|
||||
regexp = regexp1 + regexp2
|
||||
regexp = regexp1 + regexp2 + regexp3 + regexp4
|
||||
|
||||
matches = match(regexp, rootname)
|
||||
|
||||
|
Reference in New Issue
Block a user