From a493fb436f3d5920062a0f3d35f2e4000ed271b2 Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Thu, 28 Nov 2024 14:24:36 +0100 Subject: [PATCH 1/5] Added pre-commit hook for cff file validation --- .pre-commit-config.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f559068..d9223fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,10 +4,15 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - - id: check-merge-conflict # checks for files that contain merge conflict strings - - id: check-toml # checks toml files for parseable syntax - - id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source + - id: check-merge-conflict # checks for files that contain merge conflict strings + - id: check-toml # checks toml files for parseable syntax + - id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source +- repo: https://github.com/citation-file-format/cffconvert + rev: 054bda51dbe278b3e86f27c890e3f3ac877d616c + hooks: + - id: validate-cff + - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.7.4 hooks: From a99ef2b4b6c55c39cf781f653e7136b34fff6da5 Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Thu, 28 Nov 2024 14:27:55 +0100 Subject: [PATCH 2/5] Added CITATION.cff and updated LICENSE Package credits are now handled in CITATION.cff. The collective term "The hdf5view Developers" is used to describe all contributors to the software. The LICENSE file has been updated accordingly. --- CITATION.cff | 23 +++++++++++++++++++++++ LICENSE | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..2dd042a --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,23 @@ +authors: + - family-names: Swarbrick + given-names: Martin + - family-names: Woodcock + given-names: Thomas George + orcid: "https://orcid.org/0000-0003-2351-973X" + affiliation: "Leibniz Institute for Solid State and Materials Research (ROR: https://ror.org/04zb59n70)" + - name: The hdf5view Developers + website: "https://github.com/tgwoodcock/hdf5view/graphs/contributors" +cff-version: 1.2.0 +date-released: "2024-11-28" +keywords: + - research + - data + - plantuml + - chada + - moda + - workflow +license: MIT +message: "Please use these metadata in any citations of the software." +repository-code: "https://github.com/tgwoodcock/hdf5view" +title: "hdf5view" +version: 0.2.1 diff --git a/LICENSE b/LICENSE index 00ef20e..cc0910f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Martin Swarbrick +Copyright (c) 2019 The hdf5view Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 54dc99602c131830b0b0610a064fe67b1559cfc2 Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Thu, 28 Nov 2024 14:38:36 +0100 Subject: [PATCH 3/5] Update MainWindow.handle_open_about() --- src/hdf5view/mainwindow.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hdf5view/mainwindow.py b/src/hdf5view/mainwindow.py index 4880864..39a4a38 100644 --- a/src/hdf5view/mainwindow.py +++ b/src/hdf5view/mainwindow.py @@ -4,6 +4,7 @@ """ import os +from datetime import datetime import h5py from qtpy import API_NAME @@ -404,12 +405,22 @@ def handle_open_prefs(self): def handle_open_about(self): """Show the about dialog.""" + y = datetime.now().year + url1 = "https://github.com/tgwoodcock/hdf5view/graphs/contributors" + url2 = "https://github.com/tgwoodcock/hdf5view/blob/main/LICENSE" + url3 = "https://github.com/tgwoodcock/hdf5view/blob/main/CITATION.cff" + url4 = "https://github.com/tgwoodcock/hdf5view" + s1 = "The hdf5view Developers" + s2 = "Distributed under the terms of the" QMessageBox.about( self, f"About {WINDOW_TITLE}", ( - f"

HDF5View {__version__}

" - "

Copyright(c) 2019 - Martin Swarbrick

" + f"

hdf5view {__version__}

" + f"

Copyright(c) 2019-{y} {s1}

" + f"

{s2} MIT License

" + f"

Citation metadata: CITATION.cff

" + f"

Source code: github repository

