Replies: 1 comment 10 replies
|
@forsyth2: Thanks, Ryan, for laying out these options. I agree that option 3 makes the most sense, and option 4 seems unnecessarily complicated unless users have a broader need to select the pcmdi_metrics version through zppy. If feasible, could we make option 3 even more controlled by running the reference and candidate versions of zppy/zppy-interfaces using the same base environment definition? Ideally, we would create or clone two environments from the same resolved YAML or lock file and vary only the versions of zppy and zppy-interfaces being tested. This would intentionally eliminate the possibility that observed differences are caused by changes in pcmdi_metrics, matplotlib, or other dependency libraries. Using the same YAML file would help, although cloning the same resolved environment or using a lock file would provide a stronger guarantee because solving the YAML at different times could still produce different dependency versions. For the current diffs, perhaps we could:
We could still test periodically against the latest Unified environment or a newer pcmdi_metrics release to identify upstream compatibility issues, but that could be separate from the controlled regression test used to evaluate zppy and zppy-interfaces changes. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@zhangshixuan1987 @chengzhuzhang I'm trying to figure out the best way to test
pcmdi_diagsinzppy. These are my thoughts based on the email thread related to #845 (reply in thread):zppyusually handles testing code changes in underlying packages by specifying which dev environment to use via theenvironment_commandsparameter. Through that mechanism we can use a precise version ofe3sm_to_cmip,e3sm_diags,mpas_analysis,zppy-interfaces(forglobal_time_seriesandpcmdi_diags). Changing the NCO version (forclimoandts) is a little trickier, involving a separate parameternco_path. And then some packages (ilamb,livvkit) we just have to rely on whatever the latest released version is, because it's an independent package not maintained by the project and/or there hasn't yet been a need to use a different version.Notice the usual trend is that a
zppytask calls a Python package. Now, these packages can and do rely on third-party libraries/packages, but the core work we're interested in for integration testing is done in those packages. However,zppy-interfaces'spcmdi_diagsfunctionality is actually an intermediary element betweenzppyandpcmdi_metrics. This design was chosen because wrappingpcmdi_metricsdirectly fromzppywas deemed overly complex (a decision I still think was right, consideringpcmdi_diagshas a very large/complex codebase). What this means though is that when we test a dev environment, we're testing a dev environment for this intermediary element (zppy-interfaces'spcmdi_diags), not a dev environment for the latestpcmdi_metricspackage itself.This now leads us to several options for improving testing of
pcmdi_diags, given below, from easiest to most difficult to implement:pcmdi_metricsas if it were just any other third-party package we use.pcmdi_metricsupdates and new diffs appear, I'd' update the expected results again.pcmdi_metricsspecial. That is, if we notice bugs in it, don't discount them.pcmdi_metricsversion to be released, and then re-run the test, and assuming any new diffs that run produces are acceptable, I'd update the expected results to match those. That is, this differs from option 1 because the expected results don't get updated untilpcmdi_metricsis fixed.pcmdi_metricsis in a similar situation -- we use it, but we're not the maintainer (PCMDI is, not E3SM). It would follow that we should pinpcmdi_metricsto a specific version insidezppy-interfacesdev environment. It's currently pinned only aspcmdi_metrics>=3.9.3. That way changes that appear in testing are going to be solely because of changes inzppy-interfaces'spcmdi_diags, not the PCMDI-maintainedpcmdi_metricspackage. (This still isn't completely true, because there's still variation in the version of third-party libraries likematplotlib. For example, if the diffs we're seeing are bugs in howpcmdi_metricsinteracts withmatplotlib, then this option would avoid showing us bugs outside our control. If however, thematplotlibversion changes how plots look independently ofpcmdi_metrics's version, the diffs would still show up).zppy-interfacesdev environment with the pinnedpcmdi_metrics(v4.0.4), and assuming any new diffs that run produces are acceptable, I'd update the expected results to match those.environment_commandscalled something likepcmdi_metrics_versionand then we build intozppy/templates/pcmdi_diags.basha line to specifically install a specificpcmdi_metricsversion after running the regularenvironmnet_commands.pcmdi_metricsat Unified's version (v4.0.4), and assuming any new diffs that run produces are acceptable, I'd update the expected results to match those.I think option 3 (pin
pcmdi_metricsinzppy-interfaces's dev environment) makes the most sense, but please let me know what you think. I think option 4 (adding a new parameter) is probably too complicated.For context, keeping the expected results up-to-date (by updating them often) is very important. If too many code changes go in between expected results updates it can be hard to tell which diffs are causing problems. For example, right now
global_time_serieshas a large number of diffs because the plots are all slightly shifted (presumably due tomatplotlibversion used). That means it's difficult for me to tell if new PRs (like E3SM-Project/zppy-interfaces#53) are causing diffs themselves.All reactions