Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log compression bug when no logs specified #542

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

blimlim
Copy link
Contributor

@blimlim blimlim commented Dec 16, 2024

This PR closes #541.

Regex patterns for finding log files previously broke when no log files were specified, as done for CICE5. Instead of matching no files, the get_log_files() method would match every file in the model work directory.

This PR adds checks at the start of the get_log_files() and compress_log_files() methods, causing them to exit early when no log files are specified, and when no log files are found.

It also adds a unit test test_log_compression_no_logs() to test_cice.py which makes sure that the compression method does nothing when no log files are specified.

With these changes, OM2 runs without any issues.

@coveralls
Copy link

Coverage Status

coverage: 59.003% (+0.2%) from 58.788%
when pulling cdfd675 on ACCESS-NRI:541-no-log-compression-bug
into 0c2a837 on payu-org:master.

@blimlim blimlim requested a review from anton-seaice December 16, 2024 03:14
Copy link
Contributor

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

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

The update version runs OM2 successfully - I didn't test with esm1.5.

You can set

       self.logs_to_compress = [r"ice.log.task_[0-9]{4}"]
       self.log_tar_name = "ice.logfiles.tar.gz"

for cice5 if you'd like, but no particular need to.

@blimlim
Copy link
Contributor Author

blimlim commented Dec 17, 2024

Thanks for the review @anton-seaice! I'll leave out the CICE5 log files for now, but we can always add them in later if they do cause issue. I've just done an extra test with ESM1.5 and everything's working there

@blimlim blimlim merged commit 20a8e76 into payu-org:master Dec 17, 2024
8 checks passed
@blimlim blimlim deleted the 541-no-log-compression-bug branch December 17, 2024 00:06
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.

Allow for no log files to be compressed
3 participants