You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import statements are scattered across most of the readers, lacking a clear organization.
There are redundant, inconsistent, and unoptimized imports of same module in some readers.
Changes
Grouping the imports into one of the following:
Standard Library imports
Third-Party Library imports
GeoIPS-based imports
Move the import statements to the top of the file if they are inside a method that is definitely called each time.
Move the import statement to the top of the file if they are located in the call() function, the primary function in each reader.
Sorts the imports alphabetically within each group, adhering to PEP 8 standards
Remove redundant import statements such as :
amsr2_netcdf.py had three instances of import xarray including in the primary function call()
amsr2_netcdf.py has two functions read_amsr_winds() and read_amsr_mbt(). One of the two is called and each one has same imports listed in their definition
Some readers had numpy listed under standard libraries import which should be moved to Third-Party Library imports
Fix inconsistent imports of the same module in a given reader
import numpy
import numpy as np
import os
from os.path import basename
from numpy import datetime64
import numpy
Does Not Change
This issue does not intend to change the following
The imports handled through optional dependency checks have not been changed.
with import_optional_dependencies(loglevel="info"):
"""Attempt to import a package and print to LOG.info if the import fails."""
# If this reader is not installed on the system, don't fail alltogether, just skip
# this import. This reader will not work if the import fails and the package will
# have to be installed to process data of this type.
import netCDF4 as ncdf
import numexpr as ne
The GeoIPS-based imports, which are local and used for a specific function within the method, have not been modified to maintain the relevant context.
Background and Motivation
Adhere to PEP 8 standards of imports organization to improve code readability and standardize imports.
Checklist for Completion
make the changes across all the readers
perform a full test to ensure successful validation
The text was updated successfully, but these errors were encountered:
Description
Changes
call()
function, the primary function in each reader.import xarray
including in the primary functioncall()
Does Not Change
This issue does not intend to change the following
Background and Motivation
Checklist for Completion
The text was updated successfully, but these errors were encountered: