PennyLaneAI / qml

Introductions to key concepts in quantum programming, as well as tutorials and implementations from cutting-edge quantum computing research.
https://pennylane.ai/qml
Apache License 2.0
537 stars 185 forks source link

Support names and usernames in author metadata schema #1089

Closed Mandrenkov closed 5 months ago

Mandrenkov commented 5 months ago

Title:

Adds support for specifying authors in demo metadata via full name or PennyLane profile username.

Summary:

The following metadata file is now accepted by the JSON validator:

{
    "authors": [
        {
            "id": "jack_ceroni"
        },
        {
            "username": "mikhail"
        },
        {
            "name": "Mikhail Andrenkov"
        }
    ]
    // other fields ...
}

Conversely, the metadata file below is not accepted:

{
    "authors": [
        {},  // no matches
        {
            "username": "mikhail",
            "name": "Mikhail Andrenkov"  // extra field
        },
        {
            "username": "mi"  // too short
        },
        {
            "username": "abcdefghijklmnopqrstu"  // too long
        },
        {
            "name": "M"  // too short
        }
    ]
    // other fields ...
}

Relevant references:

N/A

Possible Drawbacks:

  1. If this PR is merged but the decision is later reverted, there will be some extraneous metadata versioning.

Related GitHub Issues:

N/A

github-actions[bot] commented 5 months ago

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

ikurecic commented 5 months ago

Thanks a lot for the tag, @Mandrenkov . This might be unrelated, but I'd like to understand everything to make sure I can follow the setup correctly — in the first example (copied below), what is the id field?

{
    "authors": [
        {
            "id": "jack_ceroni"
        },
        {
            "username": "mikhail"
        },
        {
            "name": "Mikhail Andrenkov"
        }
    ]
    // other fields ...
}
Mandrenkov commented 5 months ago

Not a problem, @ikurecic!

in the first example (copied below), what is the id field?

The id field is part of the author metadata format that is currently used by all demos in this repository. My understanding is that it refers to the file stem of an author in this directory which contains .txt files that have the author's name and bio.

As a whole, the example is meant to show that this PR adds support for the new author metadata format while retaining support for the old format. Eventually, we'll want to drop support for the old format too, but that is later down the line.

ikurecic commented 5 months ago

I see what you mean, @Mandrenkov — it didn't cross my mind that this would still refer to the old/current system. That's great to know and it makes sense to me, thank you!