From 4df2dfb0366d3ae3fcae3e4ab0130b03e46e7e9d Mon Sep 17 00:00:00 2001 From: "Kevin W. Beam" Date: Mon, 13 Jan 2025 18:20:03 -0700 Subject: [PATCH] Apply Ruff formatting --- docs/source/conf.py | 32 ++++++++++++++++---------------- src/nsidc/metgen/metgen.py | 3 +++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 5d4dbd5..9be13c2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -2,34 +2,34 @@ # -- Project information -project = 'MetGenC' -copyright = '2024, NSIDC' -author = 'National Snow and Ice Data Center' +project = "MetGenC" +copyright = "2024, NSIDC" +author = "National Snow and Ice Data Center" -release = '0.6' -version = '0.6.0' +release = "0.6" +version = "0.6.0" # -- General configuration extensions = [ - 'sphinx.ext.duration', - 'sphinx.ext.doctest', - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', + "sphinx.ext.duration", + "sphinx.ext.doctest", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", ] intersphinx_mapping = { - 'python': ('https://docs.python.org/3/', None), - 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), + "python": ("https://docs.python.org/3/", None), + "sphinx": ("https://www.sphinx-doc.org/en/master/", None), } -intersphinx_disabled_domains = ['std'] +intersphinx_disabled_domains = ["std"] -templates_path = ['_templates'] +templates_path = ["_templates"] # -- Options for HTML output -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # -- Options for EPUB output -epub_show_urls = 'footnote' +epub_show_urls = "footnote" diff --git a/src/nsidc/metgen/metgen.py b/src/nsidc/metgen/metgen.py index 1b26369..5cd154a 100644 --- a/src/nsidc/metgen/metgen.py +++ b/src/nsidc/metgen/metgen.py @@ -668,15 +668,18 @@ def cnms_body_template(): def cnms_files_template(): return initialize_template(constants.CNM_FILES_TEMPLATE) + def _open_text(anchor, name): for t in files(anchor).iterdir(): if t.name == name: return t.read_text() return None + def initialize_template(resource_location): return Template(_open_text(*resource_location)) + def validate(configuration, content_type): """ Validate local CNM or UMM-G (JSON) files