galaxyproject / training-material

A collection of Galaxy-related training material
https://training.galaxyproject.org
MIT License
294 stars 846 forks source link

[WIP] tutorial "Introduction to Python" #2764

Closed mcmaniou closed 2 years ago

mcmaniou commented 2 years ago

First version of the tutorial, based on the Carpentries tutorials: https://swcarpentry.github.io/python-novice-inflammation/, https://swcarpentry.github.io/python-novice-gapminder/ .

Submitted for the Gallantries project @mcmaniou, @fpsom

hexylena commented 2 years ago

xref https://github.com/gallantries/organisation/issues/3

I'll have a look at this! But it's great that you kicked it off @mcmaniou! I think in the long term we might want to make those lessons a bit more modular, but for now having it in one file is great.

I started to renew my university's curriculum based on the same but I was starting to think about making some changes to the swcarpentry. Maybe we'd like to discuss these in our gallantries meeting:

That's something we could think about discussing (gtn + gallantries) as well? is it better to have the tutorial in the GTN where we can have nice tip / solution boxes / etc? Or would it make more sense to have it in the format of a notebook they load into jupyter where the code could be runnable without the copy/pasting step. I recently had fairly good success with https://github.com/aaren/notedown to convert markdown documents into notebooks (automatically marking the python code blocks as runnable cells) which could make this blending of tutorial/notebook a bit more smooth.

hexylena commented 2 years ago

None of the above discussion is a blocker for this PR, btw. I attempted to push a commit to fix the frontmatter and allow building but this PR is from the main branch, which does not allow maintainers to push fixes, so, here are the changes that should be made:

rename from topics/introduction/tutorials/python-basics/Introduction_to_Python.md
rename to topics/introduction/tutorials/python-basics/tutorial.md
index 991bdc28c7..559172f15e 100644
--- a/topics/introduction/tutorials/python-basics/Introduction_to_Python.md
+++ b/topics/introduction/tutorials/python-basics/tutorial.md
@@ -3,9 +3,9 @@ layout: tutorial_hands_on

 title: Introduction to Python
 level: Introductory
-zenodo_link: ""
-requirements: ""
-follow_up_training:""
+zenodo_link: https://zenodo.org/record/3477564
+requirements: []
+follow_up_training: []

 questions:
 - How can I run Python programs using Galaxy?
@@ -17,11 +17,8 @@ objectives:
 - Learn the fundamentals of programming in Python
 - Use the scientific libraries pandas, numpy and matplolib to explore tabular datasets

-time_estimation: ""
-key_points:""
-
-supporting_material:
-- [Dataset](https://zenodo.org/record/3477564/files/annotatedDEgenes.tabular)
+time_estimation: 8H
+key_points: []
hexylena commented 2 years ago

@mcmaniou could you please add yourself to the Contributors file? I think that will fix the linting errors.

mcmaniou commented 2 years ago

@mcmaniou could you please add yourself to the Contributors file? I think that will fix the linting errors.

Thank you for the quick response. I hope everything works now

hexylena commented 2 years ago

Looks good. I'll probably open a PR to work on the GTN specific formatting changes that would be needed since that's a lot of work.

mcmaniou commented 2 years ago

@hexylena In the next few days, I will split the tutorial in three modules (basics, advanced-numpy-pandas and plotting) and then push another commit. Could you please postpone the merging step till then?

hexylena commented 2 years ago

Absolutely :)

hexylena commented 2 years ago

Another thought: We could also retain the original structure from the carpentries? Rather than merging them into three bigger modules. It'd probably make it easier to keep up to date with anything the carpentries improves in the future?

mcmaniou commented 2 years ago

This tutorial is a mix of the two Carpentries tutorials and does not follow their original structure. But it could be split into more modules. For example:

  1. data types - variables
  2. lists - strings - type conversion
  3. built-in Python functions
  4. conditionals
  5. loops
  6. functions
  7. libraries - numpy
  8. pandas
  9. plotting Would that help?
hexylena commented 2 years ago

Yeah! That sounds good.

fpsom commented 2 years ago

FWIW, I think that splitting in into so small modules, might make it more difficult for learners to actually follow. Plus, some modules will end up being tiny, at least in comparison to other tutorials in GTN.

In the case of the three, slightly larger modules, we'll be still referencing the relevant Carpentries lessons, but at the same time we might be updating these independently.

That being said, if you'd think that having the 9 tutorial files that @mcmaniou listed, I won't argue too much against. :)

hexylena commented 2 years ago

at least in comparison to other tutorials in GTN.

I'm not so worried about that, there's room for variety.

I don't know. On one hand it seems like it'll be easier to maintain if they're smaller (just diff this file vs carpentries to see if we want their updates) but there's a good point about following all of them is generally what you'll do (maybe a problem to be solved by learning paths)

hexylena commented 2 years ago

@shiltemann @bebatut not sure if either of you have an opinion here?

hexylena commented 2 years ago

Since no one else has comments, I think we go with your proposal @fpsom @mcmaniou, I think I'm alone in thinking it would be easier. Sorry for the delay!

fpsom commented 2 years ago

:) I highly doubt that you are alone in thinking this - my main argument is that, because the content has been adapted from the carpentries lessons, any updates from that side won't be as easy (or automat-able) to propagate here...

hexylena commented 2 years ago

Just checking in @mcmaniou if everything is going ok, I'm very excited to review this whenever it's ready!

mcmaniou commented 2 years ago

Just checking in @mcmaniou if everything is going ok, I'm very excited to review this whenever it's ready!

I got caught up with other deadlines, but I will make the changes within the next week.

hexylena commented 2 years ago

Oh no worries! It's the worst season for deadlines :(

mcmaniou commented 2 years ago

@hexylena I made the changes. I am sorry for the delay.

hexylena commented 2 years ago

No worries @mcmaniou!! It happened to me too, there's too much going on lately :( This looks fantastic.

The instructions for fixing the branch are a bit complicated, you can either do it yourself or you could add me to your repository as a collaborator and I can do them for you? Whatever works for you.

How to rebase your branch Rebase against the main branch (I think since you're on a main branch it's a bit more complicated, I can suggest the following instructions) ``` git checkout -b python-tutorials # Create a new branch from the current status of the `main` branch git push # Push the new branch to your github fork git checkout main # Swap back to main git remote -v # This will print a list of remotes, please double check that there is one set for the 'upstream' of https://github.com/galaxyproject/training-material.git. If there is not, run the next commented out command # git remote add upstream https://github.com/galaxyproject/training-material.git git fetch upstream git reset --hard upstream/main # This will make your main branch match the GTN's current main branch git checkout python-tutorials # Now we can start rebasing git rebase upstream/main # Rebases it against main so the new `data-science` folder will be available ``` After you've done that could you move the python tutorials into the new data science topic? Something like this should be ok ``` git mv topics/introduction/tutorials/python* topics/data-science/tutorials/ ``` And once you've done all that, you can edit this pr (pencil icon at the top) to change the source branch to be your new python branch. I'm sorry for the whole complicated dance
mcmaniou commented 2 years ago

@hexylena I don't think I can change the source branch in the pr, only the base branch. It looks like I should perform all the steps you described and then create a new pr. I hope I am wrong though

hexylena commented 2 years ago

Oh, shoot, you're right! I thought you could change the source branch, hmm. Ok, then yes, could you do that and create a new PR?

mcmaniou commented 2 years ago

Yes, I will do that rignt now and name it: [WIP] tutorial "Data Science - Introduction to Python".