Skip to content

Commit 6d4a9cd

Browse files
committed
Merge branch 'bluesky-helpers' of https://github.com/wright-group/WrightTools into bluesky-helpers
2 parents 6240cc9 + 9b46888 commit 6d4a9cd

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

WrightTools/kit/_bluesky.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def folder(self):
119119
)
120120

121121

122-
def filter_bluesky(items:Iterable[pathlib.Path], **bluesky_identifiers) -> Generator[pathlib.Path, None, None]:
122+
def filter_bluesky(
123+
items: Iterable[pathlib.Path], **bluesky_identifiers
124+
) -> Generator[pathlib.Path, None, None]:
123125
"""
124126
Filter an iterator of folder names for bluesky folder pattern that match specified values.
125127
@@ -128,7 +130,7 @@ def filter_bluesky(items:Iterable[pathlib.Path], **bluesky_identifiers) -> Gener
128130
129131
items: pathlikes
130132
potential paths of bluesky folders
131-
133+
132134
kwargs
133135
------
134136
@@ -138,7 +140,7 @@ def filter_bluesky(items:Iterable[pathlib.Path], **bluesky_identifiers) -> Gener
138140
Yields
139141
-------
140142
141-
pathlib.Path:
143+
pathlib.Path:
142144
bluesky folders corresponding to full matches with the bluesky_identifiers
143145
144146
Examples
@@ -147,7 +149,7 @@ def filter_bluesky(items:Iterable[pathlib.Path], **bluesky_identifiers) -> Gener
147149
# match within a directory
148150
spooky_folders = [
149151
info for info in filter_bluesky(
150-
data_folder.iterdir(),
152+
data_folder.iterdir(),
151153
date="2025-10-31"
152154
)
153155
]
@@ -159,7 +161,7 @@ def filter_bluesky(items:Iterable[pathlib.Path], **bluesky_identifiers) -> Gener
159161
for item in map(pathlib.Path, items):
160162
if (info := parse_folder_name(item.name)) is not None:
161163
idict = info._asdict()
162-
if all(idict[k] == v for k,v in bluesky_identifiers.items()):
164+
if all(idict[k] == v for k, v in bluesky_identifiers.items()):
163165
yield item
164166

165167

@@ -185,10 +187,9 @@ def bluesky_paths(dir: pathlib.Path, **bluesky_identifiers) -> list[pathlib.Path
185187
BlueskyFolders corresponding to full matches with the bluesky_identifiers
186188
"""
187189

188-
return sorted([
189-
dir / info.folder
190-
for info in filter_bluesky(dir.iterdir(), **bluesky_identifiers)
191-
])
190+
return sorted(
191+
[dir / info.folder for info in filter_bluesky(dir.iterdir(), **bluesky_identifiers)]
192+
)
192193

193194

194195
def parse_folder_name(folder: str) -> FolderInfo | None:

tests/kit/bluesky.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ def test_filter():
3030
if __name__ == "__main__":
3131
test_folderinfo()
3232
test_filter()
33-

0 commit comments

Comments
 (0)