Skip to content

Conversation

@ceblanton
Copy link
Collaborator

Describe your changes

Conversion of fre-workflows rename-split shell script into fre-cli python. Preserved existing rename-split test cases.

Issue ticket number and link (if applicable)

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 3, 2026

Codecov Report

❌ Patch coverage is 89.23077% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.94%. Comparing base (b34af59) to head (ab3ba21).

Files with missing lines Patch % Lines
fre/pp/rename_split_script.py 89.34% 13 Missing ⚠️
fre/pp/frepp.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #717      +/-   ##
==========================================
+ Coverage   82.76%   82.94%   +0.18%     
==========================================
  Files          68       69       +1     
  Lines        4525     4655     +130     
==========================================
+ Hits         3745     3861     +116     
- Misses        780      794      +14     
Flag Coverage Δ
unittests 82.94% <89.23%> (+0.18%) ⬆️

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

Files with missing lines Coverage Δ
fre/pp/frepp.py 86.55% <87.50%> (+0.06%) ⬆️
fre/pp/rename_split_script.py 89.34% <89.34%> (ø)

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 b34af59...ab3ba21. Read the comment docs.

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

@ilaflott ilaflott self-requested a review February 4, 2026 15:10
nc_exists = [osp.isfile(el) for el in nc_files]
assert all(nc_exists)

def test_rename_split_to_pp_multiply():
Copy link
Member

Choose a reason for hiding this comment

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

this is a setup function too

@ilaflott
Copy link
Member

ilaflott commented Feb 4, 2026

@copilot open a PR to this branch and:

  • try reducing the cdl files to a minimal set of required data points
  • the unit tests must succeed
  • try with just the atmos_daily case(s) first

Copy link
Contributor

Copilot AI commented Feb 4, 2026

@ilaflott I've opened a new pull request, #719, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 6 commits February 4, 2026 16:36
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
reduce `rename-split` test-data to minimal possible size
Copy link
Member

@ilaflott ilaflott left a comment

Choose a reason for hiding this comment

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

a bunch of this is nit picking about style, this looks largely functional. i'll ponder approving when it's taken out of draft

Comment on lines +1 to +3
#tests rename_split_to_pp with a minimal python wrapper
#test cases: regrid/native, static/ts
#fail test cases: no files in your input directory/subdirs; input files are not named according to our very specific naming conventions
Copy link
Member

Choose a reason for hiding this comment

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

lets make this a proper docstring

Comment on lines +6 to +7
#https://stackoverflow.com/questions/67631/how-can-i-import-a-module-dynamically-given-the-full-path
#/archive/cew/CMIP7/ESM4/DEV/ESM4.5_staticfix/ppan-prod-openmp/history/00010101.nc.tar
Copy link
Member

Choose a reason for hiding this comment

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

can remove i think

import pprint
from pathlib import Path
import cftime
from fre.pp.rename_split_script import *
Copy link
Member

Choose a reason for hiding this comment

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

generally disfavor wildcard imports, if possible.

Copy link
Member

Choose a reason for hiding this comment

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

general spacing consistency- two spaces or four? the rest of the repo uses 4

Comment on lines +9 to +18
import pytest
import sys
import os
from os import path as osp
import subprocess
import re
import pprint
from pathlib import Path
import cftime
from fre.pp.rename_split_script import *
Copy link
Member

Choose a reason for hiding this comment

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

generally, import stdlib modules first, third-party second, then internal dependencies last. some additionally sort by alphabetical order but this is more matter of taste imo

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