Skip to content

Commit

Permalink
Rename iterable chunking
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed May 21, 2021
1 parent 887fbe4 commit 6d9c286
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyorbital/tlefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def read_tles_from_mmam_xml_files(paths):
tles = []
for fname in fnames:
data = read_tle_from_mmam_xml_file(fname).split('\n')
for two_lines in _grouper(2, data):
for two_lines in _group_iterable_to_chunks(2, data):
tl_stream = io.StringIO('\n'.join(two_lines))
tles.append(Tle('', tle_file=tl_stream))
return tles
Expand All @@ -454,9 +454,9 @@ def read_tle_from_mmam_xml_file(fname):
return "\n".join(data)


def _grouper(n, iterable, fillvalue=None):
def _group_iterable_to_chunks(n, iterable, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
# _group_iterable_to_chunks(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args)

Expand Down

0 comments on commit 6d9c286

Please sign in to comment.