New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alphabetize available_readers method and update documentation #1378
Changes from all commits
8ee1596
3ed0e67
417b9b7
0f0b3d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,6 @@ def group_files(files_to_sort, reader=None, time_threshold=10, | |
a `Scene` object. | ||
|
||
""" | ||
|
||
if reader is not None and not isinstance(reader, (list, tuple)): | ||
reader = [reader] | ||
|
||
|
@@ -124,7 +123,6 @@ def _assign_files_to_readers(files_to_sort, reader_names, ppp_config_dir, | |
Mapping where the keys are reader names and the values are tuples of | ||
(reader_configs, filenames). | ||
""" | ||
|
||
files_to_sort = set(files_to_sort) | ||
reader_dict = {} | ||
for reader_configs in configs_for_reader(reader_names, ppp_config_dir): | ||
|
@@ -164,7 +162,6 @@ def _get_file_keys_for_reader_files(reader_files, group_keys=None): | |
Returns: | ||
Mapping[str, List[Tuple[Tuple, str]]], as described. | ||
""" | ||
|
||
file_keys = {} | ||
for (reader_name, (reader_instance, files_to_sort)) in reader_files.items(): | ||
if group_keys is None: | ||
|
@@ -315,10 +312,14 @@ def available_readers(as_dict=False): | |
try: | ||
reader_info = read_reader_config(reader_configs) | ||
except (KeyError, IOError, yaml.YAMLError): | ||
LOG.warning("Could not import reader config from: %s", reader_configs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain why you removed this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The person who made the original request recommended that we "suppress [the output] when the reader config is not found as a first time user this creates a lot of clutter." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good thinking! Could you just make it a |
||
LOG.debug("Could not import reader config from: %s", reader_configs) | ||
LOG.debug("Error loading YAML", exc_info=True) | ||
continue | ||
readers.append(reader_info if as_dict else reader_info['name']) | ||
if as_dict: | ||
readers = sorted(readers, key=lambda reader_info: reader_info['name']) | ||
else: | ||
readers = sorted(readers) | ||
return readers | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Great addition.