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 new recipe (16) by summer student: projection subplots #818

Merged
merged 10 commits into from
Nov 8, 2024

Conversation

sadielbartholomew
Copy link
Member

@sadielbartholomew sadielbartholomew commented Oct 3, 2024

This is the first of three recipes created this summer by our first summer student of two, Natalia. It has been prepared in the form consistent with the existing recipes.

I have only added the Python script - @bewithankit, I see four different files per recipe, is this one sufficient or do I need to generate the other three (plot_N_recipe_codeobj.pickle, plot_N_recipe.ipynb and plot_N_recipe.rst) from this for this PR, or can this be done at release time (or is the creation automatic from release r other procedures)? I will be adding the other five student-made recipes in the next few (working) days - all are in the same format as the canonical Python script.

Given the nature of recipes, the script itself should be self-contained and self-explanatory. But for context, I will add that, given the summer placement was only two weeks including time for making a poster, there wasn't time to do a full feedback round, so I have included some commits to Natalia's final script to apply linting including line wrapping; simplification of some logic and comment wording; and notably to replace one projection, 'lcc', with another, 'merc', because there is a bug with the former (see NCAS-CMS/cf-plot#75) which breaks the script, so to avoid that bug.

Expected output

projections

Note there is a cf-plot bug (yet another one, eek, NCAS-CMS/cf-plot#77) preventing us from disabling the axes for all plots, which would make everything consistent given some of the projections don't have default in-built axes labelling.

@sadielbartholomew sadielbartholomew added the documentation Improvements or additions to documentation label Oct 3, 2024
@sadielbartholomew sadielbartholomew changed the title Add new recipe (16) by summer student: projection showcase subplots Add new recipe (16) by summer student: projection subplots Oct 3, 2024
@bewithankit
Copy link
Contributor

Hi @sadielbartholomew!

Thank you, and thanks to Natalia as well for submitting this recipe. I've reviewed the Python script, and it's well-structured and clearly commented—great job! 🙌

Regarding your question, the additional files (plot_N_recipe_codeobj.pickle, plot_N_recipe.ipynb, and plot_N_recipe.rst) are generated automatically as part of the build process. What I used to do is add all the necessary files after generating the HTML and then provide a link to the temporary deployment of the webpage for reviewers to preview (for an example, see PR #688).

Note

Additionally, for each new recipe, you'll need to edit the docs/source/recipes/recipe_list.txt file to include the newly added recipe with its corresponding filters, as outlined in DOCUMENTATION.md.

With these considerations in mind, I believe this PR could be merged once other files are added/updated. Great work on preparing this recipe from Natalia's summer project!

@sadielbartholomew
Copy link
Member Author

Thanks Ankit for your prompt review. 🙂

Additionally, for each new recipe, you'll need to edit the docs/source/recipes/recipe_list.txt file to include the newly added recipe with its corresponding filters, as outlined in DOCUMENTATION.md.

Aha, that makes sense - I was wondering where the filter keywords would be added. I think across the student recipes we can add some new ones too to reflect other topics/themes, but I will check in with you that you think they are suitable.
Right-o, I shall get this done and re-commit, and do this for the other 4 PRs too.

@sadielbartholomew
Copy link
Member Author

Hi again @bewithankit, I've added this to the recipe_list.txt now, including adding a new keyword 'subplot' and marking that for two other recipes which use subplots - let me know if you think this works. Natalia's second recipe (#819, to be updated shortly) also uses subplots as a major part of the recipe, so I thought it would be useful to add it in especially in light of that.

Regarding your question, the additional files (plot_N_recipe_codeobj.pickle, plot_N_recipe.ipynb, and plot_N_recipe.rst) are generated automatically as part of the build process. What I used to do is add all the necessary files after generating the HTML and then provide a link to the temporary deployment of the webpage for reviewers to preview (for an example, see PR #688).

Getting the environment required for Sphinx (echo 'ERROR: Must use sphinx version 2.4.5. Got 7.4.7' etc.) is a bit of a pain, so let me suggest that I add all five recipes via PRs like this one, with the Python script and addition to the recipe_list.txt, then I do a final PR where I add all of the built material from those five to the repo finally, show they show up on the site. That way, I don't have to get the Sphinx env set up and enabled each time, and all the source and built materials stay separate in PR terms. What do you think?

@sadielbartholomew
Copy link
Member Author

Given how busy Ankit is with his PhD we have agreed I can merge this without second review. At release time I will enact the plan I outlined above:

let me suggest that I add all five recipes via PRs like this one, with the Python script and addition to the recipe_list.txt, then I do a final PR where I add all of the built material from those five to the repo finally, show they show up on the site

So, merging, and there will eventually be a follow-on PR to get all the new recipes built and included.

@sadielbartholomew sadielbartholomew merged commit ac9ce15 into NCAS-CMS:main Nov 8, 2024
@sadielbartholomew sadielbartholomew deleted the student-reipces-1 branch November 8, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants