From b9b658d15151ac3069775c23bcb299f8e34ce49e Mon Sep 17 00:00:00 2001 From: Rubel Date: Mon, 23 Sep 2024 13:51:21 +0200 Subject: [PATCH 1/6] Include citation as a draft. --- .github/workflows/check_citation.yaml | 55 +++++++++++++++++++++++++++ .github/workflows/publish.yml | 20 ++++++++++ CITATION.cff | 33 ++++++++++++++++ README.md | 1 + src/pynxtools_xps/__init__.py | 2 + 5 files changed, 111 insertions(+) create mode 100644 .github/workflows/check_citation.yaml create mode 100644 CITATION.cff diff --git a/.github/workflows/check_citation.yaml b/.github/workflows/check_citation.yaml new file mode 100644 index 00000000..1f112d98 --- /dev/null +++ b/.github/workflows/check_citation.yaml @@ -0,0 +1,55 @@ +name: Version Check + +on: + push: + branches: + - 'main' + pull_request: + branches: + - 'main' + +jobs: + check-version: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install .[dev] + + # Check if the CITATION.cff file is valid + - name: Validate CITATION.cff + run: | + cffconvert --validate + - name: Package version + id: package_version + run: | + PACKAGE_VERSION=$(python -c "import pynxtools_xps; print(pynxtools_xps.__version__)") + echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV + echo "Version from __init__.py: $PACKAGE_VERSION" + + - name: Citation version + id: citation_version + run: | + # Parse the version from the CITATION.cff file) + CITATION_VERSION=$(grep '^version:' CITATION.cff | cut -d' ' -f2) + echo "CITATION_VERSION=$CITATION_VERSION" >> $GITHUB_ENV + echo "Version from CITATION.cff: $CITATION_VERSION" + + - name: Compare versions + run: | + if [ "$PACKAGE_VERSION" != "$CITATION_VERSION" ]; then + echo "Version mismatch: package version is $PACKAGE_VERSION, CITATION.cff version is $CITATION_VERSION" + exit 1 + fi + echo "All versions match: $GIT_TAG_VERSION" + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 019fe009..d23d8754 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,6 +36,26 @@ jobs: run: | curl -LsSf https://astral.sh/uv/install.sh | sh uv pip install build + - name: Git tag version + id: git_tag_version + run: | + # Extract the version from the tag (e.g., 'v1.0.0' becomes '1.0.0') + GIT_TAG_VERSION=${GITHUB_REF#refs/tags/v} + echo "GIT_TAG_VERSION=$GIT_TAG_VERSION" >> $GITHUB_ENV + echo "Version from Git tag: $GIT_TAG_VERSION" + - name: Citation version + id: citation_version + run: | + # Parse the version from the CITATION.cff file + CITATION_VERSION=$(grep '^version:' CITATION.cff | cut -d' ' -f2) + echo "CITATION_VERSION=$CITATION_VERSION" >> $GITHUB_ENV + echo "Version from CITATION.cff: $CITATION_VERSION" + - name: Compare versions + run: | + if [ "$GIT_TAG_VERSION" != "$CITATION_VERSION" ]; then + echo "Version mismatch: Git tag version is $GIT_TAG_VERSION, CITATION.cff version is $CITATION_VERSION" + exit 1 + fi - name: Build package run: python -m build - name: Publish package distributions to PyPI diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..3f38a3af --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,33 @@ +cff-version: 1.2.0 +title: A pynxtools plugin for XPS (X-ray Photoelectron Spectroscopy) data readers +message: + If you use this software, please cite it using the + metadata from this file. +type: software +version: 0.4.3 +authors: + - given-names: Lukas + family-names: Pielsticker + orcid: 'https://orcid.org/0000-0001-9361-8333' + - given-names: Rubel + family-names: Mozumder + orcid: 'https://orcid.org/0009-0007-5926-6646' + - given-names: Florian + family-names: Dobener + orcid: 'https://orcid.org/0000-0003-1987-6224' + - given-names: Sandor + family-names: Brockhauser + orcid: 'https://orcid.org/0000-0002-9700-4803' +# NOTE: After publishing this software in zenodo, replace add DOI and URL +# Each indivisual version has a own doi, but DOI should be the all version +# doi that will always points to the latest version +# of the release. Similarly, zenodo will provide single URL for the published +# software. +doi: TODO +repository-code: 'https://github.com/FAIRmat-NFDI/pynxtools-xps' +url: TODO +abstract: + TODO: Add abstract + + +license: Apache-2.0 \ No newline at end of file diff --git a/README.md b/README.md index 67eb3d67..004d2b5b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ ![](https://img.shields.io/pypi/l/pynxtools-xps) ![](https://img.shields.io/pypi/v/pynxtools-xps) ![](https://coveralls.io/repos/github/FAIRmat-NFDI/pynxtools_xps/badge.svg?branch=main) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1323437.svg)]() # A reader for XPS data diff --git a/src/pynxtools_xps/__init__.py b/src/pynxtools_xps/__init__.py index db96892b..d917117b 100644 --- a/src/pynxtools_xps/__init__.py +++ b/src/pynxtools_xps/__init__.py @@ -15,3 +15,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +__version__ = "0.4.3" From 3378005e499516c60b0adb98f9617731ea153800 Mon Sep 17 00:00:00 2001 From: Rubel Date: Mon, 23 Sep 2024 14:30:08 +0200 Subject: [PATCH 2/6] add cffconvert to check if cff file is valid. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 33548a47..5a8388e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ dev = [ "types-requests", "uv", "pre-commit", + "cffconvert" ] docs = [ "mkdocs", From adb6d5ea76719fdfa0ab87079dfbaeb660ba0e8c Mon Sep 17 00:00:00 2001 From: Rubel Date: Mon, 23 Sep 2024 14:38:19 +0200 Subject: [PATCH 3/6] add cffconvert to check if cff file is valid. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5a8388e8..e553dc49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ dev = [ "types-requests", "uv", "pre-commit", - "cffconvert" + "cffconvert" # validates CITATION.cff ] docs = [ "mkdocs", From ff9183364a19848b2a6fc53563f5a75a911a236b Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:37:10 +0200 Subject: [PATCH 4/6] add abstract and authors to CITATION.cff --- CITATION.cff | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 3f38a3af..9d185df8 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,10 +1,9 @@ cff-version: 1.2.0 -title: A pynxtools plugin for XPS (X-ray Photoelectron Spectroscopy) data readers +title: A pynxtools reader plugin for X-ray photoelectron spectroscopy (XPS) data message: If you use this software, please cite it using the metadata from this file. type: software -version: 0.4.3 authors: - given-names: Lukas family-names: Pielsticker @@ -15,19 +14,33 @@ authors: - given-names: Florian family-names: Dobener orcid: 'https://orcid.org/0000-0003-1987-6224' + - given-names: Walid + family-names: Hetaba + orcid: 'https://orcid.org/0000-0003-4728-0786' + - given-names: Laurenz + family-names: Rettig + orcid: 'https://orcid.org/0000-0002-0725-6696' - given-names: Sandor family-names: Brockhauser orcid: 'https://orcid.org/0000-0002-9700-4803' -# NOTE: After publishing this software in zenodo, replace add DOI and URL -# Each indivisual version has a own doi, but DOI should be the all version -# doi that will always points to the latest version -# of the release. Similarly, zenodo will provide single URL for the published -# software. doi: TODO repository-code: 'https://github.com/FAIRmat-NFDI/pynxtools-xps' url: TODO +keywords: + - X-ray Photoelectron Spectroscopy + - NOMAD + - pynxtools + - NeXus abstract: - TODO: Add abstract - + pynxtools-xps is a reader plugin for pynxtools (https://github.com/FAIRmat-NFDI/pynxtools) + written in Python. pynxtools-xps is a tool for reading and translating data from various + propietary and open data formats from technology partners and the wider X-ray photoelectron spectroscopy + community and standardizing it such that it is compliant with the NeXus application definition NXmpes and NXxps + (https://fairmat-nfdi.github.io/nexus_definitions/). + + pynxtools-xps is developed both as a standalone reader and as a tool within NOMAD, an open-source data + management platform for materials science ((https://nomad-lab.eu/nomad-lab/). + The work is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 460197019 (FAIRmat) + (https://gepris.dfg.de/gepris/projekt/460197019?language=en). license: Apache-2.0 \ No newline at end of file From 0f1853b52799863509efe9fc7330107b8409a7f1 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:25:27 +0200 Subject: [PATCH 5/6] remove unneeded paths --- .github/workflows/check_citation.yaml | 55 --------------------------- .github/workflows/publish.yml | 20 ---------- CITATION.cff | 10 ++--- pyproject.toml | 1 - src/pynxtools_xps/__init__.py | 2 - 5 files changed, 5 insertions(+), 83 deletions(-) delete mode 100644 .github/workflows/check_citation.yaml diff --git a/.github/workflows/check_citation.yaml b/.github/workflows/check_citation.yaml deleted file mode 100644 index 1f112d98..00000000 --- a/.github/workflows/check_citation.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: Version Check - -on: - push: - branches: - - 'main' - pull_request: - branches: - - 'main' - -jobs: - check-version: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install .[dev] - - # Check if the CITATION.cff file is valid - - name: Validate CITATION.cff - run: | - cffconvert --validate - - name: Package version - id: package_version - run: | - PACKAGE_VERSION=$(python -c "import pynxtools_xps; print(pynxtools_xps.__version__)") - echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV - echo "Version from __init__.py: $PACKAGE_VERSION" - - - name: Citation version - id: citation_version - run: | - # Parse the version from the CITATION.cff file) - CITATION_VERSION=$(grep '^version:' CITATION.cff | cut -d' ' -f2) - echo "CITATION_VERSION=$CITATION_VERSION" >> $GITHUB_ENV - echo "Version from CITATION.cff: $CITATION_VERSION" - - - name: Compare versions - run: | - if [ "$PACKAGE_VERSION" != "$CITATION_VERSION" ]; then - echo "Version mismatch: package version is $PACKAGE_VERSION, CITATION.cff version is $CITATION_VERSION" - exit 1 - fi - echo "All versions match: $GIT_TAG_VERSION" - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d23d8754..019fe009 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,26 +36,6 @@ jobs: run: | curl -LsSf https://astral.sh/uv/install.sh | sh uv pip install build - - name: Git tag version - id: git_tag_version - run: | - # Extract the version from the tag (e.g., 'v1.0.0' becomes '1.0.0') - GIT_TAG_VERSION=${GITHUB_REF#refs/tags/v} - echo "GIT_TAG_VERSION=$GIT_TAG_VERSION" >> $GITHUB_ENV - echo "Version from Git tag: $GIT_TAG_VERSION" - - name: Citation version - id: citation_version - run: | - # Parse the version from the CITATION.cff file - CITATION_VERSION=$(grep '^version:' CITATION.cff | cut -d' ' -f2) - echo "CITATION_VERSION=$CITATION_VERSION" >> $GITHUB_ENV - echo "Version from CITATION.cff: $CITATION_VERSION" - - name: Compare versions - run: | - if [ "$GIT_TAG_VERSION" != "$CITATION_VERSION" ]; then - echo "Version mismatch: Git tag version is $GIT_TAG_VERSION, CITATION.cff version is $CITATION_VERSION" - exit 1 - fi - name: Build package run: python -m build - name: Publish package distributions to PyPI diff --git a/CITATION.cff b/CITATION.cff index 9d185df8..2ce3151c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -19,7 +19,7 @@ authors: orcid: 'https://orcid.org/0000-0003-4728-0786' - given-names: Laurenz family-names: Rettig - orcid: 'https://orcid.org/0000-0002-0725-6696' + orcid: 'https://orcid.org/0000-0002-0725-6696' - given-names: Sandor family-names: Brockhauser orcid: 'https://orcid.org/0000-0002-9700-4803' @@ -33,12 +33,12 @@ keywords: - NeXus abstract: pynxtools-xps is a reader plugin for pynxtools (https://github.com/FAIRmat-NFDI/pynxtools) - written in Python. pynxtools-xps is a tool for reading and translating data from various + written in Python. pynxtools-xps is a tool for reading and translating data from various propietary and open data formats from technology partners and the wider X-ray photoelectron spectroscopy community and standardizing it such that it is compliant with the NeXus application definition NXmpes and NXxps - (https://fairmat-nfdi.github.io/nexus_definitions/). - - pynxtools-xps is developed both as a standalone reader and as a tool within NOMAD, an open-source data + (https://fairmat-nfdi.github.io/nexus_definitions/). + + pynxtools-xps is developed both as a standalone reader and as a tool within NOMAD, an open-source data management platform for materials science ((https://nomad-lab.eu/nomad-lab/). The work is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 460197019 (FAIRmat) diff --git a/pyproject.toml b/pyproject.toml index e553dc49..33548a47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,6 @@ dev = [ "types-requests", "uv", "pre-commit", - "cffconvert" # validates CITATION.cff ] docs = [ "mkdocs", diff --git a/src/pynxtools_xps/__init__.py b/src/pynxtools_xps/__init__.py index d917117b..db96892b 100644 --- a/src/pynxtools_xps/__init__.py +++ b/src/pynxtools_xps/__init__.py @@ -15,5 +15,3 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -__version__ = "0.4.3" From 554c5b33e0b866b29c3606700dbcfde04ecc8e70 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:27:52 +0200 Subject: [PATCH 6/6] temporarily deactivate Zenodo badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 004d2b5b..458c2f29 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ![](https://img.shields.io/pypi/l/pynxtools-xps) ![](https://img.shields.io/pypi/v/pynxtools-xps) ![](https://coveralls.io/repos/github/FAIRmat-NFDI/pynxtools_xps/badge.svg?branch=main) -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1323437.svg)]() + # A reader for XPS data