Skip to content

Commit

Permalink
first push test scripts automatic slide from shared DB #49
Browse files Browse the repository at this point in the history
  • Loading branch information
aranas committed Sep 11, 2023
1 parent 8619930 commit 7168b50
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/slides_reveal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Generate Slides

on: [push, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout main repository
uses: actions/checkout@v3

- name: Checkout submodules
run: git submodule update --init --recursive

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install Python dependencies
run: |
pip install pandas
pip install jinja2
- name: Generate slides using Python
run: python generate_slides.py

- name: Install Pandoc
run: sudo apt-get install pandoc

- name: Convert Markdown to HTML using reveal.js
run: |
pandoc slides.md -t revealjs -s -o slides.html -V revealjs-url=./reveal.js -V theme=black
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Generate slides"
git push
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
66 changes: 66 additions & 0 deletions slides/generate_slides.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
'''
this script reads in the output_ram.csv file
and populates a markdown template writing to slides.md
which can be used to generate slides using reveal.js
'''
import pandas as pd
import os
from jinja2 import Environment, FileSystemLoader

# Set up Jinja2 environment and load the templates
env = Environment(loader=FileSystemLoader('.'))
slide_project = env.get_template('slide_templates/template_project_horizontal.md')
slide_bullets = env.get_template('slide_templates/template_bullets_vertical.md')
slide_bullets2 = env.get_template('slide_templates/template_iframe_background.md')
slide_image = env.get_template('slide_templates/template_image.md')
slide_url = env.get_template('slide_templates/template_url_vertical.md')

# Read the title slide from title_template.md
with open('slide_templates/template_title.md', 'r') as title_file:
markdown = title_file.read()

# Read data from CSV to pandas
df = pd.read_csv('output_ram.csv')
#group by project
df = df.groupby('Project')

# Add a slide for each project
for project in df['Project'].unique():
# add project slide with description
description = df.get_group(project[0])['Project description'].values[0]
# make sure description is not nan
if description != description:
description = ''
slide_content = slide_project.render(Project=project[0], Project_content=description)
markdown += slide_content

# check if value in Output type is RAM assessment:
if 'RAM assessment' in df.get_group(project[0])['Output type'].values:
# add slide template with image and use column "Output Media" as image_path
image_path = df.get_group(project[0])['Output Media'].values[0]
slide_content = slide_image.render(image_path=image_path)
markdown += slide_content

# add vertical slides with output bullets
bullets = df.get_group(project[0])['Output description']
#check if series contains NA
if not bullets.isnull().values.any():
slide_content = slide_bullets.render(Bullets=bullets.tolist())
markdown += slide_content

# add vertical slides with url
url = df.get_group(project[0])['Landing page']
if url.values[0] != '':
slide_content = slide_url.render(URL=url.values[0])
markdown += slide_content

# add combined slide
if (not bullets.isnull().values.any()) & (url.values[0] != ''):
slide_content = slide_bullets2.render(bullet=bullets.tolist()[0], URL=url.values[0])
markdown += slide_content

# Write the entire slide deck to a markdown file
with open('slides.md', 'w') as md_file:
md_file.write(markdown)

print("Generated slides.md")
14 changes: 14 additions & 0 deletions slides/output_ram.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Project,Project description,Output type,Output description,Landing page,Output Media,Other Link,RAM,Active RAM engagement?,Date,Notes,Turing Programme / GC,Contact
AB Street,"An open source urban modelling platform that invites users to add different street interventions to view the impact on traffic in the surrounding neighbourhood and city at large. A/B street can help residents and planners have a shared canvas for discussing potential street-level changes, such as planting street trees or installing a model filter to encourage cycling and walking.",Stakeholder engagement,We worked with local councils to use the tool in public consultation and co-creation session.,https://a-b-street.github.io/docs/software/ltn/index.html,https://www.turing.ac.uk/blog/street-smart-putting-neighbourhood-design-hands-bristol-residents,,,Y,,,,
AI Standards Hub,,Stakeholder engagement,We facilitated external stakeholder workshops with organisations like Department for Transport,https://aistandardshub.org/,,,SL,Y,,,,
clim-recal,"The aim of clim-recal is to provide non-climate scientists with an extensive guide to the application, disadvantages/advantages and use of bias adjustment methods, provide researchers with a collated set of resources for how to technically apply the methods, with a framework for open additions, and create accessible information on methods for non quantitative researchers and lay-audience stakeholders",, ,,,,"JD, SA",Y,,,,
Colouring Cities,,, ,https://colouringcities.org/,,https://github.com/orgs/colouring-cities/repositories,,Y,,,,
Data Safe Haven,"The Turing Data Safe Haven is an open-source framework for creating secure environments to analyse sensitive data. It provides a set of scripts and templates that will allow you to deploy, administer and use your own secure environment.",,,,,,HS,Y,,,,
DfT Short Straits,"DfT Short Straits is a collaboration between TRIC, DCE, and UA with Department for Transport for creating a Digital Twin of the Short Straits around Port of Dover, including road, port, and maritime systems in the area",,We co-created resources for stakeholder engagement,,https://miro.com/app/board/uXjVMAOaBQA=/,,,Y,,,,
London Data Week,"London Data Week is a free, public festival of events across the city, run by different organisations with different communities, to bring Londoners into the conversations about data and AI",,"with Turing and LOTI we convened the London data community, in partnership with organisations like Open Data Institute, Royal Statistical Society, GLA, Better Images of AI, and the Francis Crick Institute",https://www.londondataweek.org/,,,JD,N,,,,
Scivision,,,,https://sci.vision/,,https://github.com/alan-turing-institute/scivision,AC,Y,,,,
The Turing Way Practitioner’s Hub,,,,,,,CR,Y,,,,
PitchFest at AI UK,,,We contribute to Institute-wide flagship events,,,,,N,,,,
Other,,Conference Talks / Workshops,We organize collaborationwWorkshops: Pathways to Sustainability for Research Projects and Outputs,,https://miro.com/app/board/uXjVMQDvxC0=/,,"HS, CR, ALS",N,,,,
Other,,Scoping,We have been assessing RAM potential across Turing projects ,,,,,,,,,
The Trustworthy and Ethical Assurance platform,"The platform brings together elements of Ethics and Assurance methodology like SAFED principles and argument patterns in a usable and accessible manner, and helps project teams to provide trustworthy and justifiable assurance about the processes they undertook when designing, developing, and deploying their technology or system.",RAM assessment,,https://alan-turing-institute.github.io/AssurancePlatform/,https://user-images.githubusercontent.com/5104098/262439184-1c18c514-02c2-434e-abc1-dfcdff3769ba.png, ,"SA, KW",Y,28-9,https://hackmd.io/qbm6EGeNTmqL_t2HoYBJDA?both,,
3 changes: 3 additions & 0 deletions slides/slide_templates/template_bullets_vertical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<section>{% for bullet in Bullets %}
- {{ bullet }}
{% endfor %}</section>
3 changes: 3 additions & 0 deletions slides/slide_templates/template_iframe_background.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<section data-background-iframe="{{URL}}" style="background-color: rgba(0,0,0,0.5);">
{{ bullet }}
</section>
4 changes: 4 additions & 0 deletions slides/slide_templates/template_image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<section>
<h2>RAM assessment</h2>
<img src="{{image_path}}">
</section>
5 changes: 5 additions & 0 deletions slides/slide_templates/template_project_horizontal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

---

## {{Project}}
<section>{{Project_content}}</section>
5 changes: 5 additions & 0 deletions slides/slide_templates/template_title.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# Ram outputs NEW

<div class="footer">Slides by <a href="https://www.turing.ac.uk/research/research-programmes/tools-practices-and-systems/research-application-management">RAM Team</a></div>

1 change: 1 addition & 0 deletions slides/slide_templates/template_url_vertical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<section><iframe src="{{URL}}" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section>
91 changes: 91 additions & 0 deletions slides/slides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

# Ram outputs NEW

<div class="footer">Slides by <a href="https://www.turing.ac.uk/research/research-programmes/tools-practices-and-systems/research-application-management">RAM Team</a></div>


---

## AB Street
<section>An open source urban modelling platform that invites users to add different street interventions to view the impact on traffic in the surrounding neighbourhood and city at large. A/B street can help residents and planners have a shared canvas for discussing potential street-level changes, such as planting street trees or installing a model filter to encourage cycling and walking.</section><section>
- We worked with local councils to use the tool in public consultation and co-creation session.
</section><section><iframe src="https://a-b-street.github.io/docs/software/ltn/index.html" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="https://a-b-street.github.io/docs/software/ltn/index.html" style="background-color: rgba(0,0,0,0.5);">
We worked with local councils to use the tool in public consultation and co-creation session.
</section>
---

## AI Standards Hub
<section></section><section>
- We facilitated external stakeholder workshops with organisations like Department for Transport
</section><section><iframe src="https://aistandardshub.org/" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="https://aistandardshub.org/" style="background-color: rgba(0,0,0,0.5);">
We facilitated external stakeholder workshops with organisations like Department for Transport
</section>
---

## Colouring Cities
<section></section><section>
-
</section><section><iframe src="https://colouringcities.org/" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="https://colouringcities.org/" style="background-color: rgba(0,0,0,0.5);">
</section>
---

## Data Safe Haven
<section>The Turing Data Safe Haven is an open-source framework for creating secure environments to analyse sensitive data. It provides a set of scripts and templates that will allow you to deploy, administer and use your own secure environment.</section><section><iframe src="nan" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section>
---

## DfT Short Straits
<section>DfT Short Straits is a collaboration between TRIC, DCE, and UA with Department for Transport for creating a Digital Twin of the Short Straits around Port of Dover, including road, port, and maritime systems in the area</section><section>
- We co-created resources for stakeholder engagement
</section><section><iframe src="nan" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="nan" style="background-color: rgba(0,0,0,0.5);">
We co-created resources for stakeholder engagement
</section>
---

## London Data Week
<section>London Data Week is a free, public festival of events across the city, run by different organisations with different communities, to bring Londoners into the conversations about data and AI</section><section>
- with Turing and LOTI we convened the London data community, in partnership with organisations like Open Data Institute, Royal Statistical Society, GLA, Better Images of AI, and the Francis Crick Institute
</section><section><iframe src="https://www.londondataweek.org/" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="https://www.londondataweek.org/" style="background-color: rgba(0,0,0,0.5);">
with Turing and LOTI we convened the London data community, in partnership with organisations like Open Data Institute, Royal Statistical Society, GLA, Better Images of AI, and the Francis Crick Institute
</section>
---

## Other
<section></section><section>
- We organize collaborationwWorkshops: Pathways to Sustainability for Research Projects and Outputs

- We have been assessing RAM potential across Turing projects
</section><section><iframe src="nan" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="nan" style="background-color: rgba(0,0,0,0.5);">
We organize collaborationwWorkshops: Pathways to Sustainability for Research Projects and Outputs
</section>
---

## PitchFest at AI UK
<section></section><section>
- We contribute to Institute-wide flagship events
</section><section><iframe src="nan" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="nan" style="background-color: rgba(0,0,0,0.5);">
We contribute to Institute-wide flagship events
</section>
---

## Scivision
<section></section><section><iframe src="https://sci.vision/" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section>
---

## The Trustworthy and Ethical Assurance platform
<section>The platform brings together elements of Ethics and Assurance methodology like SAFED principles and argument patterns in a usable and accessible manner, and helps project teams to provide trustworthy and justifiable assurance about the processes they undertook when designing, developing, and deploying their technology or system.</section><section>
<h2>RAM assessment</h2>
<img src="https://user-images.githubusercontent.com/5104098/262439184-1c18c514-02c2-434e-abc1-dfcdff3769ba.png">
</section><section><iframe src="https://alan-turing-institute.github.io/AssurancePlatform/" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section>
---

## The Turing Way Practitioner’s Hub
<section></section><section><iframe src="nan" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section>
---

## clim-recal
<section>The aim of clim-recal is to provide non-climate scientists with an extensive guide to the application, disadvantages/advantages and use of bias adjustment methods, provide researchers with a collated set of resources for how to technically apply the methods, with a framework for open additions, and create accessible information on methods for non quantitative researchers and lay-audience stakeholders</section><section>
-
</section><section><iframe src="nan" style="width: 100%; height: 200%; float: right; border: none;"></iframe></section><section data-background-iframe="nan" style="background-color: rgba(0,0,0,0.5);">
</section>

0 comments on commit 7168b50

Please sign in to comment.