Skip to content

Putting fre catalog docstrings into plain sentences - #905

Open
Ciheim wants to merge 6 commits into
NOAA-GFDL:mainfrom
Ciheim:main
Open

Putting fre catalog docstrings into plain sentences#905
Ciheim wants to merge 6 commits into
NOAA-GFDL:mainfrom
Ciheim:main

Conversation

@Ciheim

@Ciheim Ciheim commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Issue ticket number and link (if applicable)

Fixes #XXX (replace XXX with the issue number and GitHub will autolink the PR to the issue)

Checklist before requesting a review

  • I ran my code
  • I tried to make my code readable
  • I tried to comment my code
  • I wrote a new test, if applicable
  • I wrote new instructions/documentation, if applicable
  • I ran pytest and inspected it's output
  • I ran pylint and attempted to implement some of it's feedback
  • No print statements; all user-facing info uses logging module

Note: If you are a code maintainer updating the tag or releasing a new fre-cli version, please use the release_procedure.md template. To quickly use this template, open a new pull request, choose your branch, and add ?template=release_procedure.md to the end of the url.

@Ciheim Ciheim self-assigned this Jun 3, 2026
Comment thread fre/catalog/frecatalog.py Outdated
@click.group(help=click.style(" - catalog subcommands", fg=(64,94,213)))
def catalog_cli():
''' entry point for click into fre catalog cli calls '''
"""This command group exposes the ``fre catalog`` subcommands."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this -> catalog_cli?

Comment thread fre/catalog/frecatalog.py Outdated
'''
entry point for fre catalog subcommands
'''
"""This module defines the ``fre catalog`` CLI commands."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the definition of a catalog and more detailed descriptions of the click options be coming soon? 😁

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.09%. Comparing base (3c5a980) to head (88f2294).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #905   +/-   ##
=======================================
  Coverage   82.09%   82.09%           
=======================================
  Files          67       67           
  Lines        3736     3736           
=======================================
  Hits         3067     3067           
  Misses        669      669           
Flag Coverage Δ
unittests 82.09% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
fre/catalog/frecatalog.py 94.44% <100.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c5a980...88f2294. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread fre/catalog/frecatalog.py
'''
entry point for fre catalog subcommands
'''
""" This module defines the ``fre catalog`` CLI commands.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frecatalog defines the fre catalog Click subcommands to catalog a dataset of climate output data into CSV and JSON files.

Comment thread fre/catalog/frecatalog.py
It builds catalog CSV and JSON files that form a structured index of datasets and
their metadata, allowing analysis tools to discover, query, and load data consistently.

These data catalogs enable data discoverability regardless of the underlying data format

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discoverability is a nice word but I think it's encapsulated in the previous sentence. Not sure if this sentences is needed.

Comment thread fre/catalog/frecatalog.py
These data catalogs enable data discoverability regardless of the underlying data format
(e.g., NetCDF, Zarr). The cataloging ecosystem is composed of three main components:

1. Catalog Specification (JSON): A single file that provides overarching metadata about

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A single file that provides overarching --> a global file that contains overarching

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably because I have zero knowledge about fre catalog, but not sure what overarching metadata is.. and what extensible metadata is..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exact language used for the official tool documentation. I'll probably keep this part as it.

Comment thread fre/catalog/frecatalog.py
1. Catalog Specification (JSON): A single file that provides overarching metadata about
the catalog. It supports extensible metadata and identifies how multiple distinct
files can be aggregated into a single cohesive "dataset."
2. Catalog (CSV): A file that acts as the index for the data collection, providing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A file that acts as the index --> Index file for the data collection. Includes paths to the data files

Is this clause "and their associated metadata at a user-defined granularity" needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take the suggestion. As for your question, I'd say yes.

Comment thread fre/catalog/frecatalog.py
files can be aggregated into a single cohesive "dataset."
2. Catalog (CSV): A file that acts as the index for the data collection, providing
the paths to the data files and their associated metadata at a user-defined granularity.
3. Intake-ESM API: Provides a Pythonic interface to query the catalog's contents and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provides APIs to query the catalog and automatically load..

Comment thread fre/catalog/frecatalog.py
their metadata, allowing analysis tools to discover, query, and load data consistently.

These data catalogs enable data discoverability regardless of the underlying data format
(e.g., NetCDF, Zarr). The cataloging ecosystem is composed of three main components:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cataloging ecosystem relies on Intake-ESM APIs to query the JSON and CSV catalog files:

Comment thread fre/catalog/frecatalog.py
@click.option('--append', is_flag = True, default = False)
@click.option('--verbose', is_flag = True, default = False, help = "Enables verbose mode (Prints additional diagnostic information during catalog generation)")
@click.option('--overwrite', is_flag = True, default = False, help = "Overwrite existing catalog output files if they already exist")
@click.option('--append', is_flag = True, default = False, help = "Append to existing catalog output files")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output JSON? CSV? files

Comment thread fre/catalog/frecatalog.py
append = False, slow = False, strict = False):
# pylint: disable=unused-argument
""" - Generate .csv and .json files for catalog """
"""Build catalog CSV and JSON files from the provided input data."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the files in input_path?

Comment thread fre/catalog/frecatalog.py
def validate(context, json_path, json_template_path, vocab, proper_generation, test_failure):
# pylint: disable=unused-argument
""" - Validate catalogs against controlled vocabulary as provided by particular JSON schemas
"""Validate catalogs against controlled vocabulary as provided by particular JSON schemas

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validate JSON catalog in json_path against controlled vocabulary in the JSON schemas in json_template_path

Comment thread fre/catalog/frecatalog.py
@click.pass_context
def merge(context, input, output):
""" - Merge two or more more catalogs into one """
"""Merge two or more catalogs into one catalog file."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants