Skip to content
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

Minor changes to read.py #7

Merged
merged 5 commits into from
Oct 31, 2019
Merged

Conversation

kinow
Copy link
Contributor

@kinow kinow commented Oct 31, 2019

Hi,

Starting reading the code from the read function in the README.md example. This PR changes a few things in the code that should not affect the behaviour, but simplify the code or protect against possible issues.

@@ -540,8 +540,6 @@ def read(files, external=None, verbose=False, warnings=False,
if aggregate and len(field_list) > 1:
if verbose:
org_len = len(field_list) # pragma: no cover

if verbose:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above ☝️

@@ -598,7 +596,7 @@ def _plural(n): # pragma: no cover
return 's' if n !=1 else '' # pragma: no cover


def _read_a_file(filename, aggregate=True, aggregate_options={},
def _read_a_file(filename, aggregate=True, aggregate_options=None,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -630,6 +628,8 @@ def _read_a_file(filename, aggregate=True, aggregate_options={},
The fields in the file.

'''
if aggregate_options is None:
aggregate_options = {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of the removal of the default mutable argument above.

if ftype == 'CDL':
# Create a temporary netCDF file from input CDL
cdl = True
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cdl is never used.

@davidhassell davidhassell merged commit b16c713 into NCAS-CMS:master Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants