Skip to content

Commit

Permalink
use GH API to fetch up-to-date stargazers_count in cv/+page.server.ts
Browse files Browse the repository at this point in the history
add CHGNet to cv.projects
  • Loading branch information
janosh committed Oct 10, 2023
1 parent 8ec3fbf commit a96437f
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 30 deletions.
26 changes: 19 additions & 7 deletions src/routes/cv/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Icon from '@iconify/svelte'
import cv from './cv-data.yml'
import cv from './cv.yml'
const email = `janosh@lbl.gov`
const links = { target: `_blank`, rel: `noreferrer` }
Expand Down Expand Up @@ -73,10 +73,11 @@
<section class="body">
<small>
I joined the Materials Project in early 2023 where I build high-throughput workflows
for generating large DFT and ML potential datasets. I am a core maintainer of
for generating large DFT datasets. I am a core maintainer of
<a href="https://github.com/materialsproject/pymatgen">pymatgen</a>
and enjoy building infrastructure around high-quality open source software that enables
new capabilities in computational materials to scale.
and enjoy building high-quality open source software that enables new capabilities in computational
materials to scale. In particular, my current interests are on further development, training
and benchmarking of universal interatomic potentials.
</small>
<h2>
<Icon inline icon="zondicons:education" />&nbsp; Education
Expand Down Expand Up @@ -121,7 +122,7 @@
<!-- <small>only lead dev repos</small> -->
</h2>
<ul>
{#each cv.projects as { url, img_style, github, name, description, stars, logo }}
{#each cv.projects as { url, img_style, github, name, description, stars, logo, languages }}
{@const logo_url = logo ?? `${url}/favicon.svg`}
<li>
<h4>
Expand All @@ -137,6 +138,7 @@
<small>{stars} ⭐</small>
</a>
{/if}
<small class="langs">{languages.slice(0, 3).join(`, `)}</small>
</h4>
<p>{description}</p>
</li>
Expand Down Expand Up @@ -215,10 +217,15 @@
<ul>
{#each cv.hobbies as { name, icon, href }}
<li>
<a {href}>
{#if href}
<a {href}>
<Icon inline {icon} />
{name}
</a>
{:else}
<Icon inline {icon} />
{name}
</a>
{/if}
</li>
{/each}
</ul>
Expand Down Expand Up @@ -290,6 +297,11 @@
gap: 8pt;
place-items: center;
}
ul > li > h4 > small.langs {
margin-left: 2ex;
font-weight: 200;
font-size: 9pt;
}
p {
margin: 0;
font-size: 10pt;
Expand Down
86 changes: 64 additions & 22 deletions src/routes/cv/cv-data.yml → src/routes/cv/cv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ education:
thesis_title: van der Waals Corrections for Density Functional Theory - DFT+D2 applied to Graphene-hBN-Heterostructures
href: https://physik.uni-hamburg.de/en.html
logo: https://assets.rrz.uni-hamburg.de/assets/uhh-logo-4ec3691b46570436d95977e2c0c368646d0c24d722425dd674f48b1c44585e81.svg

publications:
- name: Matbench Discovery
title: Matbench Discovery - Can machine learning identify stable crystals?
Expand Down Expand Up @@ -56,45 +55,97 @@ projects:
img_style: 'min-width: 90px;'
github: https://github.com/materialsproject/pymatgen
description: One of the largest and most popular open source materials analysis codes that defines classes for structures, molecules, slabs, etc. and interfaces seamlessly with various other materials codes. It also powers the Materials Project.
languages:
- Python
- Cython
stars: 1170
- name: Matbench Discovery
url: https://matbench-discovery.materialsproject.org
img_style: 'filter: invert(1);'
github: https://github.com/janosh/matbench-discovery
description: Benchmark for machine learning energy models simulating a real-world materials discovery campaign. Interactive leader board and Python package make new model submissions easy.
languages:
- Python
- Svelte
- CSS
- TypeScript
- JavaScript
- HTML
stars: 36
- name: CHGNet
url: https://chgnet.lbl.gov
github: https://github.com/CederGroupHub/chgnet
description: Pretrained universal neural network potential for charge-informed atomistic modeling. Published on the cover of Nature Machine Intelligence.
languages:
- Python
- C
- Cython
- CSS
- Svelte
- HTML
- JavaScript
- TypeScript
stars: 111
- name: Elementari
url: https://elementari.janosh.dev
github: https://github.com/janosh/elementari
description: A library of Svelte components for building interactive web apps with performant chemistry visualizations like periodic tables, Bohr atoms, nuclei, heatmaps, scatter plots.
stars: 49
languages:
- TypeScript
- Svelte
- CSS
- Python
- JavaScript
- HTML
stars: 90
- name: pymatviz
url: https://pymatviz.janosh.dev
img_style: 'filter: invert(1);'
github: https://github.com/janosh/pymatviz
description: A toolkit for visualizations in materials informatics to complement pymatgen.
stars: 48
languages:
- Python
- Svelte
- CSS
- TypeScript
- HTML
- JavaScript
stars: 70
- name: Tensorboard Reducer
github: https://github.com/janosh/tensorboard-reducer
logo: https://raw.githubusercontent.com/janosh/tensorboard-reducer/main/assets/tensorboard-reducer-square.svg
description: Reduce multiple PyTorch TensorBoard runs to new events/CSV/JSON. Good for model ensembles.
stars: 51
pypi: https://pypi.org/project/tensorboard-reducer
languages:
- Python
- TeX
stars: 59
- name: Aviary
github: https://github.com/CompRhys/aviary
logo: https://raw.githubusercontent.com/janosh/tikz/main/assets/aviary/aviary.svg
description: Multiple ML energy model implementations (Roost, Wren, CGCNN, Wrenformer) with a consistent API.
stars: 21
pypi: https://pypi.org/project/tensorboard-reducer
languages:
- Python
stars: 29
- name: Normalizing Flows
github: https://github.com/janosh/awesome-normalizing-flows
stars: 983
logo: https://api.iconify.design/logos:awesome.svg?color=%23888888
description: Curated list of resources for learning and using normalizing flows, a powerful tool in ML for modeling probability distributions.
languages:
- Python
stars: 1170
- name: MultiSelect
url: https://multiselect.janosh.dev
github: https://github.com/janosh/svelte-multiselect
stars: 146
description: Keyboard-friendly, accessible and customizable multi-select web component.

languages:
- TypeScript
- Svelte
- CSS
- HTML
- JavaScript
stars: 219
skills:
- name: Python
icon: mdi:language-python
Expand Down Expand Up @@ -168,31 +219,25 @@ skills:
- name: Cypress
icon: simple-icons:cypress
score: 3

hobbies:
- name: nature photography
- name: photography
icon: mdi:camera
href: https://youtube.com/@jrib
- name: film & editing
- name: video editing
href: https://youtube.com/@jrib
icon: mdi:youtube
- name: hiking
icon: mdi:map-marker-distance
href: https://komoot.com/user/179035526626
- name: cycling
icon: mdi:bike
href: https://komoot.com/user/179035526626
- name: rock climbing
- name: climbing
icon: map:climbing
href: https://komoot.com/user/179035526626
- name: drone flying
- name: drones
icon: carbon:drone
href: https://youtube.com/@jrib

nationality:
- 🇨🇦 Canadian
- 🇩🇪 German

languages:
- name: 🇺🇸 English
level: advanced
Expand All @@ -202,7 +247,6 @@ languages:
level: intermediate
- name: 🇪🇸 Spanish
level: basic

volunteer:
- name: Studenten bilden Schüler
description: Non-profit student initiative that connects University student volunteers with children from underprivileged families for free tutoring.
Expand All @@ -216,13 +260,11 @@ volunteer:
href: https://afara.foundation
logo: https://afara.foundation/favicon.svg
role: Board member and head of IT

awards:
- name: Studienstiftung des deutschen Volkes
description: Full scholarship for outstanding students (German Academic Scholarship Foundation)
date: 2015 - present
date: 2015 - 2023
href: https://studienstiftung.de

memberships:
- name: Cambridge Physical Society
date: 2019 - present
Expand Down
38 changes: 37 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
import { type UserConfig, loadEnv } from 'vite'
import yaml from '@rollup/plugin-yaml'
import { sveltekit } from '@sveltejs/kit/vite'
import type { UserConfig } from 'vite'
import fs from 'fs'
import yamljs from 'js-yaml'

process.env = { ...process.env, ...loadEnv(``, process.cwd()) }

if (!process.env.VITE_GITHUB_TOKEN) {
throw new Error(`VITE_GITHUB_TOKEN is required`)
}

const gh_token = process.env.VITE_GITHUB_TOKEN
const auth = { headers: { Authorization: `token ${gh_token}` } }

async function fetch_github_data() {
const cv = yamljs.load(fs.readFileSync(`src/routes/cv/cv.yml`, `utf8`))

for (const project of cv.projects) {
const handle = project.github.replace(`https://github.com/`, ``)

const repo_promise = await fetch(
`https://api.github.com/repos/${handle}`,
auth,
)

const repo = await repo_promise.json()
project.stars = repo.stargazers_count

const languages = await (
await fetch(`https://api.github.com/repos/${handle}/languages`, auth)
).json()
project.languages = Object.keys(languages)
}

fs.writeFileSync(`src/routes/cv/cv.yml`, yamljs.dump(cv, { lineWidth: -1 }))
}

fetch_github_data()

export default {
plugins: [sveltekit(), yaml()],
Expand Down

0 comments on commit a96437f

Please sign in to comment.