Skip to content

Commit

Permalink
Merge pull request #37 from wellcomecollection/upgrade-everything
Browse files Browse the repository at this point in the history
Upgrade every package
  • Loading branch information
rcantin-w authored Oct 2, 2024
2 parents 38e810e + fa98b24 commit 6c223e7
Show file tree
Hide file tree
Showing 19 changed files with 6,041 additions and 3,417 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.15.0
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These are default codeowners, later rules take precedence
* @wellcomecollection/developers
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

Wellcome Collection's developer portal, built using [Docusaurus 2](https://docusaurus.io/).

### Installation
## Installation

```
$ yarn
```

### Local Development
## Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build
## Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment
## Deployment

Using SSH:

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/01-exploring-wellcome-collections-apis.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 1. Exploring Wellcome Collection's APIs

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/01-exploring-wellcome-collections-apis.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/01-exploring-wellcome-collections-apis.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/01-exploring-wellcome-collections-apis.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/01-exploring-wellcome-collections-apis.ipynb)

Wellcome collection has a few public APIs which can be used to fetch things like works, images, and concepts. They all live behind the following base URL

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 2. Extracting more data for local analysis

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/02-extracting-more-data-for-local-analysis.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/02-extracting-more-data-for-local-analysis.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/02-extracting-more-data-for-local-analysis.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/02-extracting-more-data-for-local-analysis.ipynb)

In the last notebook, we saw that the `/works` API can do some clever querying and filtering. However, we often have questions which can't be answered by the API by itself. In those cases, it's useful to collect a load of data from the API and then analyse it locally.

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/03-connecting-the-apis-together.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 3. Connecting the APIs together

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/03-connecting-the-apis-together.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/03-connecting-the-apis-together.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/03-connecting-the-apis-together.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/03-connecting-the-apis-together.ipynb)

So far, we've only looked at the `/works` API, but Wellcome Collection has a few more which we can make use of. As well as `/works`, we can also use `/images` and `/concepts`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 4. Building graphs of visually similar images

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/04-building-graphs-of-visually-similar-images.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/04-building-graphs-of-visually-similar-images.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/04-building-graphs-of-visually-similar-images.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/04-building-graphs-of-visually-similar-images.ipynb)

In the last notebook, we introduced the ability to fetch visually similar images using the `/images` API.

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/05-working-with-snapshots-of-the-api.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 5. Working with snapshots of the API

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/05-working-with-snapshots-of-the-api.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/05-working-with-snapshots-of-the-api.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/05-working-with-snapshots-of-the-api.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/05-working-with-snapshots-of-the-api.ipynb)

As we saw at the end of the last notebook, the API limits its responses to 10,000 total results - after that point, users are directed to work with the snapshots. For example, making a request to <https://api.wellcomecollection.org/catalogue/v2/works?pageSize=100&page=101> gives us:
As we saw at the end of the last notebook, the API limits its responses to 10,000 total results - after that point, users are directed to work with the snapshots. For example, making a request to [https://api.wellcomecollection.org/catalogue/v2/works?pageSize=100&page=101](https://api.wellcomecollection.org/catalogue/v2/works?pageSize=100&page=101) gives us:

```json
{
Expand All @@ -28,7 +28,7 @@ import gzip
import io
```

The urls for the snapshots can be found at <https://developers.wellcomecollection.org/docs/datasets>. We're going to work with the `works` snapshot, but all of the logic which follows should be extendable to the images snapshot on that page too!
The urls for the snapshots can be found at [https://developers.wellcomecollection.org/docs/datasets](https://developers.wellcomecollection.org/docs/datasets). We're going to work with the `works` snapshot, but all of the logic which follows should be extendable to the images snapshot on that page too!

Let's start by establishing the url for the compressed snapshot file, and the path where the data is going to be saved.

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/06-visualising-the-collection-on-a-map.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 6. Visualising the collections on a map

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/06-visualising-the-collection-on-a-map.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/06-visualising-the-collection-on-a-map.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/06-visualising-the-collection-on-a-map.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/06-visualising-the-collection-on-a-map.ipynb)

In this notebook, we're going to use a secondary API to visualise the geographical extent of the collection on a map.

The collection contains place names in the `production` field, which describes the time, place, and agents involved in the creation of the work. If we can turn those place names into coordinates, we can visualise the geographical extent of the collection on a map.

We'll use the API at <https://geocode.maps.co/> to handle the complicated geocoding for us.
We'll use the API at [https://geocode.maps.co/](https://geocode.maps.co/) to handle the complicated geocoding for us.


```python
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/07-building-an-image-classifier.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 7. Building an image classifier

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/07-building-an-image-classifier.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/07-building-an-image-classifier.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/07-building-an-image-classifier.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/07-building-an-image-classifier.ipynb)

This notebook is going to race through some high-level concepts in machine learning (specifically, fine-tuning a convolutional neural network). However, our focus will remain on demonstrating the practical uses of the Wellcome Collection API. As such, some important ML topics will be covered in less detail than they deserve, and some will be skipped entirely.
If you're not already familiar with the basics of ML but want to learn more, I'd recommend exploring [Practical Deep Learning for Coders](https://course.fast.ai/) by fast.ai. It describes itself as:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/08-extracting-features-from-text.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 8. Extracting features from text

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/08-extracting-features-from-text.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/08-extracting-features-from-text.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/08-extracting-features-from-text.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/08-extracting-features-from-text.ipynb)

In the last notebook, we saw that using a pre-trained network allowed us to extract features from images, and train a classifier for new categories on top of those features. We can do the same thing with text, using a pre-trained network to extract features from text. In this notebook, we'll use those features the visualise the similarities and differences between works in the collection, and try to find clusters of related material.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 9. Building a recommender system for subjects

[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/09-building-a-recommender-system-for-subjects.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/main/notebooks/09-building-a-recommender-system-for-subjects.ipynb)
[View on GitHub](https://github.com/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/09-building-a-recommender-system-for-subjects.ipynb) | [Run in Google Colab](https://colab.research.google.com/github/wellcomecollection/developers.wellcomecollection.org/blob/upgrade-everything/notebooks/09-building-a-recommender-system-for-subjects.ipynb)

Finally, we'll consider building a recommender system using data from Wellcome Collection. Thes machine learning models work slightly differently to the ones we've seen so far. Rather than being trained to predict a single value, they're trained to predict a whole matrix of interactions between two kinds of entity.

Expand Down
94 changes: 46 additions & 48 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
import { themes } from "prism-react-renderer";

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand All @@ -25,12 +23,12 @@ const config = {
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
remarkPlugins: [require("mdx-mermaid")]
remarkPlugins: [require("mdx-mermaid")],
},
theme: {
customCss: require.resolve("./src/css/custom.css")
}
})
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
[
"redocusaurus",
Expand All @@ -39,30 +37,30 @@ const config = {
{
route: "api/catalogue",
spec: "reference/catalogue.yaml",
layout: { title: "Catalogue API" }
layout: { title: "Catalogue API" },
},
{
route: "api/iiif",
spec: "reference/iiif.yaml",
layout: { title: "IIIF APIs" }
layout: { title: "IIIF APIs" },
},
{
route: "api/content",
spec: "reference/content.yaml",
layout: { title: "Content API" }
layout: { title: "Content API" },
},
// This is currently disabled until the documentation can be improved
{
route: "api/text",
spec: "reference/text.yaml",
layout: { title: "Text API" }
}
layout: { title: "Text API" },
},
],
theme: {
primaryColor: "#007868"
}
}
]
primaryColor: "#007868",
},
},
],
],

themeConfig:
Expand All @@ -75,7 +73,7 @@ const config = {
logo: {
alt: "Wellcome Collection",
src: "images/wellcome-collection-black.svg",
srcDark: "images/wellcome-collection-white.svg"
srcDark: "images/wellcome-collection-white.svg",
},
items: [
{
Expand All @@ -86,29 +84,29 @@ const config = {
items: [
{
to: "api/catalogue",
label: "Catalogue"
label: "Catalogue",
},
{
to: "api/iiif",
label: "IIIF"
label: "IIIF",
},
{
to: "api/content",
label: "Content"
}
label: "Content",
},
// Hidden pending improved docs
// {
// to: "api/text",
// label: "Text",
// },
]
],
},
{
href: "https://github.com/wellcomecollection",
position: "right",
label: "GitHub"
}
]
label: "GitHub",
},
],
},
footer: {
style: "dark",
Expand All @@ -118,67 +116,67 @@ const config = {
items: [
{
label: "API Reference",
to: "docs/api"
}
]
to: "docs/api",
},
],
},
{
title: "Get Involved",
items: [
{
label: "Stacks",
href: "https://stacks.wellcomecollection.org"
href: "https://stacks.wellcomecollection.org",
},
{
label: "GitHub",
href: "https://github.com/wellcomecollection"
}
]
href: "https://github.com/wellcomecollection",
},
],
},
{
title: "Contact Us",
items: [
{
label: "Twitter",
href: "https://twitter.com/ExploreWellcome"
href: "https://twitter.com/ExploreWellcome",
},
{
label: "Facebook",
href: "https://www.facebook.com/wellcomecollection"
href: "https://www.facebook.com/wellcomecollection",
},
{
label: "Email",
href: "mailto:[email protected]"
}
]
href: "mailto:[email protected]",
},
],
},
{
title: "More",
items: [
{
label: "Jobs",
href: "https://wellcome.org/jobs"
href: "https://wellcome.org/jobs",
},
{
label: "Privacy",
href: "https://wellcome.org/who-we-are/privacy-and-terms"
href: "https://wellcome.org/who-we-are/privacy-and-terms",
},
{
label: "Wellcome Collection",
href: "https://wellcomecollection.org"
}
]
}
href: "https://wellcomecollection.org",
},
],
},
],
copyright: `Except where otherwise noted, content on this site is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International Licence</a>.`
copyright: `Except where otherwise noted, content on this site is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International Licence</a>.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme
}
theme: themes.vsLight,
darkTheme: themes.vsDark,
},
}),

