diff --git a/act/qc/qc_summary.py b/act/qc/qc_summary.py index d96375abff..97c5f98674 100644 --- a/act/qc/qc_summary.py +++ b/act/qc/qc_summary.py @@ -143,7 +143,7 @@ def create_qc_summary( history_value = ( f"Quality control summary implemented by ACT-{version} at " - f"{datetime.datetime.utcnow().replace(microsecond=0)} UTC" + f"{datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)} UTC" ) if 'history' in list(return_ds.attrs.keys()): diff --git a/act/utils/data_utils.py b/act/utils/data_utils.py index d8c98d10b2..361c1b6568 100644 --- a/act/utils/data_utils.py +++ b/act/utils/data_utils.py @@ -112,9 +112,10 @@ def change_units( self._ds[var_name].attrs = attrs except ( KeyError, + TypeError, pint.errors.DimensionalityError, pint.errors.UndefinedUnitError, - np.core._exceptions.UFuncTypeError, + np._core._exceptions.UFuncTypeError, ): if raise_error: raise ValueError( diff --git a/docs/environment_docs.yml b/docs/environment_docs.yml index dd1089e231..9cbd286142 100644 --- a/docs/environment_docs.yml +++ b/docs/environment_docs.yml @@ -7,36 +7,31 @@ dependencies: - pyproj - numpy - scipy - - matplotlib>=3.5.1 + - matplotlib - netcdf4 - dask - xarray - ipython - notebook - - pint=0.8.1 - skyfield - scikit-posthocs - - pip - - shapely<1.8.3 - moviepy + - cmweather + - metpy + - sphinx-design + - nbsphinx + - arm_pyart + - sphinx<7.2 + - sphinx-gallery + - sphinx-copybutton + - pydata-sphinx-theme + - myst-nb + - nbsphinx + - pip - pip: - mpl2nc - lazy_loader - - metpy>=1.2 - - arm-pyart - - sphinx<7.2 - - sphinx_gallery - - sphinx-copybutton - - pydata-sphinx-theme<0.9.0 - - myst_nb - ablog - - sphinx_design - - nbsphinx - pooch - icartt - - cmweather - - sphinxcontrib-devhelp==1.0.5 - - sphinxcontrib-htmlhelp==2.0.4 - - sphinxcontrib-qthelp==1.0.6 - - sphinxcontrib-serializinghtml==1.1.9 - git+https://github.com/ARM-DOE/arm-test-data.git diff --git a/docs/source/_static/act-theme.css b/docs/source/_static/act-theme.css index 229041c598..2bde6c9f2a 100644 --- a/docs/source/_static/act-theme.css +++ b/docs/source/_static/act-theme.css @@ -3,144 +3,47 @@ font-family: Poppins, sans-serif; } - /* ARM header color */ - .bg-arm { - background-color: #182b55; - } - - :root { - --pst-color-navbar-link: 255, 255, 255; - --pst-color-text-base: 24, 43, 85; - --pst-color-h3: var(--pst-color-text-base); - --pst-color-h4: var(--pst-color-text-base); - --pst-color-h5: var(--pst-color-text-base); - --pst-color-h6: var(--pst-color-text-base); - --pst-color-paragraph: var(--pst-color-text-base); - } - -/* Override the default color set in the original theme for title */ -.navbar-brand>.title { - color: rgba(255, 255, 255) !important; - font-weight: 400 !important; - font-style: bold; +/* Define "ARM Blue" RGB values */ +:root { + --arm-blue-rgb: 18, 65, 117; } - /* Override the default color set in the original theme */ - .navbar-nav>.active>.nav-link { - color: rgba(255, 255, 255) !important; - font-weight: 400 !important; - font-style: italic; - } - - .fa-github-square:before { - color: rgba(255, 255, 255) !important; - font-weight: 400 !important; - } - - .fa-twitter-square:before { - color: rgba(255, 255, 255) !important; - font-weight: 400 !important; - } - - /* Override the default logo height */ - .navbar-brand { - height: 50px; - } - - /* Enhance the links to function docs in the gallery examples */ - div[class^="highlight"] a { - background-color: #EEEEEE; - } - - /* Control the appearance of the version alert banner */ - #banner .alert-version, .alert-news { - margin: 1em; - padding: 0.5em; - font-family: "Work Sans", sans-serif; - font-weight: 600; font-size: 16px; - } - - .intro-card { - background: #d8e5e8; - border: none; - border-radius: 0; - padding: 30px 10px 10px 10px; - margin: 10px 0px; - } - - .intro-card .card-text { - margin: 20px 0px; - } - - .card-button { - background-color: #fafafa; - border: none; - color: #484848; - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 0.9rem; - border-radius: 0.5rem; - max-width: 220px; - padding: 0.5rem 0rem; - margin-top: auto; - } - - .card-button a { - color: #484848; - } - - .card-button p { - margin-top: 0; - margin-bottom: 0rem; - color: #484848; - } - - /* Tweaks to the appearance of the sidebars */ - .bd-sidebar { - flex: 0 0 20%; - border-right: none; - } - - .bd-toc .tocsection { - border-left: none; - } - - .bd-toc .section-nav { - border-left: none; - } - - /* Can remove once theme releases new version */ - /* xarray output display in bootstrap */ - .xr-wrap[hidden] { - display: block !important; + /* ARM header color */ + .bg-header { + background: rgb(var(--arm-blue-rgb)) } - .xr-var-data pre { - border: none; - box-shadow: none; - } + .theme-switch-button { + border-color: rgb(var(--arm-blue-rgb)) !important; +} +.bd-header .navbar-nav>.nav-item>.nav-link, +.bd-header .dropdown-toggle, - /* Styling the API Changes Table */ - .api-table tr:nth-child(3n + 1){ - background: #EEF5F5; - } + .navbar-nav .dropdown-menu { + background-color: var(--pst-color-background); +} - .api-table tr:nth-child(3n + 2){ - opacity: 0.65; - } +/* Increase contrast of links in code snippets */ +div[class^="highlight"] a { + background-color: rgb(var(--arm-blue-rgb), 0.2); + color: var(--pst-color-text-muted); +} - code.literal:not(.xref) span.pre { - color: #000; - } +/* Control the appearance of the version alert banner */ +#banner .alert-version, .alert-news { + margin: 1em; + padding: 0.5em; + font-family: "Work Sans", sans-serif; + font-weight: 600; font-size: 16px; +} - .api-table tr:nth-child(3n + 2)>td span:first-child::before{ - content: url(old.png); - zoom: 0.25; - } +/* Tweaks to the appearance of the sidebars */ +.bd-sidebar { + flex: 0 0 20%; + border-right: none; +} - .api-table tr:nth-child(3n + 3)>td span:first-child::before{ - content: url(new.png); - zoom: 0.21; - } +.bd-sidebar-secondary div { + border-left: none; +} diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html index a5e99e6b02..adb4e32d52 100644 --- a/docs/source/_templates/layout.html +++ b/docs/source/_templates/layout.html @@ -1,17 +1,7 @@ -{% extends "!layout.html" %} +{% extends "pydata_sphinx_theme/layout.html" %} {% block fonts %} - {{ super() }} -{% endblock %} - -{% block docs_navbar %} - - -{# Added to support a banner with an alert #} -
{% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py index d04bc24fb6..c27f0bab3a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,6 +63,7 @@ autoclass_content = 'both' autosummary_generate = True autosummary_imported_members = True +autodoc_typehints = "description" # Otherwise, the Return parameter list looks different from the Parameter list napoleon_use_rtype = False @@ -84,7 +85,7 @@ # General information about the project. project = 'Atmospheric data Community Toolkit' -copyright = '2018-2022, ACT Developers' +copyright = '2018-2024, ACT Developers' author = 'ACT Developers' # The version info for the project you're documenting, acts as replacement for diff --git a/examples/io/plot_raw_minimpl.py b/examples/io/read_raw_minimpl.py similarity index 100% rename from examples/io/plot_raw_minimpl.py rename to examples/io/read_raw_minimpl.py diff --git a/examples/qc/plot_qc_example.py b/examples/qc/plot_qc_example.py index 69513083c5..10f639558e 100644 --- a/examples/qc/plot_qc_example.py +++ b/examples/qc/plot_qc_example.py @@ -79,7 +79,7 @@ diff = np.diff(data) max_difference = 0.04 data = np.ma.masked_greater(diff, max_difference) -index = np.where(data.mask is True)[0] +index = np.where(data.mask)[0] result = ds.qcfilter.add_test( var_name, index=index,