ESMValGroup / ESMValTool_Tutorial

ESMValTool Tutorial
https://tutorial.esmvaltool.org/
Other
5 stars 8 forks source link

Review training material episode 7 #203

Closed annefou closed 1 year ago

annefou commented 3 years ago

Going through episode 7, I have a few questions/remarks:

I would clone the repository to ~/ so everywhere we could cd ~/ESMValTool rather then cd ESMValTool. Or at least I would suggest to be consistent in all the episodes.

Review process

Using pre-commit

  1. flake8: the error message is about an unused local variable nx. We should check our codes regarding the usage of nx. For now, let’s assume that it is added by mistake and remove it.

Maybe we could add a sentence: Then rerun pre-commit and check that it passes. Mostly to have the same level of details everywhere.

Running tests

So maybe we need a bit more guidance in the solution (fixing warming_stripes.yml is probably not sufficient and it is obvious to everyone but me!).

annefou commented 3 years ago

The error I got is:

cat log.txt

ERROR: LoadError: ArgumentError: Package YAML [ddb6d928-2868-570f-bddf-ab3f9cf99eb6] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
 [1] _require(::Base.PkgId) at ./loading.jl:999
 [2] require(::Base.PkgId) at ./loading.jl:928
 [3] require(::Module, ::Symbol) at ./loading.jl:923
 [4] include(::Function, ::Module, ::String) at ./Base.jl:380
 [5] include(::Module, ::String) at ./Base.jl:368
 [6] exec_options(::Base.JLOptions) at ./client.jl:296
 [7] _start() at ./client.jl:506
in expression starting at /data/dnb03/galaxy_db/job_working_directory/017/920/17920290/tmp/pytest-of-root/pytest-0/popen-gw35/test_diagnostic_run_diagnostic0/diagnostic.jl:2
bouweandela commented 3 years ago

That error happens because pytest is trying to run the test that checks if you are able to run a Julia diagnostic, but you may not have installed the Julia dependencies. To run only tests that do not require additional Julia or R dependencies, run

pytest -m 'not installation'

or alternatively, you can install the Julia dependencies with

esmvaltool install Julia

and the R dependencies with

esmvaltool install R
annefou commented 3 years ago

Cool! Thank you! I will try it out!

SarahAlidoost commented 3 years ago

@annefou Many thanks for reviewing the lesson and taking the time to submit the issue, very good points and detailed comments. :+1:

SarahAlidoost commented 3 years ago

To address this issue, a pull request should be made changing (only) episode 7 file and fixing these items:

and we need to check:

and finally providing best practices around branch names is beyond this tutorial.

bouweandela commented 3 years ago

pytest -m 'not installation' is what you would use to run the tests if NCL, R and Julia dependencies have not been installed (this happens if you only install the esmvaltool-python package from conda).

SarahAlidoost commented 3 years ago

pytest -m 'not installation' is what you would use to run the tests if NCL, R and Julia dependencies have not been installed (this happens if you only install the esmvaltool-python package from conda).

Many thanks for the explanations. In episode 7 of the tutorial, we run pip install --editable '.[develop]'. So, I think that all the dependencies should be installed.

bouweandela commented 3 years ago

Looking at the text of that episode, it looks like you're doing a Installation from source there, but skipping the steps for installing the R and Julia dependencies. That means that you need to use the command pytest -m 'not installation' to run the tests (or do a complete installation by installing Julia and then running esmvaltool install Julia and esmvaltool install R).

SarahAlidoost commented 3 years ago

Looking at the text of that episode, it looks like you're doing a Installation from source there, but skipping the steps for installing the R and Julia dependencies. That means that you need to use the command pytest -m 'not installation' to run the tests (or do a complete installation by installing Julia and then running esmvaltool install Julia and esmvaltool install R).

oh, good to know, many thanks :+1: