Skip to content

Add paths to logit decorator#66

Merged
aerorahul merged 6 commits intoNOAA-EMC:developfrom
DavidHuber-NOAA:feature/logit_fname
Jan 30, 2026
Merged

Add paths to logit decorator#66
aerorahul merged 6 commits intoNOAA-EMC:developfrom
DavidHuber-NOAA:feature/logit_fname

Conversation

@DavidHuber-NOAA
Copy link
Contributor

Description
This adds a new feature to log the full path to a called function's file name.

Refs NOAA-EMC/global-workflow#4493
Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I added a new pytest that ensures that logging includes the full filename.

  • pynorms
  • pytests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass with my changes

@DavidHuber-NOAA
Copy link
Contributor Author

Hmm, this worked locally. I will try and rework the test.

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.56%. Comparing base (88c576d) to head (c2daa31).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #66      +/-   ##
===========================================
+ Coverage    60.44%   60.56%   +0.12%     
===========================================
  Files           24       24              
  Lines         1972     1973       +1     
  Branches       370      370              
===========================================
+ Hits          1192     1195       +3     
+ Misses         725      721       -4     
- Partials        55       57       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@DavidHuber-NOAA
Copy link
Contributor Author

I'll test this in the global workflow as well.

Copy link
Collaborator

@CoryMartin-NOAA CoryMartin-NOAA left a comment

Choose a reason for hiding this comment

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

Looks good, approve pending successful test

@DavidHuber-NOAA
Copy link
Contributor Author

Tested in the global workflow for a C48_ATM case and noted the following lines during the execution of gfs_arch_tar_gfsa:

+ JGLOBAL_ARCHIVE_TARS[86]/scratch3/NCEPDEV/global/David.Huber/GW/gw_logit_fname/scripts/exglobal_archive_tars.py
^[[38;21m2026-01-30 15:10:16,882 - INFO     - root        : BEGIN: __main__.main: /scratch3/NCEPDEV/global/David.Huber/GW/gw_logit_fname/scripts/exglobal_archive_tars.py^[[0m
^[[38;5;39m2026-01-30 15:10:16,882 - DEBUG    - root        : (  )^[[0m
^[[38;21m2026-01-30 15:10:16,887 - INFO     - archive     : BEGIN: Archive.__init__: /scratch3/NCEPDEV/global/David.Huber/GW/gw_logit_fname/ush/python/pygfs/task/archive.py^[[0m
...
^[[38;21m2026-01-30 15:10:16,892 - INFO     - archive_tar_vars: BEGIN: pygfs.utils.archive_tar_vars._get_all_cyc_vars: /scratch3/NCEPDEV/global/David.Huber/GW/gw_logit_fname/ush/python/pygfs/utils/archive_tar_vars.py^[[0m

Full paths are written each time a function is called that has a logit decorator. The C48_ATM case ran to completion. Altogether there were 21 such decorations made to the log file showing that the use is likely not overly impactful on runtime. All arch_tar* jobs (5 in total) ran in less than 40 seconds.

The gfs_stage_ic job also showed these decorations and executed in 13 seconds.

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

lgtm

@aerorahul aerorahul merged commit e952a8a into NOAA-EMC:develop Jan 30, 2026
10 checks passed
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