Skip to content

fre pp rename-split#717

Open
ceblanton wants to merge 21 commits intomainfrom
rename-split
Open

fre pp rename-split#717
ceblanton wants to merge 21 commits intomainfrom
rename-split

Conversation

@ceblanton
Copy link
Contributor

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 87.03704% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.16%. Comparing base (b34af59) to head (e252343).
⚠️ Report is 77 commits behind head on main.

Files with missing lines Patch % Lines
fre/pp/rename_split_script.py 86.92% 20 Missing ⚠️
fre/pp/frepp.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #717      +/-   ##
==========================================
+ Coverage   82.76%   84.16%   +1.40%     
==========================================
  Files          68       71       +3     
  Lines        4525     4933     +408     
==========================================
+ Hits         3745     4152     +407     
- Misses        780      781       +1     
Flag Coverage Δ
unittests 84.16% <87.03%> (+1.40%) ⬆️

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.66% <88.88%> (+0.18%) ⬆️
fre/pp/rename_split_script.py 86.92% <86.92%> (ø)

... and 12 files with indirect coverage changes


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...e252343. 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

@ceblanton ceblanton marked this pull request as ready for review February 18, 2026 14:54
Chris Blanton added 3 commits February 24, 2026 16:54
This is needed for input files with one timestep and no time bounds.
- Proper docstrings
- Module import cleanup
- Indent cleanup
- Other: remove unneeded environment variables
Comment on lines +18 to +20
from os import path as osp
import pprint
from pathlib import Path
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between os.path and pathlib? Are they both needed or can you just use pathlib?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sure we could use pathlib only, you're right. I'll adjust.

from . import status_script
from . import wrapper_script
from . import split_netcdf_script
from . import rename_split_script
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big thing, just curious (had the same question about split netcdf at one point) - Should this subtool go in fre/app? Just asking because I think that's how we started regrid and remap rewrites (putting them in fre/app vs fre/pp). I mean if it makes more sense being here, all good.

Maybe we should distinguish between fre/app and fre/pp subtools a bit better. In my head they're a teeny bit jumbled for the rewrites

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completely jumbled, I agree. Some of the fre pp stuff that didn't fit well will go to your fre workflow tools at least.

Comment on lines +18 to +20
"""
Accept two dates and returns frequency string in ISO8601 and associated format string.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to add in the in line doc:

:param date1: ...
:type date1: ...
...
:return: ...
:rtype: ...


def get_duration_from_two_dates(date1: cftime.datetime, date2: cftime.datetime) -> str:
"""
Accept two dates and output duration in ISO8601.
Copy link
Contributor

Choose a reason for hiding this comment

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

same documentation comment

Copy link
Contributor

Choose a reason for hiding this comment

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

also including any errors raised if I remember correctly

Copy link
Contributor

Choose a reason for hiding this comment

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

this doc comment applies throughout the file

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.

4 participants