# Exploration of AI tools for research software
<center>
**[GenAI4RS Workshop](https://www.tudelft.nl/evenementen/2024/delft-ai/spring-symposium-ai-education)**
**Carlos, Halford and Fardad**, [RDS Team, TU Delft University Library](https://www.tudelft.nl/library/research-data-management)
**June 4, 2024**

</center>
### 1. Workshop description
This workshop will explore the usage of generative AI in research, including code assistance, integration into research software development, and the exchange of experiences and best practices. The agenda covers essential topics: introducing LLMs, examining the impact of code assistants on research software development, and exploring responsible use and legal implications of generative AI tools like GitHub Copilot, concluding with a practical session using GitHub Copilot for software documentation.
[Google slides](https://docs.google.com/presentation/d/1Ra5D-XioFkBz1yFFMAtCHdrqPTdaXOBVFGTZpaGGLV0/edit?usp=sharing)
---
### 2. Agenda & Objetives
**Duration: 50 min**
| Episode | Topic |
|:----|:----|
| 1 | What is AI? |
| 2 | What is RSE and challenges? |
| 3 | How to use AI & RSE together?|
| 4 | Demo: Get started with Github copilot |
|5 | Conclusion |
**Key Learning Objectives**:
> **Understand** how well the GenAI can aid automate the RSE process
---
#### Mentimeter:
https://www.menti.com/alxy1r19nrye

---
### 3. Collaborative notes
**Attendees: (feel free to write your name here & affilation & email)**
- Carlos & TUD Library & c.utrillaguerrero@tudelft.nl
- Ludolf Meester & EWI/DIAM & L.E.Meester@tudelft.nl
- ...
---
#### Episode 1: What is AI?
*QUESTIONS:* I did have a question about the latest ChatGPT 4o. It seems that it is able to search the website real-time, but do i understand correctly the training dataset is still limited? (e.g. up till 2022)
---
#### Episode 2: What is RSE and why AI & RSE together?
*QUESTIONS:*
:::spoiler Mentimeter
**Mentimeter: Do you currently use AI tools in your RSE development process?**
- Yes
- No, but plan to soon
- No, and I don't plan to
:::
#### Episode 3: How to use AI & RSE?
*QUESTIONS:*
:::spoiler Mentimeter
**Mentimeter: Which AI-powered developer tools did you use regularly over the past year, and which do you want to work with over the next year? Select all that apply?**
- GitHub Copilot
- Tabnine
- AWS CodeWhisperer
- Synk Code
- Codeium
- Whispr AI
- Replit Ghostwriter
- Mintlify
- Adrenaline
- Rubber
- Duck.AI
-
:::
:::spoiler Mentimeter
**Mentimeter: For the AI tools you use as part of your RSE development process, what are the MOST important benefits you are hoping to achieve? Please check all that apply.**
1. Increase productivity
1. Speed up learning
1. Greater efficiency
1. Improve collaboration
:::
:::spoiler Mentimeter
**Mentimeter: Which parts of your development RSE workflow will benefit from GenAI tools? Please select all that apply.**
- Writing code
- Debugging and getting help
- Documenting code
- Learning about a codebase
- Testing code
- Project planning
- Committing and reviewing code
- Deployment and monitoring
- Collaborating with teammates
:::
---
#### Episode 4: Demo Github Copilot
- **Github copilot requirements and setup**
1. For **students**, follow the procedure of [Github Education](https://docs.github.com/en/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-education-for-students/apply-to-github-education-as-a-student). Requirements:
- Be currently enrolled in a TUDELFT degree.
- Have a verifiable school-ussued email address or upload documents e.g., TUDELFT ID card.
- Have a Github personal account.
2. For **teacher**, follow the prodecure of [Github Education](https://docs.github.com/en/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-education-for-teachers/apply-to-github-education-as-a-teacher). Requirements:
- Be an educator, faculty member, or researcher.
- Have a verifiable school-issued email address.
- Upload documents that prove your school affiliation.
- Have a personal account on GitHub.
3. Verify Github Copilot: https://github.com/settings/copilot
4. Download the Github Copilot extension in your IDE editor
---
**Mini-demos:**
**1. How to best interact with Github Copilot:**
- [Using GitHub Copilot Chat in your IDE](https://docs.github.com/en/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide)
Other tutorials:
- [how to apply prompt engineering in chatting with Github Copilot](https://gh.io/15mm-copilot-beginners)
- [Take Github Copulot on a test-flight](https://resources.github.com/copilot-demo/)
**2. Unit Test:**
Today's demo is based on:
- [GitHub Copilot: Fly With Python at the Speed of Thought](https://realpython.com/github-copilot-python/)
**3. (Extra) Create folder repository following standards:**
*For those using currently Github Copilot*
**Goal:**
> Compare cookiecutter tool vs. chat Copilot outputs in generating folder structure for a project using conventions in the ML community.
**Instructions:**
- **Task 1**: Install cookiecutter:
- Find the tool [[1]]
- Chose a template for ML projects
- Open new repository in VSCode
- Use cookiecutter functionality in command line
- **Task 2**: Utilise Copilot Chat:
- Check Github Copilot status
- Ask Copilot Chat [[2]]
- Execute suggested commands
- **Task 3**: Examine and discuss outputs
[1]: https://cookiecutter-pypackage.readthedocs.io/en/latest/tutorial.html
[2]: https://code.visualstudio.com/docs/copilot/overview#_jumpstart-your-project
Repo: https://github.com/carlosug/ai4rse-workshop-TUD-symp2024
---
**Episode 5: Conclusion**
:::spoiler
**Mentimeter: List the possible positive & negative impact of AI on RSE?**
POSITIVE :+1::
- Improving code documentation and reusability
- Increasing productivity and efficiency in coding
- Reviewing code in real-time, increasing quality of publicly available code
- ...
NEGATIVE :-1::
- may lack critical skills for assessing code - sloppy thinking
- untrust AI assistant outputs
- Deprecated suggestions software libraries or APIs which have since been deprecated, so that code dependencies no longer work, and neither does the code
- ...
:::
:::spoiler
**Mentimeter: Thinking about how your workflow and process changes over time, how similar or different do you anticipate your workflow to be 1 year from now as a result of AI tools you are currently using?**
* very different
* somewhat different
* neither different nor similar
* somewhat similar
* very similar
:::
---
### Potential topics for future workshops:
*[Add **topics** of your interest for the next Gen-AIforSE workshop]*
1. Version control, collaborative and Git:
- Branching, merging and conflicts (ooooo)
- Create a pull request and working with forks xxx
2. Reproducible research software:
- [Recording environments](https://coderefinery.github.io/reproducible-research/environments/#exercises)
- Create containers
- Create package in python
3. Documentation:
- [Writing good README files](https://coderefinery.github.io/documentation/writing-readme-files/)
- [Sphinx and markdown documentation to Github Pages]()
- [Deploy Sphinx documentation to Github Pages](https://coderefinery.github.io/documentation/gh_workflow/)
- [Sharing notebook using Binder](https://coderefinery.github.io/jupyter/sharing/)