plugins: []
plugins: [],
};

module.exports = config;
4 changes: 2 additions & 2 deletions notebooks/05-working-with-snapshots-of-the-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# 5. Working with snapshots of the API\n",
"\n",
"As we saw at the end of the last notebook, the API limits its responses to 10,000 total results - after that point, users are directed to work with the snapshots. For example, making a request to <https://api.wellcomecollection.org/catalogue/v2/works?pageSize=100&page=101> gives us:\n",
"As we saw at the end of the last notebook, the API limits its responses to 10,000 total results - after that point, users are directed to work with the snapshots. For example, making a request to [https://api.wellcomecollection.org/catalogue/v2/works?pageSize=100&page=101](https://api.wellcomecollection.org/catalogue/v2/works?pageSize=100&page=101) gives us:\n",
"\n",
"```json\n",
"{\n",
Expand Down Expand Up @@ -43,7 +43,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The urls for the snapshots can be found at <https://developers.wellcomecollection.org/docs/datasets>. We're going to work with the `works` snapshot, but all of the logic which follows should be extendable to the images snapshot on that page too!\n",
"The urls for the snapshots can be found at [https://developers.wellcomecollection.org/docs/datasets](https://developers.wellcomecollection.org/docs/datasets). We're going to work with the `works` snapshot, but all of the logic which follows should be extendable to the images snapshot on that page too!\n",
"\n",
"Let's start by establishing the url for the compressed snapshot file, and the path where the data is going to be saved."
]
Expand Down
2 changes: 1 addition & 1 deletion notebooks/06-visualising-the-collection-on-a-map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"\n",
"The collection contains place names in the `production` field, which describes the time, place, and agents involved in the creation of the work. If we can turn those place names into coordinates, we can visualise the geographical extent of the collection on a map.\n",
"\n",
"We'll use the API at <https://geocode.maps.co/> to handle the complicated geocoding for us."
"We'll use the API at [https://geocode.maps.co/](https://geocode.maps.co/) to handle the complicated geocoding for us."
]
},
{
Expand Down
Loading

0 comments on commit 6c223e7

Please sign in to comment.