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

Published recipes use deprecated fx_variables option in preprocessors #3056

Closed
20 tasks done
schlunma opened this issue Feb 27, 2023 · 20 comments
Closed
20 tasks done

Published recipes use deprecated fx_variables option in preprocessors #3056

schlunma opened this issue Feb 27, 2023 · 20 comments

Comments

@schlunma
Copy link
Contributor

schlunma commented Feb 27, 2023

Due to recent changes in ESMValCore (ESMValGroup/ESMValCore#1609 and co.) we need to adapt some recipes because the usage of the option fx_variables in preprocessors is deprecated.

These can be fixed by replacing fx_variables with supplementary_variables as described here.

@schlunma schlunma added the requires new ESMValCore release A new release of ESMValCore is needed to solve this issue/merge this pull request.. label Feb 27, 2023
@schlunma schlunma added this to the v2.8.0 milestone Feb 27, 2023
@schlunma
Copy link
Contributor Author

@ESMValGroup/esmvaltool-coreteam Feel free to update this list if you encounter more recipes that need updates.

@bouweandela
Copy link
Member

bouweandela commented Feb 27, 2023

The dataset name and version number needs to be updated for recipes using obs4MIPs datasets: #2974

@valeriupredoi
Copy link
Contributor

the issue with collins and sftgif should not be an issue - mask_landseaice doesn't explicitly need an fx/supplementary variable - it should automatically look for sftgif and the mocker recipe_load test that fails and @schlunma links should just spit a warning, not an outright error

@schlunma
Copy link
Contributor Author

Yeah, I will remove them again from the list and only add recipes where we confirmed that they stopped working. I thought we can trust that automated test 🥲

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Feb 28, 2023

the test can be trusted (if you talking about the GA test) - the reasons it fails are all upon us 😆 Do you want to try and run those collins et al recipes - like actual runs, as you suggested, Manu? Using a Core-dev env just like the test, but where data is available, if they pass it means it's some mocking issue like we've had before, if they fail then it's some Bouweing issue like we've had before 👿

@schlunma
Copy link
Contributor Author

We will test the recipes soon anyway, so I'll wait until that (don't want to waste resources on these huge recipes 😄 )

@valeriupredoi
Copy link
Contributor

We will test the recipes soon anyway, so I'll wait until that (don't want to waste resources on these huge recipes smile )

such an Ursula von der Leyen-like answer 🥇

@remi-kazeroni
Copy link
Contributor

We will test the recipes soon anyway, so I'll wait until that (don't want to waste resources on these huge recipes 😄 )

Indeed, this is probably our most resource-intensive recipe and only runs on 512GB nodes at DKRZ... See https://esmvaltool.dkrz.de/shared/esmvaltool/v2.7.0/debug.html

@schlunma schlunma changed the title Recipe updates necessary for v2.8 Published recipes use deprecated fx_variables option in preprocessors Mar 13, 2023
@schlunma
Copy link
Contributor Author

Partly addressed by #3064

@valeriupredoi
Copy link
Contributor

well Collins13 is fixed now - I mean, it's still a memory guzzler, but at least Manu and Remi ran it - any more of those recipes need fixing?

@remi-kazeroni
Copy link
Contributor

All the recipes not yet updated will continue to run fine with v2.8. fx_variables was set to deprecation in ESMValGroup/ESMValCore#1609 but we discussed there already that is still supported in v2.8. Nevertheless, it would be better, if possible, to remove it from our recipes so that we don't show "bad" examples. At the latest, this will have to be finished before v2.9. I'm sure the maintainer of examples/recipe_python.yml would take care of that one next Monday, right @schlunma? 😉

@schlunma
Copy link
Contributor Author

schlunma commented Mar 20, 2023

I'm sure the maintainer of examples/recipe_python.yml would take care of that one next Monday, right @schlunma? wink

Done in #3116. I can't remember how/when I got maintainer of examples/recipe_python.yml 😅

@remi-kazeroni remi-kazeroni modified the milestones: v2.8.0, v2.9.0 Mar 21, 2023
@remi-kazeroni remi-kazeroni added diagnostic deprecated feature and removed requires new ESMValCore release A new release of ESMValCore is needed to solve this issue/merge this pull request.. labels Mar 21, 2023
@remi-kazeroni
Copy link
Contributor

