Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • SUNSET SUNSET
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 43
    • Issues 43
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • SUNSETSUNSET
  • Merge requests
  • !93

Units module bugfix for no fcst case

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged aho requested to merge dev-Units_no_fcst into master Sep 27, 2023
  • Overview 4
  • Commits 4
  • Pipelines 0
  • Changes 1

Hi @vagudets @allabres

This is the bugfix for Units module when fcst is not provided (#57 (comment 233553)). I tested it with this recipe https://earth.bsc.es/gitlab/es/sunset/-/blob/master/recipes/atomic_recipes/recipe_test_multivar.yml, with fcst_year being changed to empty.

The way I chose to fix the bug is to make orig_units have hcst, fcst, obs all the time, even when fcst is NULL. I only one doubt: this line has a comment "when fcst is NULL" and it changes the units to the user_units if orig_units doesn't exist (i.e., when fcst is NULL). In my fix, this line is not needed because the NULL data don't need any changes. But I don't know if I miss some possibilities here.

I also corrected the warning, which printed repetitive sentences for each dataset. I guess all the dataset names should be collapsed into one string.

# Used to be:
WARN  [2023-09-27 18:12:31] The units in hcst are not all equal. If this is not expected, please contact the ES data team.The units in fcst are not all equal. If this is not expected, please contact the ES data team.The units in obs are not all equal. If this is not expected, please contact the ES data team.

# Now:
WARN  [2023-09-27 18:12:31] The units in hcst, fcst, obs are not all equal. If this is not expected, please contact the ES data team.The units in fcst are not all equal.

Let me know if there is anything to be improved further.

Cheers,
An-Chi

Edited Sep 27, 2023 by aho
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: dev-Units_no_fcst