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

Add a Jupyter esmvalcore API tutorial #339

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

flicj191
Copy link

@flicj191 flicj191 commented Sep 6, 2024

Pull Request checklist

We appreciate your time and effort to improve the tutorial. Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution.


Before you start

Tasks

  • Give this pull request a descriptive title.
  • If you are contributing to existing lesson materials, please make sure the content conforms to the Lesson development section in CONTRIBUTING.md and does not contain any spelling or grammatical errors.
  • If you are making a new episode, please make sure the content conforms to the Lesson organization and Lesson formatting sections in CONTRIBUTING.md and does not contain any spelling or grammatical errors.
  • Preferably Codacy checks pass. Status can be seen below your pull request. If there is an error, click the link to find out why.
  • Preview changes on your machine before pushing them to GitHub by running make serve, alternatively make docker-serve. Please see the Previewing your changes locally section in CONTRIBUTING.md for installation instructions.
  • All code instructions have been tested.

If you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.


Closes {Link to the corresponding issue} #283 and part of #324

@flicj191
Copy link
Author

flicj191 commented Sep 6, 2024

Adding lesson made for our ACCESS 2024 workshop Training day Hackathon with @rbeucher. Have edited to remove references to Gadi (Australia's NCI supercomputer) workflow

@rbeucher
Copy link

@LisaBock , @rswamina
Would any of you have time to look at this? Thank you!

@LisaBock
Copy link
Contributor

@LisaBock , @rswamina Would any of you have time to look at this? Thank you!

Sorry! I will do next week...

@rswamina
Copy link
Contributor

@rbeucher - I will also try it this week. Thanks!

Copy link
Contributor

@LisaBock LisaBock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, @flicj191 ! It is great that we have finally a episode how to use the Jupyter esmvalcore API. And since I've never used it before, I can say that you learn it well with this episode. The examples and exercises are also very useful.

Some comments:

  • I am missing in the beginning a small part about the configuration. How to check the CFG keys and how to adapt them. (I think Peter has it in his blog.)
  • When using the ESMValCore preprocessor function I got many warnings with the output. Is it the same for you? I am not sure if we should mention that somehow. Otherwise it could be irritating.
  • I could not find the 'ACCESS-OM2, omip2' data on ESGF. Did I something wrong or could you replace it with a dataset which is available on ESGF?

@flicj191
Copy link
Author

Thanks @LisaBock for your comments! Good points, I will address them though I'm at a conference next week so probably the week after. Cheers

@rswamina
Copy link
Contributor

rswamina commented Nov 5, 2024

@flicj191 - I have started this review..will try and see if the instructions work simultaneously.

@@ -0,0 +1,511 @@
---
title: "ESMValCore API in a Jupyter notebook"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the tutorial so far, we have not distinguished between ESMvalCore and ESMValTool. Also we have not referred to the ESMValCore API as such, so perhaps we should write a line or two to orient the user.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have extended the title and added more to the start of the episode

you can run code.
You will need to use a python environment with ESMValTool and ESMValCore installed.

## Find Datasets with facets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we define facets before this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some more words to define and referred to another section in a previous episode

You will need to use a python environment with ESMValTool and ESMValCore installed.

## Find Datasets with facets
We have seen from running available recipes that ESMValTool is able to find data from facets that
Copy link
Contributor

@rswamina rswamina Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we provide an example for this? I think we either need to have a lesson referencing facets before this or we should adda paragraph with examples here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edited as above comment, maybe we could add for information to a previous lesson?

were given in the recipe. We can use this in a Notebook, including filling out the facets for
data definition.
To do this we will use the `Dataset` object from the API. Let's look at this example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually provide guidance on where this code should go. For instance, is this in a Notebook or a Python file or a YAML file? As it stands, it is not clear where this code will go and what it will be used for. Partly because we haven't discussed ESMValCore APIs in the tutorial.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mentioned adding to a jupyter notebook

## Start JupyterLab
A [jupyter notebook](https://jupyter.org/){:target="_blank"} is an interactive document where
you can run code.
You will need to use a python environment with ESMValTool and ESMValCore installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to tell them how to do this on one server (minimally) and ideally provide steps for their own machine and one or more HPC servers such as JASMIN.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we can go to too much detail as support would be at the HPC centers and I wouldn't know the others that well. I have added in links to them. On their own machine we could also link to the jupyter intall page

print(dataset)
```
> ## Pro tip: Augmented facets in the output
> When running a recipe there is a `_filled` recipe `yml` file in the output `/run` folder which
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would have to provide the command for running this recipe.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added and changed example recipe

@rswamina
Copy link
Contributor

@flicj191 - This is really nice! I have added some comments at the start of the lesson essentially to provide more detailed instructions in keeping with other lessons and for easy assimilation by the user. We haven't mentioned anything about the ESMValCore API in the tutorial, so either we should provide some background here and/or link to documentation in a way that explains this.
Also, we have to have some way of explaining how to use the appropriate environment.

I'd be interested to know what you and @LisaBock think about this.

Copy link
Contributor

@rswamina rswamina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flicj191 - Leaving this request for changes based on overall comments. Happy to discuss how best to make these changes.

@flicj191
Copy link
Author

Hi @LisaBock and @rswamina I have edited this to address all your comments in this episode. Let me know what you think, thanks

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

Successfully merging this pull request may close these issues.

4 participants