Thanks to everyone who contributed to this effort already! I bumped this issue to the next milestone because we need to move on with the final recipe testing in v2.8 release. The remaining few recipes would need to be updated before the v2.9 release.

@bouweandela
Copy link
Member

Friendly ping @katjaweigel and @debe-kevin. Could you have a look at the recipes that you are maintaining and remove all mentions of fx_variables?

@katjaweigel
Copy link
Contributor

@bouweandela thanks for the ping! I didn't notice it before, but I'm working on it now.

@katjaweigel
Copy link
Contributor

katjaweigel commented Jun 9, 2023

Unfortunately I get an error (for ipccwg1ar5ch9/recipe_weigel21gmd_figures_13_16.yml and similar also for
ipccwg1ar5ch9/recipe_flato13ipcc_figures_938_941_cmip6.yml) from the preprocessor, which is possibly not even related (see below - seems to be caused by regridding).
It occurs under the current development version of the core, if I don't change anything (with fx_variables: null) but also without "fx_variables: null".
It does not occur with the release version of the core (branch v2.8x), tested without "fx_variables: null" for ipccwg1ar5ch9/recipe_weigel21gmd_figures_13_16.yml. I guess have to find the reason for this first before I can update the preprocessor options.

Error message (ipccwg1ar5ch9/recipe_flato13ipcc_figures_938_941_cmip6.ym):

Traceback (most recent call last):
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_main.py", line 524, in run
    fire.Fire(ESMValTool())
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_main.py", line 411, in run
    self._run(recipe, session)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_main.py", line 453, in _run
    process_recipe(recipe_file=recipe, session=session)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_main.py", line 125, in process_recipe
    recipe.run()
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_recipe/recipe.py", line 1294, in run
    self.tasks.run(max_parallel_tasks=self.session['max_parallel_tasks'])
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_task.py", line 738, in run
    self._run_parallel(address, max_parallel_tasks)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_task.py", line 782, in _run_parallel
    _copy_results(task, running[task])
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_task.py", line 805, in _copy_results
    task.output_files, task.products = future.get()
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_task.py", line 816, in _run_task
    output_files = task.run()
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/_task.py", line 264, in run
    self.output_files = self._run(input_files)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/preprocessor/__init__.py", line 670, in _run
    product.apply(step, self.debug)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/preprocessor/__init__.py", line 470, in apply
    self.cubes = preprocess(self.cubes, step,
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/preprocessor/__init__.py", line 379, in preprocess
    result.append(_run_preproc_function(function, item, settings,
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/preprocessor/__init__.py", line 328, in _run_preproc_function
    return function(items, **kwargs)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/preprocessor/_regrid.py", line 678, in regrid
    cube = _rechunk(cube, target_grid)
  File "/work/bd1083/b380216/CORE202303/ESMValCore/esmvalcore/preprocessor/_regrid.py", line 705, in _rechunk
    cube.data = data.rechunk(chunks)
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/site-packages/dask/array/core.py", line 2767, in rechunk
    return rechunk(self, chunks, threshold, block_size_limit, balance, method)
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/site-packages/dask/array/rechunk.py", line 307, in rechunk
    chunks = normalize_chunks(
  File "/home/b/b380216/mambaforge/envs/esmvaltool202303/lib/python3.10/site-packages/dask/array/core.py", line 3127, in normalize_chunks
    raise ValueError(
ValueError: Chunks do not add up to shape. Got chunks=((26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26), (120,), (180, 108)), shape=(312, 180, 288)

@katjaweigel
Copy link
Contributor

Hm, seems there were some half finished things in there, yesterday. Getting the newest version now, it works again.

@bouweandela
Copy link
Member

Yes, there was a mistake ESMValGroup/ESMValCore#2085 in the code that has now been fixed.

@katjaweigel
Copy link
Contributor

Sorry, that I don't manage to finish the PR today, some tests will run to long so I continue on Monday.

@remi-kazeroni
Copy link
Contributor

This issue can now be closed since we do not have recipes in main using fx_variables any more. Thanks to everyone who helped with recipe updates 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants