owned this note
owned this note
Published
Linked with GitHub
# SORTEE Code Club - Hacky Hour Tue March 19 9-10h UTC
###### tags: `sortee` `open-code` `reproducibility`
:::warning
Link to this document: https://hackmd.io/Pj5KsJSzQduk4zEYmlmkmg
:::
> This is the collaborative "notebook" for Code Club Hacky Hour Tuesday March 19 09:00-10:00 UTC +00:00, run by the Member Engagement Committee of the Society for Open, Reproducible and Transparent Ecology & Evolution (SORTEE).
> [Become a SORTEE member](https://sortee.org/join)
> [Code Club Agenda](https://docs.google.com/spreadsheets/d/1rOOOE7ghPduwtFftG0DJJf0DXVigAdcmQ0xdEwbKQXo/edit?usp=sharing)
> [Debrief of Code Club Tue Feb 20 - Kickoff meeting](https://www.sortee.org/blog/2024/03/06/2024_code_club_kickoff/)
:::danger
:exclamation: Make sure you are familiar with [SORTEE's Code of Conduct](https://www.sortee.org/codeofconduct/) so this can be a safe and fun place to learn and discuss.
:::
:::info
:bulb: **Hint:** HackMD is great for sharing information in this kind of online set up, as the code formatting is nice & easy with [MarkDown](https://www.markdownguide.org/basic-syntax/)! Just add 3 ticks (``` ` ```) for the``` code blocks ```.
Otherwise, it's like a Google doc: it allows simultaneous editing. There's a section for practice down there ⬇️
:::
[ToC]
## Topic of today's Hacky Hour and how to join:
The Hacky Hour will revolve around [the 4 R’s of Code review](https://doi.org/10.1111/jeb.14230): **R**eported, **R**un, **R**eliable, **R**eproducible.
Come share your code mistakes, problems, tips and tricks; and **help build the SORTEE library of code mistakes**! The goal is twofold: the normalization of coding errors and building a resource of (common) code mistakes that you can use during code review. There will also be the opportunity to put up your code for (informal) peer-review.
:::danger
:exclamation: You can find the zoom link for today's Code Club on **SORTEE's Slack** which you will get access to by [becoming a SORTEE member](https://sortee.org/join).
:::
## ICE BREAKER (practice HackMD editing)
Let's learn how to use this HackMD document by answering an ice breaker question!
Somewhere on the screen (probably at the top), you should see three icons :pencil2: :desktop_computer: :eye:(a pencil, a two-column window, and an eye). You can add your answer by clicking the edit button :pencil2: (the pencil).
**Q: What is the word for _computer_ in your first/second/third language?**
_Answers:_
* Computer (Dutch)
* Computer (English)+1
* Computer (German)+1
* Tietekone (Finnish)
* Ordinateur (French)+1
* Dator (Swedish)
* Sanganak (Hindi)
* Ordenador (Spanish)
## Request a code review
Code Club can play an important role in promoting code review during development to normalize sharing code and making coding errors. Code Club can also provide code review immediately pre-publication through a code pre-check.
:::warning
**Would you like your code to be checked by peers?** You are very welcome to request it here!
:::
:::info
:bulb:**Tip** You can use SORTEE's [Code Club github](https://github.com/SORTEE/peer-code-review) to do the code review by adding your code review request and the code review as an issue (how-to explained on the page).
:::
- [ ] **Put your name here and add the following details below:**
- **Research topic:** briefly describe what the code is about/does so people can judge whether they have the right expertise to help
- **Coding language:** e.g. R, python, shell...
- **Code status (pick one):** in-process / pre-publication / post-publication
- **Code review goal:** briefly describe what you would like to get out of a code review session
- **Preferred type of code review (pick one):** group / 1-on-1
- **Code reviewer:** :exclamation:_put your name here to volunteer to review this code!_
- [ ] **Put your name here and add the following details below:**
- **Research topic:** briefly describe what the code is about/does so people can judge whether they have the right expertise to help
- **Coding language:** e.g. R, python, shell...
- **Code status (pick one):** in-process / pre-publication / post-publication
- **Code review goal:** briefly describe what you would like to get out of a code review session
- **Preferred type of code review (pick one):** group / 1-on-1
- **Code reviewer:** :exclamation:_put your name here to volunteer to review this code!_
- [ ] **Put your name here and add the following details below:**
- **Research topic:** briefly describe what the code is about/does so people can judge whether they have the right expertise to help
- **Coding language:** e.g. R, python, shell...
- **Code status (pick one):** in-process / pre-publication / post-publication
- **Code review goal:** briefly describe what you would like to get out of a code review session
- **Preferred type of code review (pick one):** group / 1-on-1
- **Code reviewer:** :exclamation:_put your name here to volunteer to review this code!_
## Share your code mistakes, problems, tips & tricks
We have four breakout rooms standing ready in zoom, one for each of [the 4 Code Review R's](https://doi.org/10.1111/jeb.14230). **Join one of the breakout rooms and start discussing!** You can join a room based on the code review _R_ you are most interested in; the problem/mistake you'd like to share; the problem/mistake you have tips & tricks for etc.
:::info
:bulb: This is the place to ask for help and share your coding issues and mistakes!
Add your questions, problems and/or mistakes under the code review R you think it belongs to.
:::
:::warning
:raised_hands: If you feel comfortable, please add your coding mistakes (and potentially how to recognize them) to the [SORTEE Library of Code Mistakes](https://docs.google.com/presentation/d/12QN3WUc5v1Df7OArEox2U7l_N_qnHHuwzjCYiI4idC8/edit?usp=sharing). This way we can build a resource of (common) code mistakes that people can use during code review.
_NB: You can make your mistake as anonymous as you like._
:::
### Breakout room _**R**eported_
- [ ] **Q1: What is the best way to report packages used in analysis?**
- Answer: put session info/renv lock file in github (but lot of trouble for someone else to download all the packages with right version)
- Answer: containerization (Docker, [binder](https://mybinder.org/))
- Answer: groundhogR (only date when package was installed)
- Package managers (Nix: https://github.com/b-rodrigues/rix?tab=readme-ov-file#reproducible-environments-with-nix)
- Try out in Code Club? Give your environment file to someone else
- [ ] **Q2: How not to get confused with Quarto setup options (also applies to R markdown reports) so for easy conversion of scripts into reproducible reports**
- A: Quarto=package which updates to markdown native to R studio, can export project into any file type; in-between-solution: right a little doc/blog recording the setup options and problems you run into normally (and don't have to relearn it every time you want to do conversion)
- **Follow op Q:** How is your workflow? Start with report in mind or do this at later stage?
- Not many people using markdown reports because seems like too much trouble (most only use it for teaching); but it makes it much clearer which scripts do what. More trouble/work for the code writer, but easier for the code reader than basic script
- Quarto example: https://github.com/rroyaute/mantarays-iiv-analysis
- Quarto example: https://github.com/kumar-a/shifting-distributions
- [ ] **Q2: Type your question/problem/mistake here**
- A: Discuss in your breakout room and write the answer/solution/tip here.
### Breakout room _**R**un_
- [ ] **Q1: Is there an easy way to get running time and used memory & CPU (of functions) in R/RStudio?**
- A: I used to save the results from analysis (time consuming) in output folder
- http://adv-r.had.co.nz/memory.html maybe?
- A: memory use report button in Rstudio (in environment window); can click it while running though?
- A: On remote server could use batch job, run each function as a separate batch job, then check resource usage for batch job
- [ ] **Q2: Type your question/problem/mistake here**
- A: Discuss in your breakout room and write the answer/solution/tip here.
### Breakout room _**R**eliable_
- [ ] **Q1: Type your question/problem/mistake here**
- A: Discuss in your breakout room and write the answer/solution/tip here.
- [ ] **Q2: Type your question/problem/mistake here**
- A: Discuss in your breakout room and write the answer/solution/tip here.
### Breakout room _**R**eproducible_
- [ ] **Q1: Type your question/problem/mistake here**
- A: Discuss in your breakout room and write the answer/solution/tip here.
- [ ] **Q2: Type your question/problem/mistake here**
- A: Discuss in your breakout room andwrite the answer/solution/tip here.
## Give feedback
Any feedback on Code Club is welcome! Things you liked, things which could be improved, topics you would like to see in upcoming Code Clubs etc.
**Feedback:**
- Topic suggestion for Hacky Hour: exchange coding environment files and try to recreate each other's environment (e.g. installing all required software with versions used). Could try to figure out if there is a nice automatic way for different languages (e.g. in R, could renv package lock file be used to automatically replicate the R environment?)
- Didn't split up into breakout rooms this time, but maybe nice to do so in upcoming meetings anyway? Easier to join the conversation and participate in smaller groups (e.g. 4 people groups)
- Like the HackMD file! Maybe open it up and post the link some time already before the meeting so that people have longer time to sign up for code review? Instead of having to do it on the spot
- ....
- ....
- ....
## Useful links
Add here any links you think could be useful for Code Club.
- [Andrew Heiss blog](https://www.andrewheiss.com/blog/) Some good blog inspirations