" ), ) From 4cd96625154f6921ff2ed4f425cfad8db2ff8034 Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Thu, 28 Nov 2024 14:44:41 +0100 Subject: [PATCH 4/5] Updated docs The new method for package credits with CITATION.cff is now mentioned in the Contributing guide in the docs. --- docs/conf.py | 2 +- docs/dev/contribution_credits.rst | 14 ++++++++++++++ docs/dev/index.rst | 3 ++- ...view.mainwindow.MainWindow.handle_open_docs.rst | 6 ++++++ .../generated/hdf5view.mainwindow.MainWindow.rst | 3 +++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 docs/dev/contribution_credits.rst create mode 100644 docs/reference/generated/hdf5view.mainwindow.MainWindow.handle_open_docs.rst diff --git a/docs/conf.py b/docs/conf.py index acc8034..069bd50 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = "hdf5view" -author = "hdf5view developers" +author = "The hdf5view Developers" copyright = f"2019-%Y, {author}" release = hdf5view.__version__ version = hdf5view.__version__ diff --git a/docs/dev/contribution_credits.rst b/docs/dev/contribution_credits.rst new file mode 100644 index 0000000..6894e56 --- /dev/null +++ b/docs/dev/contribution_credits.rst @@ -0,0 +1,14 @@ +==================== +Contribution Credits +==================== + +We maintain a `Citation File Format (CFF) `_ file: +`CITATION.cff `_ in order to +give credit to contributors and to provide metadata for citing hdf5view. + +Under the ``Authors`` key, the initial author is listed first, followed by the current project host and maintainer, then +the collective term ``The hdf5view Developers``, which includes all contributors to hdf5view as shown in the +`contributors graph of the repository `_. + +If you are one of ``The hdf5view Developers`` and would prefer to be additionally named as an author, in ``CITATION.cff`` please +open an `issue `_. diff --git a/docs/dev/index.rst b/docs/dev/index.rst index dc0cd55..4535397 100644 --- a/docs/dev/index.rst +++ b/docs/dev/index.rst @@ -14,4 +14,5 @@ If you would like to contribute code, such as fixing a bug or adding a new featu installing_a_development_environment code_style - using_git \ No newline at end of file + using_git + contribution_credits \ No newline at end of file diff --git a/docs/reference/generated/hdf5view.mainwindow.MainWindow.handle_open_docs.rst b/docs/reference/generated/hdf5view.mainwindow.MainWindow.handle_open_docs.rst new file mode 100644 index 0000000..cda7203 --- /dev/null +++ b/docs/reference/generated/hdf5view.mainwindow.MainWindow.handle_open_docs.rst @@ -0,0 +1,6 @@ +handle\_open\_docs +================== + +.. currentmodule:: hdf5view.mainwindow + +.. automethod:: MainWindow.handle_open_docs \ No newline at end of file diff --git a/docs/reference/generated/hdf5view.mainwindow.MainWindow.rst b/docs/reference/generated/hdf5view.mainwindow.MainWindow.rst index d3949ca..37c2d35 100644 --- a/docs/reference/generated/hdf5view.mainwindow.MainWindow.rst +++ b/docs/reference/generated/hdf5view.mainwindow.MainWindow.rst @@ -170,6 +170,9 @@ MainWindow.handle_open_about + MainWindow.handle_open_docs + + MainWindow.handle_open_file From 48c1bc6c9fa84538ccce7967007d96306fe2642b Mon Sep 17 00:00:00 2001 From: tgwoodcock Date: Thu, 28 Nov 2024 15:01:26 +0100 Subject: [PATCH 5/5] Updated CHANGELOG.rst and bumped the version --- CHANGELOG.rst | 16 ++++++++++++++++ src/hdf5view/__init__.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 86210b2..e2632b8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,22 @@ its best to adhere to `Semantic Versioning Fixed ----- +0.2.1 (2024-11-28) +================== + +Added +----- + +- CITATION.cff to record contribution credits and hold metadata for citations. See `Citation File Format (CFF) `_ for further information. The collective term ``The hdf5view Developers`` has been defined, which includes all contributors to hdf5view as shown in the + `contributors graph of the repository `_. +- Pre-commit hook to ensure that the CITATION.cff is correctly formatted. + +Changed +------- + +- Updated the documentation so that the new method of recording package credits is explained in the Contributing guide. +- Updated the LICENSE file and ``About...`` entry in the ``Help`` menu of the application to reflect the new method of recording package credits. + 0.2.0 (2024-11-25) ================== diff --git a/src/hdf5view/__init__.py b/src/hdf5view/__init__.py index 2f491f0..62b4de4 100644 --- a/src/hdf5view/__init__.py +++ b/src/hdf5view/__init__.py @@ -1,3 +1,3 @@ """hdf5view: a simple viewer for HDF5 files.""" -__version__ = "0.2.0" +__version__ = "0.2.1"