From 503192766ee5be85f5bff9d033a3adad07715e4b Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 20 Dec 2023 16:16:45 -0500 Subject: [PATCH 01/21] read deprecation warnings to errors and comment out product arg code --- icepyx/core/read.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index e136a1d64..bb0ee13c6 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -3,7 +3,6 @@ import os import warnings -import h5py import numpy as np import xarray as xr @@ -157,9 +156,9 @@ def _validate_source(source): # acceptable inputs (for now) are a single file or directory # would ultimately like to make a Path (from pathlib import Path; isinstance(source, Path)) an option # see https://github.com/OSOceanAcoustics/echopype/blob/ab5128fb8580f135d875580f0469e5fba3193b84/echopype/utils/io.py#L82 - assert type(source) == str, "You must enter your input as a string." + assert type(source) is str, "You must enter your input as a string." assert ( - os.path.isdir(source) == True or os.path.isfile(source) == True + os.path.isdir(source) is True or os.path.isfile(source) is True ), "Your data source string is not a valid data source." return True @@ -323,7 +322,7 @@ class Read: def __init__( self, - data_source=None, # DevNote: Make this a required arg when catalog is removed + data_source, product=None, filename_pattern=None, catalog=None, @@ -339,23 +338,21 @@ def __init__( if data_source is None: raise ValueError("data_source is a required arguemnt") + # Raise warnings for deprecated arguments if filename_pattern: - warnings.warn( + raise DeprecationError( "The `filename_pattern` argument is deprecated. Instead please provide a " - "string, list, or glob string to the `data_source` argument.", - stacklevel=2, + "string, list, or glob string to the `data_source` argument." ) if product: - product = is2ref._validate_product(product) - warnings.warn( + raise DeprecationError( "The `product` argument is no longer required. If the `data_source` argument given " "contains files with multiple products the `product` argument will be used " "to filter that list. In all other cases the product argument is ignored. " "The recommended approach is to not include a `product` argument and instead " - "provide a `data_source` with files of only a single product type`.", - stacklevel=2, + "provide a `data_source` with files of only a single product type`." ) # Create the filelist from the `data_source` argument From 1cac5f60b0d999bf2487c4eea44d35353091e2f8 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 20 Dec 2023 16:37:56 -0500 Subject: [PATCH 02/21] comment filename_pattern arg code --- icepyx/core/read.py | 89 +++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index bb0ee13c6..5c0d4b9f8 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -356,14 +356,14 @@ def __init__( ) # Create the filelist from the `data_source` argument - if filename_pattern: - # maintained for backward compatibility - pattern_ck, filelist = Read._check_source_for_pattern( - data_source, filename_pattern - ) - assert pattern_ck - self._filelist = filelist - elif isinstance(data_source, list): + # if filename_pattern: + # # maintained for backward compatibility + # pattern_ck, filelist = Read._check_source_for_pattern( + # data_source, filename_pattern + # ) + # assert pattern_ck + # self._filelist = filelist + if isinstance(data_source, list): self._filelist = data_source elif os.path.isdir(data_source): data_source = os.path.join(data_source, "*") @@ -381,31 +381,32 @@ def __init__( # Raise warnings or errors for multiple products or products not matching the user-specified product all_products = list(set(product_dict.values())) if len(all_products) > 1: - if product: - warnings.warn( - f"Multiple products found in list of files: {product_dict}. Files that " - "do not match the user specified product will be removed from processing.\n" - "Filtering files using a `product` argument is deprecated. Please use the " - "`data_source` argument to specify a list of files with the same product.", - stacklevel=2, - ) - self._filelist = [] - for key, value in product_dict.items(): - if value == product: - self._filelist.append(key) - if len(self._filelist) == 0: - raise TypeError( - "No files found in the file list matching the user-specified " - "product type" - ) - # Use the cleaned filelist to assign a product - self._product = product - else: - raise TypeError( - f"Multiple product types were found in the file list: {product_dict}." - "Please provide a valid `data_source` parameter indicating files of a single " - "product" - ) + # Should this code be removed now, or when the deprecation error for the arg is? + # if product: + # warnings.warn( + # f"Multiple products found in list of files: {product_dict}. Files that " + # "do not match the user specified product will be removed from processing.\n" + # "Filtering files using a `product` argument is deprecated. Please use the " + # "`data_source` argument to specify a list of files with the same product.", + # stacklevel=2, + # ) + # self._filelist = [] + # for key, value in product_dict.items(): + # if value == product: + # self._filelist.append(key) + # if len(self._filelist) == 0: + # raise TypeError( + # "No files found in the file list matching the user-specified " + # "product type" + # ) + # # Use the cleaned filelist to assign a product + # self._product = product + # else: + raise TypeError( + f"Multiple product types were found in the file list: {product_dict}." + "Please provide a valid `data_source` parameter indicating files of a single " + "product" + ) elif len(all_products) == 0: raise TypeError( "No files found matching the specified `data_source`. Check your glob " @@ -414,13 +415,13 @@ def __init__( else: # Assign the identified product to the property self._product = all_products[0] - # Raise a warning if the metadata-located product differs from the user-specified product - if product and self._product != product: - warnings.warn( - f"User specified product {product} does not match the product from the file" - " metadata {self._product}", - stacklevel=2, - ) + # # Raise a warning if the metadata-located product differs from the user-specified product + # if product and self._product != product: + # warnings.warn( + # f"User specified product {product} does not match the product from the file" + # " metadata {self._product}", + # stacklevel=2, + # ) if out_obj_type is not None: print( @@ -432,8 +433,6 @@ def __init__( # ---------------------------------------------------------------------- # Properties - # I cut and pasted this directly out of the Query class - going to need to reconcile the _source/file stuff there - @property def vars(self): """ @@ -743,11 +742,7 @@ def load(self): pass all_dss = [] - # DevNote: I'd originally hoped to rely on intake-xarray in order to not have to iterate through the files myself, - # by providing a generalized url/source in building the catalog. - # However, this led to errors when I tried to combine two identical datasets because the single dimension was equal. - # In these situations, xarray recommends manually controlling the merge/concat process yourself. - # While unlikely to be a broad issue, I've heard of multiple matching timestamps causing issues for combining multiple IS2 datasets. + for file in self.filelist: all_dss.append( self._build_single_file_dataset(file, groups_list) From d2fffbc1626366d3375bcc0067c0509a6d764390 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 20 Dec 2023 16:41:29 -0500 Subject: [PATCH 03/21] query dataset deprecation to error --- icepyx/core/query.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/icepyx/core/query.py b/icepyx/core/query.py index 32357eb8a..25f13d5b6 100644 --- a/icepyx/core/query.py +++ b/icepyx/core/query.py @@ -2,10 +2,10 @@ import matplotlib.pyplot as plt from pathlib import Path # used in docstring tests import pprint -import warnings import icepyx.core.APIformatting as apifmt from icepyx.core.auth import EarthdataAuthMixin +from icepyx.core.exceptions import DeprecationError import icepyx.core.granules as granules from icepyx.core.granules import Granules import icepyx.core.is2ref as is2ref @@ -455,10 +455,8 @@ def dataset(self): -------- product """ - warnings.filterwarnings("always") - warnings.warn( + DeprecationError( "In line with most common usage, 'dataset' has been replaced by 'product'.", - DeprecationWarning, ) @property From d04ea3db70da9e73ed8c965e746112c5f22e664e Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 20 Dec 2023 16:42:24 -0500 Subject: [PATCH 04/21] icesat2data deprecation error --- icepyx/core/icesat2data.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/icepyx/core/icesat2data.py b/icepyx/core/icesat2data.py index aa35fd433..e57305124 100644 --- a/icepyx/core/icesat2data.py +++ b/icepyx/core/icesat2data.py @@ -1,12 +1,10 @@ -import warnings +from icepyx.core.exceptions import DeprecationError class Icesat2Data: def __init__( self, ): - warnings.filterwarnings("always") - warnings.warn( + DeprecationError( "DEPRECATED. Please use icepyx.Query to create a download data object (all other functionality is the same)", - DeprecationWarning, ) From f4503980be4465bfaa90084dbba3f89fa736f823 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 22 Dec 2023 10:39:41 -0500 Subject: [PATCH 05/21] remove deprecated code and convert warning to error in auth --- icepyx/core/auth.py | 41 +++++++++++++++++++++++++---------------- icepyx/core/read.py | 44 +------------------------------------------- 2 files changed, 26 insertions(+), 59 deletions(-) diff --git a/icepyx/core/auth.py b/icepyx/core/auth.py index cf771f420..7c92c8081 100644 --- a/icepyx/core/auth.py +++ b/icepyx/core/auth.py @@ -3,6 +3,7 @@ import warnings import earthaccess +from icepyx.core.exceptions import DeprecationError class AuthenticationError(Exception): @@ -15,7 +16,8 @@ class AuthenticationError(Exception): class EarthdataAuthMixin: """ - This mixin class generates the needed authentication sessions and tokens, including for NASA Earthdata cloud access. + This mixin class generates the needed authentication sessions and tokens, + including for NASA Earthdata cloud access. Authentication is completed using the [earthaccess library](https://nsidc.github.io/earthaccess/). Methods for authenticating are: 1. Storing credentials as environment variables ($EARTHDATA_LOGIN and $EARTHDATA_PASSWORD) @@ -23,12 +25,14 @@ class EarthdataAuthMixin: 3. Storing credentials in a .netrc file (not recommended for security reasons) More details on using these methods is available in the [earthaccess documentation](https://nsidc.github.io/earthaccess/tutorials/restricted-datasets/#auth). - This class can be inherited by any other class that requires authentication. For - example, the `Query` class inherits this one, and so a Query object has the - `.session` property. The method `earthdata_login()` is included for backwards compatibility. + This class can be inherited by any other class that requires authentication. + For example, the `Query` class inherits this one, and so a Query object has the + `.session` property. + The method `earthdata_login()` is included for backwards compatibility. The class can be created without any initialization parameters, and the properties will - be populated when they are called. It can alternately be initialized with an + be populated when they are called. + It can alternately be initialized with an earthaccess.auth.Auth object, which will then be used to create a session or s3login_credentials as they are called. @@ -90,8 +94,8 @@ def session(self): @property def s3login_credentials(self): """ - A dictionary which stores login credentials for AWS s3 access. This property is accessed - if using AWS cloud data. + A dictionary which stores login credentials for AWS s3 access. + This property is accessed if using AWS cloud data. Because s3 tokens are only good for one hour, this function will automatically check if an hour has elapsed since the last token use and generate a new token if necessary. @@ -115,9 +119,13 @@ def set_s3_creds(): def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: """ Authenticate with NASA Earthdata to enable data ordering and download. - Credential storage details are described in the EathdataAuthMixin class section. + Credential storage details are described in the + EathdataAuthMixin class section. - **Note:** This method is maintained for backward compatibility. It is no longer required to explicitly run `.earthdata_login()`. Authentication will be performed by the module as needed when `.session` or `.s3login_credentials` are accessed. + **Note:** This method is maintained for backward compatibility. + It is no longer required to explicitly run `.earthdata_login()`. + Authentication will be performed by the module as needed when + `.session` or `.s3login_credentials` are accessed. Parameters ---------- @@ -126,7 +134,8 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: email : string, default None Deprecated keyword for backwards compatibility. s3token : boolean, default None - Deprecated keyword to generate AWS s3 ICESat-2 data access credentials + Deprecated keyword to generate AWS s3 ICESat-2 + data access credentials kwargs : key:value pairs Keyword arguments to be passed into earthaccess.login(). @@ -141,14 +150,14 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: """ warnings.warn( - "It is no longer required to explicitly run the `.earthdata_login()` method. Authentication will be performed by the module as needed.", + "It is no longer required to explicitly run the `.earthdata_login()` method." + "Authentication will be performed by the module as needed.", DeprecationWarning, stacklevel=2, ) - if uid != None or email != None or s3token != None: - warnings.warn( - "The user id (uid) and/or email keyword arguments are no longer required.", - DeprecationWarning, - stacklevel=2, + if uid is not None or email is not None or s3token is not None: + raise DeprecationError( + "The `uid`, `email`, and `s3token` arguments are deprecated." + "Please remove these arguments from your `earthdata_login()` function call." ) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index 5c0d4b9f8..a29381c2c 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -347,22 +347,8 @@ def __init__( ) if product: - raise DeprecationError( - "The `product` argument is no longer required. If the `data_source` argument given " - "contains files with multiple products the `product` argument will be used " - "to filter that list. In all other cases the product argument is ignored. " - "The recommended approach is to not include a `product` argument and instead " - "provide a `data_source` with files of only a single product type`." - ) + raise DeprecationError("The `product` argument is no longer required.") - # Create the filelist from the `data_source` argument - # if filename_pattern: - # # maintained for backward compatibility - # pattern_ck, filelist = Read._check_source_for_pattern( - # data_source, filename_pattern - # ) - # assert pattern_ck - # self._filelist = filelist if isinstance(data_source, list): self._filelist = data_source elif os.path.isdir(data_source): @@ -381,27 +367,6 @@ def __init__( # Raise warnings or errors for multiple products or products not matching the user-specified product all_products = list(set(product_dict.values())) if len(all_products) > 1: - # Should this code be removed now, or when the deprecation error for the arg is? - # if product: - # warnings.warn( - # f"Multiple products found in list of files: {product_dict}. Files that " - # "do not match the user specified product will be removed from processing.\n" - # "Filtering files using a `product` argument is deprecated. Please use the " - # "`data_source` argument to specify a list of files with the same product.", - # stacklevel=2, - # ) - # self._filelist = [] - # for key, value in product_dict.items(): - # if value == product: - # self._filelist.append(key) - # if len(self._filelist) == 0: - # raise TypeError( - # "No files found in the file list matching the user-specified " - # "product type" - # ) - # # Use the cleaned filelist to assign a product - # self._product = product - # else: raise TypeError( f"Multiple product types were found in the file list: {product_dict}." "Please provide a valid `data_source` parameter indicating files of a single " @@ -415,13 +380,6 @@ def __init__( else: # Assign the identified product to the property self._product = all_products[0] - # # Raise a warning if the metadata-located product differs from the user-specified product - # if product and self._product != product: - # warnings.warn( - # f"User specified product {product} does not match the product from the file" - # " metadata {self._product}", - # stacklevel=2, - # ) if out_obj_type is not None: print( From 5bfd3b956216602bf95afaf21c750463dc1cc86c Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 22 Dec 2023 11:06:41 -0500 Subject: [PATCH 06/21] update test warning to error --- icepyx/tests/test_auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/icepyx/tests/test_auth.py b/icepyx/tests/test_auth.py index 8507b1e40..44278adea 100644 --- a/icepyx/tests/test_auth.py +++ b/icepyx/tests/test_auth.py @@ -4,6 +4,7 @@ import earthaccess from icepyx.core.auth import EarthdataAuthMixin +from icepyx.core.exceptions import DeprecationError @pytest.fixture() @@ -37,6 +38,6 @@ def test_login_function(auth_instance): # Test that earthdata_login raises a warning if email is provided -def test_depreciation_warning(auth_instance): - with pytest.warns(DeprecationWarning): +def test_depreciation_error(auth_instance): + with pytest.warns(DeprecationError): auth_instance.earthdata_login(email="me@gmail.com") From 1d5d4655627025a421b234997bdbb9bb6960f72a Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 22 Dec 2023 13:41:18 -0500 Subject: [PATCH 07/21] remove test for deprecated args --- icepyx/tests/test_auth.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/icepyx/tests/test_auth.py b/icepyx/tests/test_auth.py index 44278adea..f02e4538c 100644 --- a/icepyx/tests/test_auth.py +++ b/icepyx/tests/test_auth.py @@ -35,9 +35,3 @@ def test_login_function(auth_instance): auth_instance.earthdata_login() assert isinstance(auth_instance.auth, earthaccess.auth.Auth) assert auth_instance.auth.authenticated - - -# Test that earthdata_login raises a warning if email is provided -def test_depreciation_error(auth_instance): - with pytest.warns(DeprecationError): - auth_instance.earthdata_login(email="me@gmail.com") From ce0e7145bbaac43514f346a11ed72c11a914c047 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Tue, 2 Jan 2024 14:23:25 -0500 Subject: [PATCH 08/21] raise deprecation error for earthdata_login() --- icepyx/core/auth.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/icepyx/core/auth.py b/icepyx/core/auth.py index 7c92c8081..51813e113 100644 --- a/icepyx/core/auth.py +++ b/icepyx/core/auth.py @@ -122,10 +122,10 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: Credential storage details are described in the EathdataAuthMixin class section. - **Note:** This method is maintained for backward compatibility. + **Note:** This method is maintained to enable passing of keyword + arguments directly to earthaccess. It is no longer required to explicitly run `.earthdata_login()`. - Authentication will be performed by the module as needed when - `.session` or `.s3login_credentials` are accessed. + Authentication will be performed by the module as needed. Parameters ---------- @@ -138,6 +138,7 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: data access credentials kwargs : key:value pairs Keyword arguments to be passed into earthaccess.login(). + Not yet implemented. Examples -------- @@ -149,15 +150,8 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: No .netrc found in /Users/username """ - warnings.warn( + raise DeprecationError( "It is no longer required to explicitly run the `.earthdata_login()` method." "Authentication will be performed by the module as needed.", - DeprecationWarning, stacklevel=2, ) - - if uid is not None or email is not None or s3token is not None: - raise DeprecationError( - "The `uid`, `email`, and `s3token` arguments are deprecated." - "Please remove these arguments from your `earthdata_login()` function call." - ) From 1fada737d331212793673e808ee6d06706d8f265 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Tue, 2 Jan 2024 14:37:40 -0500 Subject: [PATCH 09/21] update authentication admonition in notebooks --- .../example_notebooks/IS2_DEM_comparison_WIP.ipynb | 4 +--- .../example_notebooks/IS2_cloud_data_access.ipynb | 6 ++---- doc/source/example_notebooks/IS2_data_access.ipynb | 10 ++++------ .../IS2_data_access2-subsetting.ipynb | 4 +--- doc/source/example_notebooks/IS2_data_read-in.ipynb | 4 +--- .../example_notebooks/IS2_data_visualization.ipynb | 4 +--- 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb b/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb index 0d897c393..a5a5eb979 100644 --- a/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb +++ b/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb @@ -176,9 +176,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed in the [ICESat-2 Data Access Notebook](https://icepyx.readthedocs.io/en/latest/example_notebooks/IS2_data_access.html) example. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_cloud_data_access.ipynb b/doc/source/example_notebooks/IS2_cloud_data_access.ipynb index fa0931c8a..ba4dd12d9 100644 --- a/doc/source/example_notebooks/IS2_cloud_data_access.ipynb +++ b/doc/source/example_notebooks/IS2_cloud_data_access.ipynb @@ -103,9 +103,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed in the [ICESat-2 Data Access Notebook](https://icepyx.readthedocs.io/en/latest/example_notebooks/IS2_data_access.html) example. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", "```" ] }, @@ -192,7 +190,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/doc/source/example_notebooks/IS2_data_access.ipynb b/doc/source/example_notebooks/IS2_data_access.ipynb index 0b4a12244..704abe10c 100644 --- a/doc/source/example_notebooks/IS2_data_access.ipynb +++ b/doc/source/example_notebooks/IS2_data_access.ipynb @@ -485,9 +485,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", "```" ] }, @@ -626,9 +624,9 @@ ], "metadata": { "kernelspec": { - "display_name": "icepyx-dev", + "display_name": "icepyx", "language": "python", - "name": "icepyx-dev" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -640,7 +638,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb b/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb index 3803b9fd6..fdcc7b8d0 100644 --- a/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb +++ b/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb @@ -77,9 +77,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed in the [ICESat-2 Data Access Notebook](https://icepyx.readthedocs.io/en/latest/example_notebooks/IS2_data_access.html) example. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_data_read-in.ipynb b/doc/source/example_notebooks/IS2_data_read-in.ipynb index 9bbac368b..dba33c340 100644 --- a/doc/source/example_notebooks/IS2_data_read-in.ipynb +++ b/doc/source/example_notebooks/IS2_data_read-in.ipynb @@ -157,9 +157,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed in the [ICESat-2 Data Access Notebook](https://icepyx.readthedocs.io/en/latest/example_notebooks/IS2_data_access.html) example. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_data_visualization.ipynb b/doc/source/example_notebooks/IS2_data_visualization.ipynb index ec87829c2..3c4c1de30 100644 --- a/doc/source/example_notebooks/IS2_data_visualization.ipynb +++ b/doc/source/example_notebooks/IS2_data_visualization.ipynb @@ -210,9 +210,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed in the [ICESat-2 Data Access Notebook](https://icepyx.readthedocs.io/en/latest/example_notebooks/IS2_data_access.html) example. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", "```" ] }, From 6305372068e82f06b95aa4b4fcd3b11784f314e8 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 3 Jan 2024 11:57:53 -0500 Subject: [PATCH 10/21] remove kwarg from error --- icepyx/core/auth.py | 1 - 1 file changed, 1 deletion(-) diff --git a/icepyx/core/auth.py b/icepyx/core/auth.py index 51813e113..6c46a1135 100644 --- a/icepyx/core/auth.py +++ b/icepyx/core/auth.py @@ -153,5 +153,4 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: raise DeprecationError( "It is no longer required to explicitly run the `.earthdata_login()` method." "Authentication will be performed by the module as needed.", - stacklevel=2, ) From 85ba7ec9e5c55e85556f0c634a1f4deaf76bbf81 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 10:17:25 -0500 Subject: [PATCH 11/21] update admonitions in notebooks --- doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb | 2 +- doc/source/example_notebooks/IS2_cloud_data_access.ipynb | 4 ++-- .../example_notebooks/IS2_data_access2-subsetting.ipynb | 2 +- doc/source/example_notebooks/IS2_data_read-in.ipynb | 2 +- doc/source/example_notebooks/IS2_data_visualization.ipynb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb b/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb index a5a5eb979..bf1bc8af4 100644 --- a/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb +++ b/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb @@ -176,7 +176,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_cloud_data_access.ipynb b/doc/source/example_notebooks/IS2_cloud_data_access.ipynb index e5be7b732..194e25210 100644 --- a/doc/source/example_notebooks/IS2_cloud_data_access.ipynb +++ b/doc/source/example_notebooks/IS2_cloud_data_access.ipynb @@ -229,7 +229,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials.\n", "```" ] }, @@ -384,7 +384,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb b/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb index fdcc7b8d0..1bb178d8a 100644 --- a/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb +++ b/doc/source/example_notebooks/IS2_data_access2-subsetting.ipynb @@ -77,7 +77,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_data_read-in.ipynb b/doc/source/example_notebooks/IS2_data_read-in.ipynb index dba33c340..2869a7736 100644 --- a/doc/source/example_notebooks/IS2_data_read-in.ipynb +++ b/doc/source/example_notebooks/IS2_data_read-in.ipynb @@ -157,7 +157,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_data_visualization.ipynb b/doc/source/example_notebooks/IS2_data_visualization.ipynb index 3c4c1de30..0f2819862 100644 --- a/doc/source/example_notebooks/IS2_data_visualization.ipynb +++ b/doc/source/example_notebooks/IS2_data_visualization.ipynb @@ -210,7 +210,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed above.\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials.\n", "```" ] }, From b756057912fa5dc86c684413f1339c720f7bd34f Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 10:32:59 -0500 Subject: [PATCH 12/21] remove _check_source_from_pattern function --- icepyx/core/read.py | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index c3374e8de..11a969ffa 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -490,35 +490,6 @@ def product(self): # ---------------------------------------------------------------------- # Methods - @staticmethod - def _check_source_for_pattern(source, filename_pattern): - """ - Check that the entered data source contains files that match the input filename_pattern - """ - glob_pattern = _pattern_to_glob(filename_pattern) - - if os.path.isdir(source): - _, filelist = _run_fast_scandir(source, glob_pattern) - assert ( - len(filelist) > 0 - ), "None of your filenames match the specified pattern." - print( - f"You have {len(filelist)} files matching the filename pattern to be read in." - ) - return True, filelist - elif os.path.isfile(source): - assert fnmatch.fnmatch( - os.path.basename(source), glob_pattern - ), "Your input filename does not match the filename pattern." - return True, [source] - elif isinstance(source, str): - if source.startswith("s3://"): - return True, [source] - elif isinstance(source, list): - if all(source.startswith("s3://")): - return True, source - - return False, None @staticmethod def _add_vars_to_ds(is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict): @@ -727,9 +698,13 @@ def load(self): # add a check that wanted variables exists, and create them with defaults if possible (and let the user know) # write tests for the functions! - # Notes: intake wants an entire group, not an individual variable (which makes sense if we're using its smarts to set up lat, lon, etc) - # so to get a combined dataset, we need to keep track of spots under the hood, open each group, and then combine them into one xarray where the spots are IDed somehow (or only the strong ones are returned) - # this means we need to get/track from each dataset we open some of the metadata, which we include as mandatory variables when constructing the wanted list + # Notes: intake wants an entire group, not an individual variable + # (which makes sense if we're using its smarts to set up lat, lon, etc) + # so to get a combined dataset, we need to keep track of spots under the hood, + # open each group, and then combine them into one xarray where the spots are IDed somehow + # (or only the strong ones are returned) + # this means we need to get/track from each dataset we open some of the metadata, + # which we include as mandatory variables when constructing the wanted list if not self.vars.wanted: raise AttributeError( From 192f107635a5c625c36cf73a8d98279bcffefadb Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 10:33:10 -0500 Subject: [PATCH 13/21] update admonitions --- doc/source/example_notebooks/IS2_data_read-in.ipynb | 2 +- doc/source/example_notebooks/IS2_data_variables.ipynb | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/source/example_notebooks/IS2_data_read-in.ipynb b/doc/source/example_notebooks/IS2_data_read-in.ipynb index 2869a7736..c20cfbc95 100644 --- a/doc/source/example_notebooks/IS2_data_read-in.ipynb +++ b/doc/source/example_notebooks/IS2_data_read-in.ipynb @@ -328,7 +328,7 @@ "```{admonition} Read Module Update\n", "Previously, icepyx required two additional conditions: 1) a `product` argument and 2) that your files either matched the default `filename_pattern` or that the user provided their own `filename_pattern`. These two requirements have been removed. `product` is now read directly from the file metadata (the root group's `short_name` attribute). Flexibility to specify multiple files via the `filename_pattern` has been replaced with the [glob string](https://docs.python.org/3/library/glob.html) feature, and by allowing a list of filepaths as an argument.\n", "\n", - "The `product` and `filename_pattern` arguments have been maintained for backwards compatibility, but will be fully removed in icepyx version 1.0.0.\n", + "The `product` and `filename_pattern` arguments are now deprecated and were removed in icepyx version 1.0.0.\n", "```" ] }, diff --git a/doc/source/example_notebooks/IS2_data_variables.ipynb b/doc/source/example_notebooks/IS2_data_variables.ipynb index c66445731..90fa8500c 100644 --- a/doc/source/example_notebooks/IS2_data_variables.ipynb +++ b/doc/source/example_notebooks/IS2_data_variables.ipynb @@ -347,9 +347,7 @@ }, "source": [ "```{admonition} Important Authentication Update\n", - "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is no longer required, as icepyx will call the login function as needed. The user will still need to provide their credentials using one of the three methods decribed in the [ICESat-2 Data Access Notebook](https://icepyx.readthedocs.io/en/latest/example_notebooks/IS2_data_access.html) example. The `.earthdata_login()` function is still available for backwards compatibility.\n", - "\n", - "If you are unable to remove `earthdata_login()` calls from your workflow, note that certain inputs, such as `earthdata_uid` and `email`, are no longer required. e.g. `region_a.earthdata_login(earthdata_uid, email)` becomes `region_a.earthdata_login()`\n", + "Previously, icepyx required you to explicitly use the `.earthdata_login()` function to login. Running this function is deprecated and will result in an error, as icepyx will call the login function as needed. The user will still need to provide their credentials.\n", "```" ] }, From 06284c0cbd2a75fed2eb600ac0b6b061d8dbe2ca Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 11:12:07 -0500 Subject: [PATCH 14/21] remove earthdata_login test --- icepyx/core/auth.py | 4 +--- icepyx/tests/test_auth.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/icepyx/core/auth.py b/icepyx/core/auth.py index 6c46a1135..ba07ac398 100644 --- a/icepyx/core/auth.py +++ b/icepyx/core/auth.py @@ -122,8 +122,7 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: Credential storage details are described in the EathdataAuthMixin class section. - **Note:** This method is maintained to enable passing of keyword - arguments directly to earthaccess. + **Note:** This method is deprecated and will be removed in a future release. It is no longer required to explicitly run `.earthdata_login()`. Authentication will be performed by the module as needed. @@ -138,7 +137,6 @@ def earthdata_login(self, uid=None, email=None, s3token=None, **kwargs) -> None: data access credentials kwargs : key:value pairs Keyword arguments to be passed into earthaccess.login(). - Not yet implemented. Examples -------- diff --git a/icepyx/tests/test_auth.py b/icepyx/tests/test_auth.py index f02e4538c..c8f8e8f5d 100644 --- a/icepyx/tests/test_auth.py +++ b/icepyx/tests/test_auth.py @@ -32,6 +32,5 @@ def test_get_s3login_credentials(auth_instance): # Test that earthdata_login generates an auth object def test_login_function(auth_instance): - auth_instance.earthdata_login() assert isinstance(auth_instance.auth, earthaccess.auth.Auth) assert auth_instance.auth.authenticated From cda3f871134e64da9152ccac93af6d0d3dfb8888 Mon Sep 17 00:00:00 2001 From: Rachel Wegener Date: Fri, 5 Jan 2024 16:04:40 +0000 Subject: [PATCH 15/21] note full deprecation in docstring of filename_pattern and product --- icepyx/core/read.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index 11a969ffa..6dcf12a81 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -293,15 +293,14 @@ class Read(EarthdataAuthMixin): product : string ICESat-2 data product ID, also known as "short name" (e.g. ATL03). Available data products can be found at: https://nsidc.org/data/icesat-2/data-sets - **Deprecation warning:** This argument is no longer required and will be deprecated in version 1.0.0. + **Deprecation warning:** This argument is no longer required and has been deprecated. The dataset product is read from the file metadata. filename_pattern : string, default None String that shows the filename pattern as previously required for Intake's path_as_pattern argument. The default describes files downloaded directly from NSIDC (subsetted and non-subsetted) for most products (e.g. ATL06). The ATL11 filename pattern from NSIDC is: 'ATL{product:2}_{rgt:4}{orbitsegment:2}_{cycles:4}_{version:3}_{revision:2}.h5'. - **Deprecation warning:** This argument is no longer required and will be deprecated in version 1.0.0. - + **Deprecation warning:** This argument is no longer required and has been deprecated. catalog : string, default None Full path to an Intake catalog for reading in data. If you still need to create a catalog, leave as default. From d000e4e439344afa204b1d99c02c4e432dd173aa Mon Sep 17 00:00:00 2001 From: Rachel Wegener Date: Fri, 5 Jan 2024 16:06:00 +0000 Subject: [PATCH 16/21] move deprecated arguments to the bottom of the doc string and arguments list --- icepyx/core/read.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index 6dcf12a81..d1b546111 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -290,6 +290,14 @@ class Read(EarthdataAuthMixin): 3) a [glob string](https://docs.python.org/3/library/glob.html). The List must be a list of strings, each of which is the path of a single file. + glob_kwargs : dict, default {} + Additional arguments to be passed into the [glob.glob()](https://docs.python.org/3/library/glob.html#glob.glob)function + + out_obj_type : object, default xarray.Dataset + The desired format for the data to be read in. + Currently, only xarray.Dataset objects (default) are available. + Please ask us how to help enable usage of other data objects! + product : string ICESat-2 data product ID, also known as "short name" (e.g. ATL03). Available data products can be found at: https://nsidc.org/data/icesat-2/data-sets @@ -306,14 +314,6 @@ class Read(EarthdataAuthMixin): If you still need to create a catalog, leave as default. **Deprecation warning:** This argument has been deprecated. Please use the data_source argument to pass in valid data. - glob_kwargs : dict, default {} - Additional arguments to be passed into the [glob.glob()](https://docs.python.org/3/library/glob.html#glob.glob)function - - out_obj_type : object, default xarray.Dataset - The desired format for the data to be read in. - Currently, only xarray.Dataset objects (default) are available. - Please ask us how to help enable usage of other data objects! - Returns ------- read object @@ -344,11 +344,12 @@ class Read(EarthdataAuthMixin): def __init__( self, data_source, + glob_kwargs={}, + out_obj_type=None, # xr.Dataset, + # deprecated arguments product=None, filename_pattern=None, catalog=None, - glob_kwargs={}, - out_obj_type=None, # xr.Dataset, ): # Raise error for deprecated argument if catalog: From 706ffe6499c6c640d3e71068a84fcab9f4ebd78a Mon Sep 17 00:00:00 2001 From: Rachel Wegener Date: Fri, 5 Jan 2024 16:08:16 +0000 Subject: [PATCH 17/21] consolodate deprecated arguments --- icepyx/core/read.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index d1b546111..6c374d89c 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -351,20 +351,13 @@ def __init__( filename_pattern=None, catalog=None, ): - # Raise error for deprecated argument - if catalog: - raise DeprecationError( - "The `catalog` argument has been deprecated and intake is no longer supported. " - "Please use the `data_source` argument to specify your dataset instead." - ) - if data_source is None: - raise ValueError("data_source is a required arguemnt") + raise ValueError("data_source is a required argument") # initialize authentication properties EarthdataAuthMixin.__init__(self) - # Raise warnings for deprecated arguments + # Raise errors for deprecated arguments if filename_pattern: raise DeprecationError( "The `filename_pattern` argument is deprecated. Instead please provide a " @@ -373,6 +366,12 @@ def __init__( if product: raise DeprecationError("The `product` argument is no longer required.") + + if catalog: + raise DeprecationError( + "The `catalog` argument has been deprecated and intake is no longer supported. " + "Please use the `data_source` argument to specify your dataset instead." + ) if isinstance(data_source, list): # if data_source is a list pass that directly to _filelist From 94ab0ceafd81310609c4d3c358fb2f7a8db0e311 Mon Sep 17 00:00:00 2001 From: Rachel Wegener Date: Fri, 5 Jan 2024 16:27:01 +0000 Subject: [PATCH 18/21] remove unused import warnings --- icepyx/core/variables.py | 1 - 1 file changed, 1 deletion(-) diff --git a/icepyx/core/variables.py b/icepyx/core/variables.py index b611b861d..15d5268e5 100644 --- a/icepyx/core/variables.py +++ b/icepyx/core/variables.py @@ -1,7 +1,6 @@ import numpy as np import os import pprint -import warnings from icepyx.core.auth import EarthdataAuthMixin import icepyx.core.is2ref as is2ref From c3eb89949439aea8be5dbecefd29cd67f6d681b1 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 5 Jan 2024 11:30:22 -0500 Subject: [PATCH 19/21] removed unneeded check Co-authored-by: Rachel Wegener <35503632+rwegener2@users.noreply.github.com> --- icepyx/core/read.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index 6c374d89c..bff0aaeb4 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -351,8 +351,6 @@ def __init__( filename_pattern=None, catalog=None, ): - if data_source is None: - raise ValueError("data_source is a required argument") # initialize authentication properties EarthdataAuthMixin.__init__(self) From 49357bec0d3a99b4ec45d1f435c8322089b477dd Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 5 Jan 2024 11:33:09 -0500 Subject: [PATCH 20/21] black formatting --- icepyx/core/read.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index bff0aaeb4..e11015935 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -297,7 +297,7 @@ class Read(EarthdataAuthMixin): The desired format for the data to be read in. Currently, only xarray.Dataset objects (default) are available. Please ask us how to help enable usage of other data objects! - + product : string ICESat-2 data product ID, also known as "short name" (e.g. ATL03). Available data products can be found at: https://nsidc.org/data/icesat-2/data-sets @@ -351,7 +351,6 @@ def __init__( filename_pattern=None, catalog=None, ): - # initialize authentication properties EarthdataAuthMixin.__init__(self) @@ -364,7 +363,7 @@ def __init__( if product: raise DeprecationError("The `product` argument is no longer required.") - + if catalog: raise DeprecationError( "The `catalog` argument has been deprecated and intake is no longer supported. " @@ -390,6 +389,7 @@ def __init__( "data_source should be a list of files, a directory, the path to a file, " "or a glob string." ) + # Remove any directories from the list (these get generated during recursive # glob search) self._filelist = [f for f in self._filelist if not os.path.isdir(f)] From 67d178692d8afe79fa6a302d9150f95119e2710f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 5 Jan 2024 16:37:06 +0000 Subject: [PATCH 21/21] GitHub action UML generation auto-update --- .../documentation/classes_dev_uml.svg | 47 ++++--- .../documentation/packages_user_uml.svg | 116 ++++++++++-------- 2 files changed, 90 insertions(+), 73 deletions(-) diff --git a/doc/source/user_guide/documentation/classes_dev_uml.svg b/doc/source/user_guide/documentation/classes_dev_uml.svg index c5cd801aa..09c112f5c 100644 --- a/doc/source/user_guide/documentation/classes_dev_uml.svg +++ b/doc/source/user_guide/documentation/classes_dev_uml.svg @@ -232,32 +232,31 @@ icepyx.core.read.Read - -Read - -_filelist : NoneType, list -_out_obj : Dataset -_product : NoneType, str -_read_vars -filelist -is_s3 -product -vars - -__init__(data_source, product, filename_pattern, catalog, glob_kwargs, out_obj_type) -_add_vars_to_ds(is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict) -_build_dataset_template(file) -_build_single_file_dataset(file, groups_list) -_check_source_for_pattern(source, filename_pattern) -_combine_nested_vars(is2ds, ds, grp_path, wanted_dict) -_read_single_grp(file, grp_path) -load() + +Read + +_filelist : list +_out_obj : Dataset +_product +_read_vars +filelist +is_s3 +product +vars + +__init__(data_source, glob_kwargs, out_obj_type, product, filename_pattern, catalog) +_add_vars_to_ds(is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict) +_build_dataset_template(file) +_build_single_file_dataset(file, groups_list) +_combine_nested_vars(is2ds, ds, grp_path, wanted_dict) +_read_single_grp(file, grp_path) +load() icepyx.core.read.Read->icepyx.core.auth.EarthdataAuthMixin - - + + @@ -364,8 +363,8 @@ icepyx.core.variables.Variables->icepyx.core.read.Read - - + + _read_vars diff --git a/doc/source/user_guide/documentation/packages_user_uml.svg b/doc/source/user_guide/documentation/packages_user_uml.svg index a86000de8..5c45fc92b 100644 --- a/doc/source/user_guide/documentation/packages_user_uml.svg +++ b/doc/source/user_guide/documentation/packages_user_uml.svg @@ -4,11 +4,11 @@ - - + + packages_user_uml - + icepyx.core @@ -24,50 +24,68 @@ icepyx.core.auth - -icepyx.core.auth + +icepyx.core.auth icepyx.core.exceptions - -icepyx.core.exceptions + +icepyx.core.exceptions + + + +icepyx.core.auth->icepyx.core.exceptions + + icepyx.core.granules - -icepyx.core.granules + +icepyx.core.granules icepyx.core.icesat2data - -icepyx.core.icesat2data + +icepyx.core.icesat2data + + + +icepyx.core.icesat2data->icepyx.core.exceptions + + icepyx.core.is2ref - -icepyx.core.is2ref + +icepyx.core.is2ref icepyx.core.query - -icepyx.core.query + +icepyx.core.query - + icepyx.core.query->icepyx.core.auth - - + + + + + +icepyx.core.query->icepyx.core.exceptions + + - + icepyx.core.query->icepyx.core.granules - - + + @@ -76,22 +94,22 @@ icepyx.core.variables - + icepyx.core.query->icepyx.core.variables - - + + icepyx.core.visualization - -icepyx.core.visualization + +icepyx.core.visualization - + icepyx.core.query->icepyx.core.visualization - - + + @@ -100,19 +118,19 @@ icepyx.core.read - + icepyx.core.read->icepyx.core.auth - - + + - + icepyx.core.read->icepyx.core.exceptions - - + + - + icepyx.core.read->icepyx.core.variables @@ -120,32 +138,32 @@ icepyx.core.spatial - -icepyx.core.spatial + +icepyx.core.spatial icepyx.core.temporal - -icepyx.core.temporal + +icepyx.core.temporal icepyx.core.validate_inputs - -icepyx.core.validate_inputs + +icepyx.core.validate_inputs - + icepyx.core.variables->icepyx.core.auth - - + + - + icepyx.core.variables->icepyx.core.exceptions - - + +