Add task to publish comparison test results#702
Conversation
…a.gov:/home/manstett/swell-main into feature/mranst/eva_comparison_obs
…a.gov:/home/manstett/swell-main into feature/mranst/eva_comparison_obs
…a.gov:/home/manstett/swell-main into feature/mranst/eva_comparison_obs
…publish_comparisons
shiklomanov-an
left a comment
There was a problem hiding this comment.
Looks good!
Minor comment: Definitely not a required change for this PR, but take a look at Python's built-in pathlib module. It has a lot of quality-of-life improvements for working with system paths. For example, with this:
from pathlib import Path...you can write this line as something like:
cycle_dir = Path(self.cycle_dir())
publish_location = Path(self.config.publish_directory())
if cycle_dir.is_dir():
files = cycle_dir.glob("eva/**/*.png")
out_path = publish_directory / self.__datetime__.string_directory() / self.get_model()
out_path.mkdir(parents = True, exist_ok = True)The other potential advantage of using pathlib.Path in more places is that it improves our ability to type-check places that need paths. Right now, we use str annotations for this, but pathlib.Path would be stricter (and therefore help catch more bugs earlier).
shiklomanov-an
left a comment
There was a problem hiding this comment.
Minor suggestion on consistent usage of pathlib. Then, resolve merge conflicts, pass tests, and I think this is good to go.
shiklomanov-an
left a comment
There was a problem hiding this comment.
I would also replace the shutil.copy calls with pathlib.Path.copy, unless there's a good reason not to. But otherwise, I think this looks good, assuming relevant tests pass.
|
Thanks! Path.copy is python >3.14, I'll keep that in mind for the future |
Description
This PR adds a task that will copy relevant text files (namely
jedi_log_comparison.txt) and plots generated by comparison suites to another location. This is intended to be used by the CI tests to publish these results to Dataportal. By default, nopublish_directoryis set, so this task will not do anything unless it is overridden (It also will not be run unless the comparison fails). A pending PR toCI-workflowswill enable this feature for tier 2 tests.