Skip to content

Fremake documentation updates to create_checkout and scripts within gfdlfremake#761

Open
meteorologist15 wants to merge 7 commits intoNOAA-GFDL:mainfrom
meteorologist15:makedoc_updates
Open

Fremake documentation updates to create_checkout and scripts within gfdlfremake#761
meteorologist15 wants to merge 7 commits intoNOAA-GFDL:mainfrom
meteorologist15:makedoc_updates

Conversation

@meteorologist15
Copy link

@meteorologist15 meteorologist15 commented Feb 26, 2026

Describe your changes

Additional documentation made to create_checkout_script.py, the tests subdirectory, and the gfdlfremake subdirectory within 'make'

Issue ticket number and link (if applicable)

n/a

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

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 90.56604% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.07%. Comparing base (ad432b1) to head (6bb9373).

Files with missing lines Patch % Lines
fre/make/create_checkout_script.py 90.56% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #761      +/-   ##
==========================================
- Coverage   84.08%   84.07%   -0.02%     
==========================================
  Files          70       70              
  Lines        4775     4771       -4     
==========================================
- Hits         4015     4011       -4     
  Misses        760      760              
Flag Coverage Δ
unittests 84.07% <90.56%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
fre/make/create_checkout_script.py 87.83% <90.56%> (-0.63%) ⬇️

Continue to review full report in Codecov by Sentry.

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

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

@meteorologist15 meteorologist15 changed the title Fremake documentation updates to create_checkout plus tests Fremake documentation updates to create_checkout and scripts within gfdlfremake Mar 3, 2026
@meteorologist15 meteorologist15 marked this pull request as ready for review March 3, 2026 17:19
Comment on lines +4 to +5
This script automates the creation of 'checkout.sh' scripts used to clone and manage
source code for climate model builds within the FRE (FMS Runtime Environment) ecosystem.
Copy link
Contributor

@singhd789 singhd789 Mar 3, 2026

Choose a reason for hiding this comment

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

Translates (or parses) information the resolved yaml configuration to generate a checkout.sh script that git clones the model source code.

4. Execution & Lifecycle: Optionally executes the generated script immediately and
handles forced re-creation of existing checkout scripts.
5. Directory Management: Automatically sets up appropriate source and temporary
directory structures based on the target platform configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 7-16 could potentially go into this tool file: https://github.com/NOAA-GFDL/fre-cli/blob/main/docs/tools/make.rst

import subprocess
import logging
from typing import Optional
from typing import Optional, List, Union
Copy link
Contributor

Choose a reason for hiding this comment

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

use list instead of List for type hinting.
Use "|" instead of Union

"""
Write the checkout script for a bare-metal build environment.

This function initializes a checkout object, writes the necessary shell
Copy link
Contributor

Choose a reason for hiding this comment

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

We previously discussed having this: "This function extracts information from resolved/loaded yaml configuration and generates a checkout script to the source directory for the bare-metal build."

But I think the function below is the main function to extract a lot of info. So here, I agree with "This function generates a checkout script in the source directory for a bare-metal build."

commands to clone repositories into the source directory, and sets
appropriate file permissions.

:param model_yaml: Validated FRE YAML object containing compilation metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

Got ahead of myself before in our meeting. Yes, this is an object that is passed to this function. Maybe we can word it something like: :param model_yaml: FRE YAML class object containing parsed and validated yaml dictionary compilation information

:type model_yaml: yamlfre.freyaml
:param src_dir: Path to the directory where source code will be checked out
:type src_dir: str
:param jobs: Number of parallel jobs for git submodules (as a string)
Copy link
Contributor

Choose a reason for hiding this comment

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

look at Lauren's fre make doc PR for jobs

Comment on lines +100 to +101
:param target: Predefined FRE target(s); options include [prod/debug/repro]-openmp
:type target: str or list
Copy link
Contributor

Choose a reason for hiding this comment

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

similar comment to platforms with str or list

:param njobs: Used in the recursive clone; number of submodules to fetch simultaneously (default 4)
:type njobs: int
:param execute: Run the created checkout script to check out source code
:param execute: Run the created checkout script to check out source code immediately
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like you don't need "immediately"


.. note:: For a bare-metal build, no_parallel_checkout = True
For a container build, no_parallel_checkout = False
.. note:: For a bare-metal build, no_parallel_checkout typically defaults to True
Copy link
Contributor

Choose a reason for hiding this comment

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

For a bare-metal build - the parallel checkout is the default

Non-parallel checkout is the default for container builds

## Error checking the targets
for target_name in tlist:
# Validate the targets
targets_list = [target] if isinstance(target, str) else target
Copy link
Contributor

Choose a reason for hiding this comment

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

From my comment about multiple platforms and targets that can be passed above, I don't think this is necessary since if multiple targets are passed via click options, they're read as a tuple ('platform1', 'platform2')

pass
else:
raise ValueError (f"{platform_name} does not exist in platforms.yaml")
platforms_list = [platform] if isinstance(platform, str) else platform
Copy link
Contributor

Choose a reason for hiding this comment

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

similar comment to target list bit on line 146

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.

2 participants