8000 Fix schema versions by edan-bainglass · Pull Request #506 · aiidalab/aiidalab · GitHub
[go: up one dir, main page]

Skip to content

Fix schema versions - #506

Merged
edan-bainglass merged 7 commits into
aiidalab:mainfrom
edan-bainglass:fix-schema-versions
May 13, 2026
Merged

edan-bainglass merged 7 commits into
aiidalab:mainfrom
edan-bainglass:fix-schema-versions

Conversation

@edan-bainglass
@edan-bainglass edan-bainglass commented May 11, 2026 •
Copy link
Copy Markdown
Member

#499 didn't fully handle citations correctly/safely. Here, I add a proper Citation schema and update the handler (backend/frontend).

Schemas are pinned for now to the involved branches (here, in the registry repo, and in the QE app, which I'm using as a tester). Once all is well, schemas should pin to... TBD (see#505).

image

Update

This PR adds dedicated dataclasses to represent two citation flavors:

@dataclass
class SimpleCitation:
    """App citation specification for free-form text with an optional link."""

    text: str
    link: str | None = None


@dataclass
class StandardCitation:
    """App citation specification for structured metadata."""

    authors: list[str]
    journal: str
    year: str
    doi: str
    title: str | None = None
    issue: str | None = None
    volume: str | None = None

Citations are consumed via a either a plugin's [aiidalab] or [metadata] sections in an app's setup.cfg (aiidalab first):

    citations = aiidalab.get("citations", metadata_pep426.get("citations", "[]"))
    yield "citations", json.loads(citations)

Citations can be overridden via apps.yaml (no change here).

Example from the QE app:

[aiidalab]
title = Quantum ESPRESSO
description = The Quantum ESPRESSO (QE) app is a web-based interface within AiiDAlab that allows users to perform first-principles calculations and analyze material properties (e.g., band structures) directly from their browser.
citations =
    [
      {
        "authors": ["Wang, X.", "Bainglass, E.", "Bonacci, M.", "Ortega-Guerrero, A.", "et al."],
        "title": "Making atomistic materials calculations accessible with the AiiDAlab Quantum ESPRESSO app",
        "journal": "npj Comput. Mater.",
        "volume": "12",
        "pages": "72",
        "year": "2026",
        "doi": "10.1038/s41524-025-01936-4"
      }
    ]
categories =
    quantum

@codecov
codecov Bot commented May 11, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.42%. Comparing base (29badaa) to head (6589e43).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #506      +/-   ##
==========================================
+ Coverage   72.23%   72.42%   +0.18%     
==========================================
  Files          18       18              
  Lines        1628     1650      +22     
==========================================
+ Hits         1176     1195      +19     
- Misses        452      455       +3     
Flag Coverage Δ
py-3.12 72.42% <100.00%> (+0.18%) ⬆️
py-3.9 72.42% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edan-bainglass
Copy link
Copy Markdown
Member Author

@danielhollas tests pass. If you agree with this change, I will update the relevant repos accordingly. Please also address my questions in #505 w.r.t commit pinning 🙏

@danielhollas
Copy link
Copy Markdown
Contributor

@edan-bainglass tbh I am not sure I am a fan of this change, it seems overly complicated, and at the same time restricts on how the citations must look like. What if I want to cite something that's not a journal article, or doesn't have a DOI? I liked your original idea of having citation as a string, and a separate "citation_url" field that we'll convert to a link. What do you think?

@edan-bainglass
Copy link
Copy Markdown
Member Author

@edan-bainglass tbh I am not sure I am a fan of this change, it seems overly complicated, and at the same time restricts on how the citations must look like. What if I want to cite something that's not a journal article, or doesn't have a DOI? I liked your original idea of having citation as a string, and a separate "citation_url" field that we'll convert to a link. What do you think?

Thanks @danielhollas. I'd like to support both. See last commit 🙏

@danielhollas danielhollas left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks reasonable by a quick review while enjoying sunny Scotland :-)

@danielhollas
Copy link
Copy Markdown
Contributor

@edan-bainglass once you update this PR and merge it, you can then make a release by checking out the main branch (don't forget to pull latest changes) and run:

❯ bumpver update --dry --patch
INFO    - fetching tags from remote (to turn off use: -n / --no-fetch)
INFO    - Latest version from VCS tag: v26.05.0 
INFO    - Working dir version        : v26.05.0
INFO    - Old Version: v26.05.0
INFO    - New Version: v26.05.1
--- aiidalab/__init__.py
+++ aiidalab/__init__.py
@@ -4,5 +4,5 @@
 
 __all__ = ["DEVELOP_MODE"]
 
-__version__ = "26.5.0"
+__version__ = "26.5.1"
 
--- pyproject.toml
+++ pyproject.toml
@@ -111,7 +111,7 @@
 disallow_any_generics = false
 
 [tool.bumpver]
-current_version = "v26.05.0"
+current_version = "v26.05.1"
 version_pattern = "v0Y.0M.PATCH[PYTAGNUM]"
 commit_message = "Bump version {old_version} -> {new_version}"
 commit = true

Removing the --dry parameter will then actually make a commit, tag it and push it to github.

@edan-bainglass
edan-bainglass merged commit 87310a9 into aiidalab:main May 13, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0