From 60d21fce07c12e8561547ce640da6096c85b0682 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 5 Feb 2025 18:20:52 -0500 Subject: [PATCH] Remove existing deprecations from icepyx v1.x (#640) Co-authored-by: GitHub Action --- .../IS2_DEM_comparison_WIP.ipynb | 16 +- .../IS2_cloud_data_access.ipynb | 15 +- .../example_notebooks/IS2_data_access.ipynb | 13 +- .../example_notebooks/IS2_data_read-in.ipynb | 26 - .../IS2_data_variables.ipynb | 17 +- .../IS2_data_visualization.ipynb | 12 - .../documentation/classes_dev_uml.svg | 447 +++++++++--------- .../documentation/classes_user_uml.svg | 278 ++++++----- .../documentation/packages_user_uml.svg | 204 ++++---- doc/source/user_guide/documentation/query.rst | 1 - icepyx/core/auth.py | 40 -- icepyx/core/icesat2data.py | 10 - icepyx/core/is2ref.py | 1 + icepyx/core/query.py | 14 - icepyx/core/read.py | 37 -- icepyx/core/variables.py | 15 - icepyx/tests/integration/test_auth.py | 7 - icepyx/tests/unit/test_Earthdata.py | 10 +- icepyx/tests/unit/test_granules.py | 4 - 19 files changed, 448 insertions(+), 719 deletions(-) delete mode 100644 icepyx/core/icesat2data.py diff --git a/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb b/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb index f6cef3494..5f5190142 100644 --- a/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb +++ b/doc/source/example_notebooks/IS2_DEM_comparison_WIP.ipynb @@ -137,15 +137,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Finding and downloading data\n", - "In order to download any data from NSIDC, we must first authenticate ourselves using a valid Earthdata login (available for free on their website). This will create a valid token to interface with the DAAC as well as start an active logged-in session to enable data download. The token is attached to the data object and stored, but the session must be passed to the download function. Then we can order the granules." + "## Finding and downloading data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Log in to Earthdata" + "### Search for Data" ] }, { @@ -169,17 +168,6 @@ "region_a.granules.avail" ] }, - { - "cell_type": "markdown", - "metadata": { - "user_expressions": [] - }, - "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.\n", - "```" - ] - }, { "cell_type": "markdown", "metadata": {}, diff --git a/doc/source/example_notebooks/IS2_cloud_data_access.ipynb b/doc/source/example_notebooks/IS2_cloud_data_access.ipynb index 3f448aa4b..adaf8efcf 100644 --- a/doc/source/example_notebooks/IS2_cloud_data_access.ipynb +++ b/doc/source/example_notebooks/IS2_cloud_data_access.ipynb @@ -222,17 +222,6 @@ "# reg.s3login_credentials" ] }, - { - "cell_type": "markdown", - "metadata": { - "user_expressions": [] - }, - "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.\n", - "```" - ] - }, { "cell_type": "markdown", "metadata": { @@ -370,7 +359,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "icepyx", "language": "python", "name": "python3" }, @@ -384,7 +373,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.10" + "version": "3.12.7" } }, "nbformat": 4, diff --git a/doc/source/example_notebooks/IS2_data_access.ipynb b/doc/source/example_notebooks/IS2_data_access.ipynb index 268a9a3b9..a2f103a05 100644 --- a/doc/source/example_notebooks/IS2_data_access.ipynb +++ b/doc/source/example_notebooks/IS2_data_access.ipynb @@ -478,17 +478,6 @@ "- with stored credentials in a .netrc file (not recommended for security reasons)" ] }, - { - "cell_type": "markdown", - "metadata": { - "user_expressions": [] - }, - "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 described above.\n", - "```" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -638,7 +627,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.10" + "version": "3.12.7" } }, "nbformat": 4, diff --git a/doc/source/example_notebooks/IS2_data_read-in.ipynb b/doc/source/example_notebooks/IS2_data_read-in.ipynb index 9cd61ac01..eb85f254c 100644 --- a/doc/source/example_notebooks/IS2_data_read-in.ipynb +++ b/doc/source/example_notebooks/IS2_data_read-in.ipynb @@ -149,18 +149,6 @@ "region_a.download_granules(path=path_root)" ] }, - { - "cell_type": "markdown", - "id": "04f62f30-b13c-4cfc-95b0-dd1e048f6a85", - "metadata": { - "user_expressions": [] - }, - "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.\n", - "```" - ] - }, { "cell_type": "markdown", "id": "e8da42c1", @@ -318,20 +306,6 @@ "ipx.Read(list_of_files)" ] }, - { - "cell_type": "markdown", - "id": "08df2874-7c54-4670-8f37-9135ea296ff5", - "metadata": { - "user_expressions": [] - }, - "source": [ - "```{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 are now deprecated and were removed in icepyx version 1.0.0.\n", - "```" - ] - }, { "cell_type": "markdown", "id": "4275b04c", diff --git a/doc/source/example_notebooks/IS2_data_variables.ipynb b/doc/source/example_notebooks/IS2_data_variables.ipynb index 2263ea768..30fb07c44 100644 --- a/doc/source/example_notebooks/IS2_data_variables.ipynb +++ b/doc/source/example_notebooks/IS2_data_variables.ipynb @@ -340,17 +340,6 @@ "# start_time='00:00:00', end_time='23:59:59')" ] }, - { - "cell_type": "markdown", - "metadata": { - "user_expressions": [] - }, - "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.\n", - "```" - ] - }, { "cell_type": "markdown", "metadata": { @@ -1063,9 +1052,9 @@ ], "metadata": { "kernelspec": { - "display_name": "icepyx-dev", + "display_name": "icepyx", "language": "python", - "name": "icepyx-dev" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -1077,7 +1066,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.12.7" } }, "nbformat": 4, diff --git a/doc/source/example_notebooks/IS2_data_visualization.ipynb b/doc/source/example_notebooks/IS2_data_visualization.ipynb index 1654a83d2..0483402b5 100644 --- a/doc/source/example_notebooks/IS2_data_visualization.ipynb +++ b/doc/source/example_notebooks/IS2_data_visualization.ipynb @@ -210,18 +210,6 @@ "region.download_granules(path)" ] }, - { - "cell_type": "markdown", - "id": "10cc8fef-7a43-41c4-ab22-6f551ad68659", - "metadata": { - "user_expressions": [] - }, - "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.\n", - "```" - ] - }, { "cell_type": "markdown", "id": "textile-casting", diff --git a/doc/source/user_guide/documentation/classes_dev_uml.svg b/doc/source/user_guide/documentation/classes_dev_uml.svg index 223dbde8d..26850f494 100644 --- a/doc/source/user_guide/documentation/classes_dev_uml.svg +++ b/doc/source/user_guide/documentation/classes_dev_uml.svg @@ -4,11 +4,11 @@ - - + + classes_dev_uml - + icepyx.quest.dataset_scripts.argo.Argo @@ -199,20 +199,19 @@ icepyx.core.auth.EarthdataAuthMixin - -EarthdataAuthMixin - -_auth : NoneType -_s3_initial_ts : NoneType, datetime -_s3login_credentials : NoneType -_session : NoneType -auth -s3login_credentials -session - -__init__(auth) -__str__(): str -earthdata_login(uid, email, s3token): None + +EarthdataAuthMixin + +_auth : NoneType +_s3_initial_ts : NoneType, datetime +_s3login_credentials : NoneType +_session : NoneType +auth +s3login_credentials +session + +__init__(auth) +__str__(): str @@ -224,7 +223,7 @@ - + icepyx.core.exceptions.TypeGuardException TypeGuardException @@ -241,20 +240,20 @@ icepyx.core.query.GenQuery - -GenQuery - -_spatial -_temporal -dates -end_time -spatial -spatial_extent -start_time -temporal - -__init__(spatial_extent, date_range, start_time, end_time) -__str__() + +GenQuery + +_spatial +_temporal +dates +end_time +spatial +spatial_extent +start_time +temporal + +__init__(spatial_extent, date_range, start_time, end_time) +__str__() @@ -273,95 +272,85 @@ icepyx.core.granules.Granules->icepyx.core.auth.EarthdataAuthMixin - - + + - + icepyx.core.query.Query - -Query - -CMRparams -_CMRparams -_about_product -_cust_options : dict -_cycles : list -_granules -_order_vars -_prod : NoneType, str -_readable_granule_name : list -_reqparams -_subsetparams : Optional[apifmt.SubsetParameters] -_tracks : list -_version -cycles -dataset -granules -order_vars -product -product_version -reqparams -tracks - -__init__(product, spatial_extent, date_range, start_time, end_time, version, cycles, tracks, auth) -__str__() -avail_granules(ids, cycles, tracks, cloud) -download_granules(path, verbose, subset, restart) -latest_version() -order_granules(verbose, subset, email) -product_all_info() -product_summary_info() -show_custom_options(dictview) -subsetparams(): Union[EGIParamsSubset, dict[Never, Never]] -visualize_elevation() -visualize_spatial_extent() + +Query + +CMRparams +_CMRparams +_about_product +_cust_options : dict +_cycles : list +_granules +_order_vars +_prod : NoneType, str +_readable_granule_name : list +_reqparams +_subsetparams : Optional[apifmt.SubsetParameters] +_tracks : list +_version +cycles +granules +order_vars +product +product_version +reqparams +tracks + +__init__(product, spatial_extent, date_range, start_time, end_time, version, cycles, tracks, auth) +__str__() +avail_granules(ids, cycles, tracks, cloud) +download_granules(path, verbose, subset, restart) +latest_version() +order_granules(verbose, subset, email) +product_all_info() +product_summary_info() +show_custom_options(dictview) +subsetparams(): Union[EGIParamsSubset, dict[Never, Never]] +visualize_elevation() +visualize_spatial_extent() icepyx.core.granules.Granules->icepyx.core.query.Query - - -_granules - - - -icepyx.core.icesat2data.Icesat2Data - -Icesat2Data - - -__init__() + + +_granules - + icepyx.core.exceptions.NsidcQueryError - -NsidcQueryError - -errmsg -msgtxt : str - -__init__(errmsg, msgtxt) -__str__() + +NsidcQueryError + +errmsg +msgtxt : str + +__init__(errmsg, msgtxt) +__str__() - + icepyx.core.exceptions.QueryError - -QueryError - - - + +QueryError + + + icepyx.core.exceptions.NsidcQueryError->icepyx.core.exceptions.QueryError - - + + - + icepyx.core.APIformatting.Parameters Parameters @@ -381,152 +370,152 @@ icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - -_CMRparams + + +_CMRparams icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - -_reqparams + + +_reqparams icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - -_subsetparams + + +_subsetparams icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - -_subsetparams + + +_subsetparams icepyx.core.query.Query->icepyx.core.auth.EarthdataAuthMixin - - + + icepyx.core.query.Query->icepyx.core.query.GenQuery - - + + - + icepyx.quest.quest.Quest - -Quest - -datasets : dict - -__init__(spatial_extent, date_range, start_time, end_time, proj) -__str__() -add_argo(params, presRange): None -add_icesat2(product, start_time, end_time, version, cycles, tracks, files): None -download_all(path) -save_all(path) -search_all() + +Quest + +datasets : dict + +__init__(spatial_extent, date_range, start_time, end_time, proj) +__str__() +add_argo(params, presRange): None +add_icesat2(product, start_time, end_time, version, cycles, tracks, files): None +download_all(path) +save_all(path) +search_all() icepyx.quest.quest.Quest->icepyx.core.query.GenQuery - - + + - + icepyx.core.read.Read - -Read - -_filelist -_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() + +Read + +_filelist +_out_obj : Dataset +_product +_read_vars +filelist +is_s3 +product +vars + +__init__(data_source, 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) +_combine_nested_vars(is2ds, ds, grp_path, wanted_dict) +_read_single_grp(file, grp_path) +load() icepyx.core.read.Read->icepyx.core.auth.EarthdataAuthMixin - - + + - + icepyx.core.spatial.Spatial - -Spatial - -_ext_type : str -_gdf_spat : GeoDataFrame -_geom_file : NoneType -_spatial_ext -_xdateln -extent -extent_as_gdf -extent_file -extent_type - -__init__(spatial_extent) -__str__() -fmt_for_CMR() -fmt_for_EGI() + +Spatial + +_ext_type : str +_gdf_spat : GeoDataFrame +_geom_file : NoneType +_spatial_ext +_xdateln +extent +extent_as_gdf +extent_file +extent_type + +__init__(spatial_extent) +__str__() +fmt_for_CMR() +fmt_for_EGI() icepyx.core.spatial.Spatial->icepyx.core.query.GenQuery - - -_spatial + + +_spatial icepyx.core.spatial.Spatial->icepyx.core.query.GenQuery - - -_spatial + + +_spatial - + icepyx.core.temporal.Temporal - -Temporal - -_end : datetime -_start : datetime -end -start - -__init__(date_range: Union[list, dict], start_time: Union[str, dt.time, None], end_time: Union[str, dt.time, None]) -__str__(): str + +Temporal + +_end : datetime +_start : datetime +end +start + +__init__(date_range: Union[list, dict], start_time: Union[str, dt.time, None], end_time: Union[str, dt.time, None]) +__str__(): str icepyx.core.temporal.Temporal->icepyx.core.query.GenQuery - - -_temporal + + +_temporal - + icepyx.core.variables.Variables Variables @@ -540,7 +529,7 @@ version wanted : NoneType, dict -__init__(vartype, path, product, version, avail, wanted, auth) +__init__(path, product, version, avail, wanted, auth) _check_valid_lists(vgrp, allpaths, var_list, beam_list, keyword_list) _get_combined_list(beam_list, keyword_list) _get_sum_varlist(var_list, all_vars, defaults) @@ -554,60 +543,60 @@ icepyx.core.variables.Variables->icepyx.core.auth.EarthdataAuthMixin - - + + icepyx.core.variables.Variables->icepyx.core.query.Query - - -_order_vars + + +_order_vars icepyx.core.variables.Variables->icepyx.core.query.Query - - -_order_vars + + +_order_vars icepyx.core.variables.Variables->icepyx.core.read.Read - - -_read_vars + + +_read_vars icepyx.core.variables.Variables->icepyx.core.read.Read - - -_read_vars + + +_read_vars - + icepyx.core.visualization.Visualize - -Visualize - -bbox : list -cycles : NoneType -date_range : NoneType -product : NoneType, str -tracks : NoneType - -__init__(query_obj, product, spatial_extent, date_range, cycles, tracks) -generate_OA_parameters(): list -grid_bbox(binsize): list -make_request(base_url, payload) -parallel_request_OA(): da.array -query_icesat2_filelist(): tuple -request_OA_data(paras): da.array -viz_elevation(): tuple[hv.DynamicMap, hv.Layout] + +Visualize + +bbox : list +cycles : NoneType +date_range : NoneType +product : NoneType, str +tracks : NoneType + +__init__(query_obj, product, spatial_extent, date_range, cycles, tracks) +generate_OA_parameters(): list +grid_bbox(binsize): list +make_request(base_url, payload) +parallel_request_OA(): da.array +query_icesat2_filelist(): tuple +request_OA_data(paras): da.array +viz_elevation(): tuple[hv.DynamicMap, hv.Layout] - + icepyx.core.APIformatting._FmtedKeysDescriptor _FmtedKeysDescriptor diff --git a/doc/source/user_guide/documentation/classes_user_uml.svg b/doc/source/user_guide/documentation/classes_user_uml.svg index b9a3c2508..e8f941353 100644 --- a/doc/source/user_guide/documentation/classes_user_uml.svg +++ b/doc/source/user_guide/documentation/classes_user_uml.svg @@ -4,11 +4,11 @@ - - + + classes_user_uml - + icepyx.core.auth.AuthenticationError @@ -142,14 +142,14 @@ icepyx.core.auth.EarthdataAuthMixin - -EarthdataAuthMixin - -auth -s3login_credentials -session - -earthdata_login(uid, email, s3token): None + +EarthdataAuthMixin + +auth +s3login_credentials +session + + @@ -161,7 +161,7 @@ - + icepyx.core.exceptions.TypeGuardException TypeGuardException @@ -178,17 +178,17 @@ icepyx.core.query.GenQuery - -GenQuery - -dates -end_time -spatial -spatial_extent -start_time -temporal - - + +GenQuery + +dates +end_time +spatial +spatial_extent +start_time +temporal + + @@ -206,18 +206,17 @@ icepyx.core.granules.Granules->icepyx.core.auth.EarthdataAuthMixin - - + + - + icepyx.core.query.Query - -Query - -CMRparams -cycles -dataset + +Query + +CMRparams +cycles granules order_vars product @@ -239,47 +238,38 @@ icepyx.core.granules.Granules->icepyx.core.query.Query - - + + _granules - - -icepyx.core.icesat2data.Icesat2Data - -Icesat2Data - - - - - + icepyx.core.exceptions.NsidcQueryError - -NsidcQueryError - -errmsg -msgtxt : str - - + +NsidcQueryError + +errmsg +msgtxt : str + + - + icepyx.core.exceptions.QueryError - -QueryError - - - + +QueryError + + + icepyx.core.exceptions.NsidcQueryError->icepyx.core.exceptions.QueryError - - + + - + icepyx.core.APIformatting.Parameters Parameters @@ -295,110 +285,110 @@ icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - + + _CMRparams icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - -_reqparams + + +_reqparams icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - + + _subsetparams icepyx.core.APIformatting.Parameters->icepyx.core.query.Query - - + + _subsetparams icepyx.core.query.Query->icepyx.core.auth.EarthdataAuthMixin - - + + icepyx.core.query.Query->icepyx.core.query.GenQuery - - + + - + icepyx.core.read.Read - -Read - -filelist -is_s3 -product -vars - -load() + +Read + +filelist +is_s3 +product +vars + +load() icepyx.core.read.Read->icepyx.core.auth.EarthdataAuthMixin - - + + - + icepyx.core.spatial.Spatial - -Spatial - -extent -extent_as_gdf -extent_file -extent_type - -fmt_for_CMR() -fmt_for_EGI() + +Spatial + +extent +extent_as_gdf +extent_file +extent_type + +fmt_for_CMR() +fmt_for_EGI() icepyx.core.spatial.Spatial->icepyx.core.query.GenQuery - - -_spatial + + +_spatial icepyx.core.spatial.Spatial->icepyx.core.query.GenQuery - - -_spatial + + +_spatial - + icepyx.core.temporal.Temporal - -Temporal - -end -start - - + +Temporal + +end +start + + icepyx.core.temporal.Temporal->icepyx.core.query.GenQuery - - -_temporal + + +_temporal - + icepyx.core.variables.Variables Variables @@ -416,59 +406,59 @@ icepyx.core.variables.Variables->icepyx.core.auth.EarthdataAuthMixin - - + + icepyx.core.variables.Variables->icepyx.core.query.Query - - + + _order_vars icepyx.core.variables.Variables->icepyx.core.query.Query - - + + _order_vars icepyx.core.variables.Variables->icepyx.core.read.Read - - + + _read_vars icepyx.core.variables.Variables->icepyx.core.read.Read - - -_read_vars + + +_read_vars - + icepyx.core.visualization.Visualize - -Visualize - -bbox : list -cycles : NoneType -date_range : NoneType -product : NoneType, str -tracks : NoneType - -generate_OA_parameters(): list -grid_bbox(binsize): list -make_request(base_url, payload) -parallel_request_OA(): da.array -query_icesat2_filelist(): tuple -request_OA_data(paras): da.array -viz_elevation(): tuple[hv.DynamicMap, hv.Layout] + +Visualize + +bbox : list +cycles : NoneType +date_range : NoneType +product : NoneType, str +tracks : NoneType + +generate_OA_parameters(): list +grid_bbox(binsize): list +make_request(base_url, payload) +parallel_request_OA(): da.array +query_icesat2_filelist(): tuple +request_OA_data(paras): da.array +viz_elevation(): tuple[hv.DynamicMap, hv.Layout] - + icepyx.core.APIformatting._FmtedKeysDescriptor _FmtedKeysDescriptor diff --git a/doc/source/user_guide/documentation/packages_user_uml.svg b/doc/source/user_guide/documentation/packages_user_uml.svg index f05094a12..1b1c9eff8 100644 --- a/doc/source/user_guide/documentation/packages_user_uml.svg +++ b/doc/source/user_guide/documentation/packages_user_uml.svg @@ -4,220 +4,184 @@ - - + + packages_user_uml - + icepyx.core - -icepyx.core + +icepyx.core icepyx.core.APIformatting - -icepyx.core.APIformatting + +icepyx.core.APIformatting icepyx.core.exceptions - -icepyx.core.exceptions + +icepyx.core.exceptions icepyx.core.APIformatting->icepyx.core.exceptions - - + + - + icepyx.core.types - -icepyx.core.types + +icepyx.core.types icepyx.core.APIformatting->icepyx.core.types - - + + icepyx.core.auth - -icepyx.core.auth - - - -icepyx.core.auth->icepyx.core.exceptions - - + +icepyx.core.auth icepyx.core.granules - -icepyx.core.granules + +icepyx.core.granules - + icepyx.core.granules->icepyx.core.auth - - + + - + icepyx.core.granules->icepyx.core.types - - + + - + icepyx.core.urls - -icepyx.core.urls + +icepyx.core.urls - + icepyx.core.granules->icepyx.core.urls - - - - - -icepyx.core.icesat2data - -icepyx.core.icesat2data - - - -icepyx.core.icesat2data->icepyx.core.exceptions - - + + - + icepyx.core.is2ref - -icepyx.core.is2ref + +icepyx.core.is2ref - + icepyx.core.is2ref->icepyx.core.urls - - + + - + 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 - - + + - + icepyx.core.query->icepyx.core.types - - + + - + icepyx.core.variables - -icepyx.core.variables + +icepyx.core.variables - + icepyx.core.query->icepyx.core.variables - - + + - + icepyx.core.visualization - -icepyx.core.visualization + +icepyx.core.visualization - + icepyx.core.query->icepyx.core.visualization - - + + - + icepyx.core.read - -icepyx.core.read + +icepyx.core.read - + icepyx.core.read->icepyx.core.auth - - - - - -icepyx.core.read->icepyx.core.exceptions - - + + - + icepyx.core.read->icepyx.core.variables - - + + - + 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 - - + + diff --git a/doc/source/user_guide/documentation/query.rst b/doc/source/user_guide/documentation/query.rst index df82aa35b..14f278a3b 100644 --- a/doc/source/user_guide/documentation/query.rst +++ b/doc/source/user_guide/documentation/query.rst @@ -43,7 +43,6 @@ Methods Query.avail_granules Query.download_granules - Query.earthdata_login Query.latest_version Query.order_granules Query.product_all_info diff --git a/icepyx/core/auth.py b/icepyx/core/auth.py index 71b4393e5..401911c9e 100644 --- a/icepyx/core/auth.py +++ b/icepyx/core/auth.py @@ -3,8 +3,6 @@ import earthaccess -from icepyx.core.exceptions import DeprecationError - class AuthenticationError(Exception): """ @@ -26,7 +24,6 @@ class EarthdataAuthMixin: 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. @@ -111,40 +108,3 @@ def set_s3_creds(): ) >= datetime.timedelta(hours=1): set_s3_creds() return self._s3login_credentials - - 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. - - **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. - - Parameters - ---------- - uid : string, default None - Deprecated keyword for Earthdata login user ID. - email : string, default None - Deprecated keyword for backwards compatibility. - s3token : boolean, default None - Deprecated keyword to generate AWS s3 ICESat-2 - data access credentials - kwargs : key:value pairs - Keyword arguments to be passed into earthaccess.login(). - - Examples - -------- - >>> reg_a = ipx.Query('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28']) # doctest: +SKIP - >>> reg_a.earthdata_login() # doctest: +SKIP - Enter your Earthdata Login username: ___________________ - - EARTHDATA_USERNAME and EARTHDATA_PASSWORD are not set in the current environment, try setting them or use a different strategy (netrc, interactive) - No .netrc found in /Users/username - - """ - raise DeprecationError( - "It is no longer required to explicitly run the `.earthdata_login()` method." - "Authentication will be performed by the module as needed.", - ) diff --git a/icepyx/core/icesat2data.py b/icepyx/core/icesat2data.py deleted file mode 100644 index e57305124..000000000 --- a/icepyx/core/icesat2data.py +++ /dev/null @@ -1,10 +0,0 @@ -from icepyx.core.exceptions import DeprecationError - - -class Icesat2Data: - def __init__( - self, - ): - DeprecationError( - "DEPRECATED. Please use icepyx.Query to create a download data object (all other functionality is the same)", - ) diff --git a/icepyx/core/is2ref.py b/icepyx/core/is2ref.py index 95df81971..376923ad6 100644 --- a/icepyx/core/is2ref.py +++ b/icepyx/core/is2ref.py @@ -96,6 +96,7 @@ def _get_custom_options(session, product, version): """ cust_options = {} + # flagging for update/removal given removal of `.earthdata_login()` if session is None: raise ValueError( "Don't forget to log in to Earthdata using query.earthdata_login()" diff --git a/icepyx/core/query.py b/icepyx/core/query.py index 763ec6c52..74012c037 100644 --- a/icepyx/core/query.py +++ b/icepyx/core/query.py @@ -7,7 +7,6 @@ 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 @@ -462,19 +461,6 @@ def __str__(self): ) return str - @property - def dataset(self): - """ - Legacy property included to provide deprecation warning. - - See Also - -------- - product - """ - DeprecationError( - "In line with most common usage, 'dataset' has been replaced by 'product'.", - ) - @property def product(self): """ diff --git a/icepyx/core/read.py b/icepyx/core/read.py index d71c9c6a0..71f84b810 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -8,7 +8,6 @@ import xarray as xr from icepyx.core.auth import EarthdataAuthMixin -from icepyx.core.exceptions import DeprecationError import icepyx.core.is2ref as is2ref from icepyx.core.variables import Variables as Variables from icepyx.core.variables import list_of_dict_vals @@ -185,22 +184,6 @@ class Read(EarthdataAuthMixin): 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 - **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 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. - **Deprecation warning:** This argument has been deprecated. Please use the data_source argument to pass in valid data. - Returns ------- read object @@ -234,30 +217,10 @@ def __init__( data_source, glob_kwargs={}, out_obj_type=None, # xr.Dataset, - # deprecated arguments - product=None, - filename_pattern=None, - catalog=None, ): # initialize authentication properties EarthdataAuthMixin.__init__(self) - # Raise errors for deprecated arguments - if filename_pattern: - raise DeprecationError( - "The `filename_pattern` argument is deprecated. Instead please provide a " - "string, list, or glob string to the `data_source` argument." - ) - - 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." - ) - self._filelist = _parse_source(data_source, glob_kwargs) # Create a dictionary of the products as read from the metadata diff --git a/icepyx/core/variables.py b/icepyx/core/variables.py index b7b1c56b8..273fc4d32 100644 --- a/icepyx/core/variables.py +++ b/icepyx/core/variables.py @@ -3,7 +3,6 @@ import numpy as np from icepyx.core.auth import EarthdataAuthMixin -from icepyx.core.exceptions import DeprecationError import icepyx.core.is2ref as is2ref import icepyx.core.validate_inputs as val @@ -28,11 +27,6 @@ class Variables(EarthdataAuthMixin): Parameters ---------- - vartype : string - This argument is deprecated. The vartype will be inferred from data_source. - One of ['order', 'file'] to indicate the source of the input variables. - This field will be auto-populated when a variable object is created as an - attribute of a query object. path : string, default None The path to a local Icesat-2 file. The variables list will contain the variables present in this file. Either path or product are required input arguments. @@ -54,7 +48,6 @@ class Variables(EarthdataAuthMixin): def __init__( self, - vartype=None, path=None, product=None, version=None, @@ -62,14 +55,6 @@ def __init__( wanted=None, auth=None, ): - # Deprecation error - if vartype in ["order", "file"]: - raise DeprecationError( - "It is no longer required to specify the variable type `vartype`. Instead please ", - "provide either the path to a local file (arg: `path`) or the product you would ", - "like variables for (arg: `product`).", - ) - if path and product: raise TypeError( "Please provide either a path or a product. If a path is provided ", diff --git a/icepyx/tests/integration/test_auth.py b/icepyx/tests/integration/test_auth.py index 97d40344d..eae8f76f8 100644 --- a/icepyx/tests/integration/test_auth.py +++ b/icepyx/tests/integration/test_auth.py @@ -1,4 +1,3 @@ -import earthaccess import pytest import requests @@ -24,9 +23,3 @@ def test_get_s3login_credentials(auth_instance): assert isinstance(auth_instance.s3login_credentials, dict) expected_keys = {"accessKeyId", "secretAccessKey", "sessionToken", "expiration"} assert set(auth_instance.s3login_credentials.keys()) == expected_keys - - -# Test that earthdata_login generates an auth object -def test_login_function(auth_instance): - assert isinstance(auth_instance.auth, earthaccess.auth.Auth) - assert auth_instance.auth.authenticated diff --git a/icepyx/tests/unit/test_Earthdata.py b/icepyx/tests/unit/test_Earthdata.py index 403159e04..c214f4f94 100644 --- a/icepyx/tests/unit/test_Earthdata.py +++ b/icepyx/tests/unit/test_Earthdata.py @@ -1,5 +1,5 @@ """ -test icepyx.core.query.Query.earthdata_login function +test different Earthdata authentication methods """ import netrc @@ -41,9 +41,9 @@ def test_netrc(username, password): assert earthdata_login(username, password) -def earthdata_login(uid=None, pwd=None, email=None, s3token=False) -> bool: +def earthdata_login(uid=None, pwd=None) -> bool: """ - Mocks the icepyx.core.query.Query.earthdata_login function + Mocks passing credentials in various ways accepted by the `auth.EarthdataAuthMixin` class Parameters ---------- @@ -51,10 +51,6 @@ def earthdata_login(uid=None, pwd=None, email=None, s3token=False) -> bool: Earthdata login user ID pwd : string, default None Earthdata login password - email : string, default None - Deprecated keyword for backwards compatibility. - s3token : boolean, default False - Generate AWS s3 ICESat-2 data access credentials Returns ------- diff --git a/icepyx/tests/unit/test_granules.py b/icepyx/tests/unit/test_granules.py index 90e3374d9..94687e571 100644 --- a/icepyx/tests/unit/test_granules.py +++ b/icepyx/tests/unit/test_granules.py @@ -14,10 +14,6 @@ # #@patch('my_module.__get_input', return_value='y') -# @pytest.fixture -# def session(reg_a): -# return reg_a.earthdata_login(os.getenv('NSIDC_LOGIN')) - # check that agent key is added in event of no subsetting