diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..56fd229 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,17 @@ +# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY +_commit: 3f79959 +_src_path: gh:scipp/copier_template +description: 'Python package to read McStas data and export as python objects in different + formats or as other files. + + + ' +max_python: '3.12' +min_python: '3.10' +namespace_package: '' +nightly_deps: scipp,scippnexus,mcstasscript +orgname: mccode-dev +prettyname: McStasToX +projectname: mcstastox +related_projects: Scipp,ScippNexus +year: 2025 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4111e60..5a7dbe6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,16 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + # Note: We are not listing package-ecosystem: "github-actions". This causes + # noise in all template instances. Instead dependabot.yml in scipp/copier_template + # triggers updates of github-actions in the *template*. We then use `copier update` + # in template instances. + - package-ecosystem: "pip" + directory: "/requirements" schedule: interval: "weekly" target-branch: "main" + allow: + - dependency-name: "scipp" + dependency-type: "direct" + - dependency-name: "mcstasscript" + dependency-type: "direct" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..110620d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: + - main + - release + pull_request: + +jobs: + # formatting: + # name: Formatting and static analysis + # runs-on: 'ubuntu-24.04' + # outputs: + # min_python: ${{ steps.vars.outputs.min_python }} + # min_tox_env: ${{ steps.vars.outputs.min_tox_env }} + # steps: + # - uses: actions/checkout@v4 + # - name: Get Python version for other CI jobs + # id: vars + # run: | + # echo "min_python=$(< .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT" + # echo "min_tox_env=py$(sed 's/\.//g' < .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT" + # - uses: actions/setup-python@v5 + # with: + # python-version-file: '.github/workflows/python-version-ci' + # - uses: pre-commit/action@v3.0.1 + # with: + # extra_args: --all-files + # - uses: pre-commit-ci/lite-action@v1.1.0 + # if: always() + # with: + # msg: Apply automatic formatting + + # tests: + # name: Tests + # needs: formatting + # strategy: + # matrix: + # os: ['ubuntu-24.04'] + # python: + # - version: '${{needs.formatting.outputs.min_python}}' + # tox-env: '${{needs.formatting.outputs.min_tox_env}}' + # uses: ./.github/workflows/test.yml + # with: + # os-variant: ${{ matrix.os }} + # python-version: ${{ matrix.python.version }} + # tox-env: ${{ matrix.python.tox-env }} + # secrets: inherit + + docs: + # needs: tests + uses: ./.github/workflows/docs.yml + with: + publish: false + linkcheck: ${{ github.ref == 'refs/heads/main' }} + branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }} + secrets: inherit diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..f694327 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,100 @@ +name: Docs + +on: + workflow_dispatch: + inputs: + publish: + default: false + type: boolean + version: + default: '' + required: false + type: string + branch: + description: 'Branch/tag with documentation source. If not set, the current branch will be used.' + default: '' + required: false + type: string + workflow_call: + inputs: + publish: + default: false + type: boolean + version: + default: '' + required: false + type: string + branch: + description: 'Branch/tag with documentation source. If not set, the current branch will be used.' + default: '' + required: false + type: string + linkcheck: + description: 'Run the link checker. If not set the link checker will not be run.' + default: false + required: false + type: boolean + +env: + VERSION: ${{ inputs.version }} + +jobs: + docs: + name: Build documentation + runs-on: 'ubuntu-24.04' + env: + ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }} + ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }} + DOCSWORKDIR: ".tox/docs" + steps: + # - run: sudo apt install --yes graphviz pandoc + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + fetch-depth: 0 # history required so cmake can determine version + - uses: actions/setup-python@v5 + with: + python-version-file: '.github/workflows/python-version-ci' + - uses: mamba-org/setup-micromamba@v2 + with: + init-shell: bash + environment-name: mcstas + create-args: >- + python=3.10 + + # Manually building the docs. + # We(I) couldn't figure out how we do it with `tox` yet... + - run: mkdir -p ${DOCSWORKDIR} + # - run: python -m pip install -r requirements/ci.txt + - run: | + which python + python -m pip install --upgrade pip + python -m pip install -r requirements/docs.txt + micromamba install -c conda-forge mcstas=3.5 -y + shell: micromamba-shell {0} + - run: | + mcstas --version + python -m sphinx -j2 -v -b html -d ${DOCSWORKDIR}/docs_doctrees docs html + python -m sphinx -j2 -v -b doctest -d ${DOCSWORKDIR}/docs_doctrees docs html + # tox -e releasedocs -- "${VERSION}" + find html -type f -name "*.ipynb" -not -path "html/_sources/*" -delete + shell: micromamba-shell {0} + # Cleaned up the docs. + # - run: tox -e docs + # if: ${{ inputs.version == '' }} + - run: tox -e linkcheck + if: ${{ inputs.linkcheck }} + - uses: actions/upload-artifact@v4 + id: artifact-upload-step + with: + name: docs_html + path: html/ + - run: echo "::notice::https://remote-unzip.deno.dev/${{ github.repository }}/artifacts/${{ steps.artifact-upload-step.outputs.artifact-id }}" + + - uses: JamesIves/github-pages-deploy-action@v4.7.3 + if: ${{ inputs.publish }} + with: + branch: gh-pages + folder: html + single-commit: true diff --git a/.github/workflows/python-version-ci b/.github/workflows/python-version-ci new file mode 100644 index 0000000..c8cfe39 --- /dev/null +++ b/.github/workflows/python-version-ci @@ -0,0 +1 @@ +3.10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ca40b25 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,79 @@ +name: Test + +on: + workflow_dispatch: + inputs: + os-variant: + default: 'ubuntu-24.04' + type: string + python-version: + type: string + tox-env: + default: 'test' + type: string + pip-recipe: + default: 'requirements/ci.txt' + type: string + coverage-report: + default: false + type: boolean + checkout_ref: + default: '' + type: string + workflow_call: + inputs: + os-variant: + default: 'ubuntu-24.04' + type: string + python-version: + type: string + tox-env: + default: 'test' + type: string + pip-recipe: + default: 'requirements/ci.txt' + type: string + coverage-report: + default: false + type: boolean + checkout_ref: + default: '' + type: string + +jobs: + package-test: + runs-on: ${{ inputs.os-variant }} + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.checkout_ref }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + - run: python -m pip install --upgrade pip + - run: python -m pip install . + - run: python tests/package_test.py + name: Run package tests + + test: + runs-on: ${{ inputs.os-variant }} + env: + ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }} + ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }} + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.checkout_ref }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + - run: python -m pip install --upgrade pip + - run: python -m pip install -r ${{ inputs.pip-recipe }} + - run: tox -e ${{ inputs.tox-env }} + - uses: actions/upload-artifact@v4 + if: ${{ inputs.coverage-report }} + with: + name: CoverageReport + path: coverage_html/ diff --git a/.gitignore b/.gitignore index ef87fbb..6b65cb5 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ docs/generated/ *.c *.instr *.out +*.dSYM diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa1c43a..e33cf5f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,16 +5,16 @@ Welcome to the developer side of McStasToX! Contributions are always welcome. This includes reporting bugs or other issues, submitting pull requests, requesting new features, etc. -If you need help with using McStasToX or contributing to it, have a look at the GitHub [discussions](https://github.com/mccode-dev/McStasToX/discussions) and start a new [Q&A discussion](https://github.com/mccode-dev/McStasToX/discussions/categories/q-a) if you can't find what you are looking for. +If you need help with using McStasToX or contributing to it, have a look at the GitHub [discussions](https://github.com/mccode-dev/mcstastox/discussions) and start a new [Q&A discussion](https://github.com/mccode-dev/mcstastox/discussions/categories/q-a) if you can't find what you are looking for. -For bug reports and other problems, please open an [issue](https://github.com/mccode-dev/McStasToX/issues/new) in GitHub. +For bug reports and other problems, please open an [issue](https://github.com/mccode-dev/mcstastox/issues/new) in GitHub. You are welcome to submit pull requests at any time. But to avoid having to make large modifications during review or even have your PR rejected, please first open an issue first to discuss your idea! -Check out the subsections of the [Developer documentation](https://mccode-dev.github.io/McStasToX/developer/index.html) for details on how McStasToX is developed. +Check out the subsections of the [Developer documentation](https://mccode-dev.github.io/mcstastox/developer/index.html) for details on how McStasToX is developed. ## Code of conduct This project is a community effort, and everyone is welcome to contribute. -Everyone within the community is expected to abide by our [code of conduct](https://github.com/mccode-dev/McStasToX/blob/main/CODE_OF_CONDUCT.md). +Everyone within the community is expected to abide by our [code of conduct](https://github.com/mccode-dev/mcstastox/blob/main/CODE_OF_CONDUCT.md). diff --git a/README.md b/README.md index d0a7d6b..a38bc43 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) -[![PyPI badge](http://img.shields.io/pypi/v/McStasToX.svg)](https://pypi.python.org/pypi/McStasToX) -[![Anaconda-Server Badge](https://anaconda.org/mccode-dev/McStasToX/badges/version.svg)](https://anaconda.org/mccode-dev/McStasToX) +[![PyPI badge](http://img.shields.io/pypi/v/mcstastox.svg)](https://pypi.python.org/pypi/mcstastox) +[![Anaconda-Server Badge](https://anaconda.org/mccode-dev/mcstastox/badges/version.svg)](https://anaconda.org/mccode-dev/mcstastox) [![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE) # McStasToX @@ -34,7 +34,7 @@ pip install mcstastox > Note that still an early version of the package is on pip, but the API is not stable yet. ```sh -python -m pip install McStasToX +python -m pip install mcstastox ``` ## Basic use diff --git a/docs/_templates/doc_version.html b/docs/_templates/doc_version.html index b98b066..a9df07d 100644 --- a/docs/_templates/doc_version.html +++ b/docs/_templates/doc_version.html @@ -1,2 +1,2 @@ -Current McStasToX version: {{ version }} (older versions). +Current McStasToX version: {{ version }} (older versions). diff --git a/docs/about/index.md b/docs/about/index.md index 4edc8b6..207d1dd 100644 --- a/docs/about/index.md +++ b/docs/about/index.md @@ -18,9 +18,9 @@ To cite a specific version of McStasToX, select the desired version on Zenodo to ## Older versions of the documentation -Older versions of the documentation pages can be found under the assets of each [release](https://github.com/mccode-dev/McStasToX/releases). +Older versions of the documentation pages can be found under the assets of each [release](https://github.com/mccode-dev/mcstastox/releases). Simply download the archive, unzip and view locally in a web browser. ## Source code and development -McStasToX is hosted and developed [on GitHub](https://github.com/mccode-dev/McStasToX). +McStasToX is hosted and developed [on GitHub](https://github.com/mccode-dev/mcstastox). diff --git a/docs/api-reference/index.md b/docs/api-reference/index.md index 81beae6..d4c7d0c 100644 --- a/docs/api-reference/index.md +++ b/docs/api-reference/index.md @@ -3,7 +3,7 @@ ## Classes ```{eval-rst} -.. currentmodule:: McStasToX +.. currentmodule:: mcstastox .. autosummary:: :toctree: ../generated/classes diff --git a/docs/conf.py b/docs/conf.py index 748ac43..faa01b5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -99,7 +99,7 @@ # try: - release = get_version("McStasToX") + release = get_version("mcstastox") version = ".".join(release.split('.')[:3]) # CalVer except PackageNotFoundError: logger.info( @@ -151,19 +151,19 @@ "icon_links": [ { "name": "GitHub", - "url": "https://github.com/mccode-dev/McStasToX", + "url": "https://github.com/mccode-dev/mcstastox", "icon": "fa-brands fa-github", "type": "fontawesome", }, { "name": "PyPI", - "url": "https://pypi.org/project/McStasToX/", + "url": "https://pypi.org/project/mcstastox/", "icon": "fa-brands fa-python", "type": "fontawesome", }, { "name": "Conda", - "url": "https://anaconda.org/mccode-dev/McStasToX", + "url": "https://anaconda.org/mccode-dev/mcstastox", "icon": "fa-custom fa-anaconda", "type": "fontawesome", }, @@ -192,7 +192,7 @@ # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. -htmlhelp_basename = 'McStasToXdoc' +htmlhelp_basename = 'mcstastoxdoc' # -- Options for Matplotlib in notebooks ---------------------------------- @@ -241,4 +241,7 @@ def do_not_plot(*args, **kwargs): linkcheck_ignore = [ # Specific lines in Github blobs cannot be found by linkcheck. r'https?://github\.com/.*?/blob/[a-f0-9]+/.+?#', + # Linkcheck seems to be denied access by some DOI resolvers. + # Since DOIs are supposed to be permanent, we don't need to check them.' + r'https://doi\.org/', ] diff --git a/docs/developer/dependency-management.md b/docs/developer/dependency-management.md index 0de5c91..3018133 100644 --- a/docs/developer/dependency-management.md +++ b/docs/developer/dependency-management.md @@ -1,6 +1,6 @@ # Dependency management -McStasToX is a library, so the package dependencies are never pinned. +mcstastox is a library, so the package dependencies are never pinned. Lower bounds are fine and individual versions can be excluded. See, e.g., [Should You Use Upper Bound Version Constraints](https://iscinumpy.dev/post/bound-version-constraints/) for an explanation. diff --git a/docs/index.md b/docs/index.md index 28c638b..b07b1ba 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,12 +23,12 @@ # {transparent}`McStasToX` - +
Python package to read McStas data and export as python objects in different formats or as other files.

- +
:::{include} user-guide/installation.md :heading-offset: 1 @@ -40,8 +40,8 @@ ## Get in touch -- If you have questions that are not answered by these documentation pages, ask on [discussions](https://github.com/mccode-dev/McStasToX/discussions). Please include a self-contained reproducible example if possible. -- Report bugs (including unclear, missing, or wrong documentation!), suggest features or view the source code [on GitHub](https://github.com/mccode-dev/McStasToX). +- If you have questions that are not answered by these documentation pages, ask on [discussions](https://github.com/mccode-dev/mcstastox/discussions). Please include a self-contained reproducible example if possible. +- Report bugs (including unclear, missing, or wrong documentation!), suggest features or view the source code [on GitHub](https://github.com/mccode-dev/mcstastox). ```{toctree} --- diff --git a/docs/user-guide/overall_demo.ipynb b/docs/user-guide/overall_demo.ipynb index 6b4ceaa..c260722 100644 --- a/docs/user-guide/overall_demo.ipynb +++ b/docs/user-guide/overall_demo.ipynb @@ -15,7 +15,7 @@ "metadata": {}, "outputs": [], "source": [ - "from read_example import make_instrument, plot" + "%matplotlib widget" ] }, { @@ -24,6 +24,16 @@ "id": "2", "metadata": {}, "outputs": [], + "source": [ + "from read_example import make_instrument, plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], "source": [ "instr = make_instrument()\n", "instr.show_parameters()" @@ -32,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "5", + "id": "6", "metadata": {}, "source": [ "### Run simulation" @@ -61,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "9", "metadata": {}, "source": [ "### Histogram data to display" @@ -89,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -118,16 +128,6 @@ "print(file_path)" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "12", - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib widget" - ] - }, { "cell_type": "markdown", "id": "13", diff --git a/docs/user-guide/scipp_demo.ipynb b/docs/user-guide/scipp_demo.ipynb index 2752c3f..bb1ed9a 100644 --- a/docs/user-guide/scipp_demo.ipynb +++ b/docs/user-guide/scipp_demo.ipynb @@ -15,7 +15,7 @@ "metadata": {}, "outputs": [], "source": [ - "from read_example import make_instrument" + "%matplotlib widget" ] }, { @@ -24,6 +24,16 @@ "id": "2", "metadata": {}, "outputs": [], + "source": [ + "from read_example import make_instrument" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3", + "metadata": {}, + "outputs": [], "source": [ "instr = make_instrument()\n", "instr.show_parameters()" @@ -32,7 +42,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -43,7 +53,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +62,7 @@ }, { "cell_type": "markdown", - "id": "5", + "id": "6", "metadata": {}, "source": [ "### Run simulation" @@ -61,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -71,7 +81,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +90,7 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "9", "metadata": {}, "source": [ "### Histogram data to display" @@ -89,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -118,16 +128,6 @@ "print(file_path)" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "12", - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib widget" - ] - }, { "cell_type": "markdown", "id": "13", @@ -385,7 +385,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "img-dev-310", "language": "python", "name": "python3" }, @@ -399,7 +399,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.9" + "version": "3.10.14" } }, "nbformat": 4, diff --git a/pyproject.toml b/pyproject.toml index 7563a3f..afdcd52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=68", + "setuptools>=77", "setuptools_scm[toml]>=8.0", ] build-backend = "setuptools.build_meta" @@ -13,7 +13,6 @@ license = { file = "LICENSE" } readme = "README.md" classifiers = [ "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", @@ -30,8 +29,8 @@ requires-python = ">=3.10" # Run 'tox -e deps' after making changes here. This will update requirement files. # Make sure to list one dependency per line. dependencies = [ - "mcstasscript", - "scipp", + "h5py", + "numpy", ] dynamic = ["version"] @@ -46,9 +45,9 @@ test = [ ] [project.urls] -"Bug Tracker" = "https://github.com/mccode-dev/McStasToX/issues" -"Documentation" = "https://mccode-dev.github.io/McStasToX" -"Source" = "https://github.com/mccode-dev/McStasToX" +"Bug Tracker" = "https://github.com/mccode-dev/mcstastox/issues" +"Documentation" = "https://mccode-dev.github.io/mcstastox" +"Source" = "https://github.com/mccode-dev/mcstastox" [tool.setuptools_scm] @@ -83,7 +82,7 @@ ignore = [ "C408" ] fixable = ["B010", "I001", "PT001", "RUF022"] -isort.known-first-party = ["McStasToX"] +isort.known-first-party = ["mcstastox"] pydocstyle.convention = "numpy" [tool.ruff.lint.per-file-ignores] diff --git a/requirements/base.in b/requirements/base.in index f0dde74..915a658 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -1,6 +1,8 @@ # Anything above "--- END OF CUSTOM SECTION ---" # will not be touched by ``make_base.py`` +scipp +mcstasscript # --- END OF CUSTOM SECTION --- # The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY! -mcstasscript -scipp +h5py +numpy diff --git a/requirements/base.txt b/requirements/base.txt index 94c7d6c..1d9201b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -# SHA1:314202a05208dca52f068076653a1bd745d59337 +# SHA1:71599ba43d91f48fe12c77a04387fed02d7e5c52 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -9,7 +9,7 @@ asttokens==3.0.0 # via stack-data comm==0.2.2 # via ipywidgets -contourpy==1.3.1 +contourpy==1.3.2 # via matplotlib cycler==0.12.1 # via matplotlib @@ -28,10 +28,12 @@ flexparser==0.4 fonttools==4.57.0 # via matplotlib h5py==3.13.0 - # via libpyvinyl -ipython==8.35.0 + # via + # -r base.in + # libpyvinyl +ipython==8.36.0 # via ipywidgets -ipywidgets==8.1.5 +ipywidgets==8.1.7 # via mcstasscript jedi==0.19.2 # via ipython @@ -39,7 +41,7 @@ json-tricks==3.17.3 # via libpyvinyl jsons==1.6.3 # via libpyvinyl -jupyterlab-widgets==3.0.13 +jupyterlab-widgets==3.0.15 # via ipywidgets kiwisolver==1.4.8 # via matplotlib @@ -51,8 +53,9 @@ matplotlib-inline==0.1.7 # via ipython mcstasscript==0.0.74 # via -r base.in -numpy==2.2.4 +numpy==2.2.5 # via + # -r base.in # contourpy # h5py # libpyvinyl @@ -60,19 +63,19 @@ numpy==2.2.4 # mcstasscript # scipp # scipy -packaging==24.2 +packaging==25.0 # via matplotlib parso==0.8.4 # via jedi pexpect==4.9.0 # via ipython -pillow==11.1.0 +pillow==11.2.1 # via matplotlib pint==0.24.4 # via libpyvinyl platformdirs==4.3.7 # via pint -prompt-toolkit==3.0.50 +prompt-toolkit==3.0.51 # via ipython ptyprocess==0.7.0 # via pexpect @@ -86,7 +89,7 @@ python-dateutil==2.9.0.post0 # via matplotlib pyyaml==6.0.2 # via mcstasscript -scipp==25.4.0 +scipp==25.5.0 # via -r base.in scipy==1.15.2 # via libpyvinyl @@ -100,7 +103,7 @@ traitlets==5.14.3 # ipython # ipywidgets # matplotlib-inline -typing-extensions==4.13.1 +typing-extensions==4.13.2 # via # flexcache # flexparser @@ -110,5 +113,5 @@ typish==1.9.3 # via jsons wcwidth==0.2.13 # via prompt-toolkit -widgetsnbextension==4.0.13 +widgetsnbextension==4.0.14 # via ipywidgets diff --git a/requirements/basetest.txt b/requirements/basetest.txt index 76aebec..2b2b59b 100644 --- a/requirements/basetest.txt +++ b/requirements/basetest.txt @@ -9,7 +9,7 @@ exceptiongroup==1.2.2 # via pytest iniconfig==2.1.0 # via pytest -packaging==24.2 +packaging==25.0 # via pytest pluggy==1.5.0 # via pytest diff --git a/requirements/ci.txt b/requirements/ci.txt index 176b512..27027cd 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -7,11 +7,11 @@ # cachetools==5.5.2 # via tox -certifi==2025.1.31 +certifi==2025.4.26 # via requests chardet==5.2.0 # via tox -charset-normalizer==3.4.1 +charset-normalizer==3.4.2 # via requests colorama==0.4.6 # via tox @@ -27,7 +27,7 @@ gitpython==3.1.44 # via -r ci.in idna==3.10 # via requests -packaging==24.2 +packaging==25.0 # via # -r ci.in # pyproject-api @@ -50,9 +50,9 @@ tomli==2.2.1 # tox tox==4.25.0 # via -r ci.in -typing-extensions==4.13.1 +typing-extensions==4.13.2 # via tox -urllib3==2.3.0 +urllib3==2.4.0 # via requests -virtualenv==20.30.0 +virtualenv==20.31.1 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 6206512..e53c2f6 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -32,7 +32,7 @@ click==8.1.8 # via # pip-compile-multi # pip-tools -copier==9.6.0 +copier==9.7.1 # via -r dev.in dunamai==1.23.1 # via copier @@ -40,9 +40,9 @@ fqdn==1.5.1 # via jsonschema funcy==2.0 # via copier -h11==0.14.0 +h11==0.16.0 # via httpcore -httpcore==1.0.7 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via jupyterlab @@ -71,7 +71,7 @@ jupyter-server==2.15.0 # notebook-shim jupyter-server-terminals==0.5.3 # via jupyter-server -jupyterlab==4.4.0 +jupyterlab==4.4.1 # via -r dev.in jupyterlab-server==2.27.3 # via jupyterlab @@ -81,7 +81,7 @@ overrides==7.7.0 # via jupyter-server pathspec==0.12.1 # via copier -pip-compile-multi==2.8.0 +pip-compile-multi==3.0.0 # via -r dev.in pip-tools==7.4.1 # via pip-compile-multi @@ -91,9 +91,9 @@ prometheus-client==0.21.1 # via jupyter-server pycparser==2.22 # via cffi -pydantic==2.11.3 +pydantic==2.11.4 # via copier -pydantic-core==2.33.1 +pydantic-core==2.33.2 # via pydantic python-json-logger==3.3.0 # via jupyter-events diff --git a/requirements/docs.in b/requirements/docs.in index eab8dd6..56b1460 100644 --- a/requirements/docs.in +++ b/requirements/docs.in @@ -9,3 +9,5 @@ sphinx-autodoc-typehints sphinx-copybutton sphinx-design matplotlib +plopp[all] +pythreejs # For instrument view. diff --git a/requirements/docs.txt b/requirements/docs.txt index b31079c..eba42fd 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,4 +1,4 @@ -# SHA1:01fdbe8007e8ae6ff26b26ba094ad9e59f660179 +# SHA1:cae1ff02569954d20815f31620bae3df07ce2023 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -20,17 +20,17 @@ babel==2.17.0 # via # pydata-sphinx-theme # sphinx -beautifulsoup4==4.13.3 +beautifulsoup4==4.13.4 # via # nbconvert # pydata-sphinx-theme bleach[css]==6.2.0 # via nbconvert -certifi==2025.1.31 +certifi==2025.4.26 # via requests -charset-normalizer==3.4.1 +charset-normalizer==3.4.2 # via requests -debugpy==1.8.13 +debugpy==1.8.14 # via ipykernel defusedxml==0.7.1 # via nbconvert @@ -42,12 +42,18 @@ docutils==0.21.2 # sphinx fastjsonschema==2.21.1 # via nbformat +graphviz==0.20.3 + # via plopp idna==3.10 # via requests imagesize==1.4.1 # via sphinx +ipydatawidgets==4.3.5 + # via pythreejs ipykernel==6.29.5 # via -r docs.in +ipympl==0.9.7 + # via plopp jinja2==3.1.6 # via # myst-parser @@ -56,7 +62,7 @@ jinja2==3.1.6 # sphinx jsonschema==4.23.0 # via nbformat -jsonschema-specifications==2024.10.1 +jsonschema-specifications==2025.4.1 # via jsonschema jupyter-client==8.6.3 # via @@ -71,6 +77,8 @@ jupyter-core==5.7.2 # nbformat jupyterlab-pygments==0.3.0 # via nbconvert +lazy-loader==0.4 + # via plopp markdown-it-py==3.0.0 # via # mdit-py-plugins @@ -85,6 +93,8 @@ mdurl==0.1.2 # via markdown-it-py mistune==3.1.3 # via nbconvert +mpltoolbox==25.4.0 + # via plopp myst-parser==4.0.1 # via -r docs.in nbclient==0.10.2 @@ -102,10 +112,16 @@ nest-asyncio==1.6.0 # via ipykernel pandocfilters==1.5.1 # via nbconvert +plopp[all]==25.4.1 + # via -r docs.in psutil==7.0.0 # via ipykernel pydata-sphinx-theme==0.16.1 # via -r docs.in +pythreejs==2.4.2 + # via + # -r docs.in + # plopp pyzmq==26.4.0 # via # ipykernel @@ -122,7 +138,7 @@ rpds-py==0.24.0 # referencing snowballstemmer==2.2.0 # via sphinx -soupsieve==2.6 +soupsieve==2.7 # via beautifulsoup4 sphinx==8.1.3 # via @@ -159,7 +175,9 @@ tornado==6.4.2 # via # ipykernel # jupyter-client -urllib3==2.3.0 +traittypes==0.2.1 + # via ipydatawidgets +urllib3==2.4.0 # via requests webencodings==0.5.1 # via diff --git a/requirements/mypy.txt b/requirements/mypy.txt index 61d88db..77e99ca 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -8,5 +8,5 @@ -r test.txt mypy==1.15.0 # via -r mypy.in -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via mypy diff --git a/requirements/nightly.in b/requirements/nightly.in index a785108..7e6d320 100644 --- a/requirements/nightly.in +++ b/requirements/nightly.in @@ -1,7 +1,8 @@ # --- END OF CUSTOM SECTION --- # The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY! -mcstasscript +h5py +numpy pytest scipp --index-url=https://pypi.anaconda.org/scipp-nightly-wheels/simple/ diff --git a/requirements/nightly.txt b/requirements/nightly.txt index c23acee..4ca8056 100644 --- a/requirements/nightly.txt +++ b/requirements/nightly.txt @@ -1,4 +1,4 @@ -# SHA1:59fa0704acd7073cdf970cb3aaf2cb8b49111272 +# SHA1:4dd742f716575e8b2a483edcff49618eff1db3c2 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -8,101 +8,28 @@ --index-url https://pypi.anaconda.org/scipp-nightly-wheels/simple/ --extra-index-url https://pypi.org/simple -asttokens==3.0.0 - # via stack-data -comm==0.2.2 - # via ipywidgets -contourpy==1.3.1 - # via matplotlib -cycler==0.12.1 - # via matplotlib -decorator==5.2.1 - # via ipython -dill==0.3.5.1 - # via libpyvinyl exceptiongroup==1.2.2 - # via - # ipython - # pytest -executing==2.2.0 - # via stack-data -flexcache==0.3 - # via pint -flexparser==0.4 - # via pint -fonttools==4.57.0 - # via matplotlib + # via pytest h5py==3.13.0 # via - # libpyvinyl + # -r nightly.in # scippnexus iniconfig==2.1.0 # via pytest -ipython==8.35.0 - # via ipywidgets -ipywidgets==8.1.5 - # via mcstasscript -jedi==0.19.2 - # via ipython -json-tricks==3.17.3 - # via libpyvinyl -jsons==1.6.3 - # via libpyvinyl -jupyterlab-widgets==3.0.13 - # via ipywidgets -kiwisolver==1.4.8 - # via matplotlib -libpyvinyl==1.3.0 - # via mcstasscript -matplotlib==3.10.1 - # via mcstasscript -matplotlib-inline==0.1.7 - # via ipython -mcstasscript==0.0.74 - # via -r nightly.in -numpy==2.2.4 +numpy==2.2.5 # via - # contourpy + # -r nightly.in # h5py - # libpyvinyl - # matplotlib - # mcstasscript # scipp # scipy -packaging==24.2 - # via - # matplotlib - # pytest -parso==0.8.4 - # via jedi -pexpect==4.9.0 - # via ipython -pillow==11.1.0 - # via matplotlib -pint==0.24.4 - # via libpyvinyl -platformdirs==4.3.7 - # via pint +packaging==25.0 + # via pytest pluggy==1.5.0 # via pytest -prompt-toolkit==3.0.50 - # via ipython -ptyprocess==0.7.0 - # via pexpect -pure-eval==0.2.3 - # via stack-data -pygments==2.19.1 - # via ipython -pyparsing==3.2.3 - # via matplotlib pytest==8.3.5 # via -r nightly.in python-dateutil==2.9.0.post0 - # via - # matplotlib - # scippnexus -pyyaml==6.0.2 - # via mcstasscript + # via scippnexus scipp==100.0.0.dev0 # via # -r nightly.in @@ -110,30 +37,8 @@ scipp==100.0.0.dev0 scippnexus @ git+https://github.com/scipp/scippnexus@main # via -r nightly.in scipy==1.15.2 - # via - # libpyvinyl - # scippnexus + # via scippnexus six==1.17.0 # via python-dateutil -stack-data==0.6.3 - # via ipython tomli==2.2.1 # via pytest -traitlets==5.14.3 - # via - # comm - # ipython - # ipywidgets - # matplotlib-inline -typing-extensions==4.13.1 - # via - # flexcache - # flexparser - # ipython - # pint -typish==1.9.3 - # via jsons -wcwidth==0.2.13 - # via prompt-toolkit -widgetsnbextension==4.0.13 - # via ipywidgets diff --git a/requirements/static.txt b/requirements/static.txt index c0e7366..3b11f10 100644 --- a/requirements/static.txt +++ b/requirements/static.txt @@ -11,7 +11,7 @@ distlib==0.3.9 # via virtualenv filelock==3.18.0 # via virtualenv -identify==2.6.9 +identify==2.6.10 # via pre-commit nodeenv==1.9.1 # via pre-commit @@ -21,5 +21,5 @@ pre-commit==4.2.0 # via -r static.in pyyaml==6.0.2 # via pre-commit -virtualenv==20.30.0 +virtualenv==20.31.1 # via pre-commit diff --git a/requirements/wheels.txt b/requirements/wheels.txt index bfae20b..21d3cb0 100644 --- a/requirements/wheels.txt +++ b/requirements/wheels.txt @@ -7,7 +7,7 @@ # build==1.2.2.post1 # via -r wheels.in -packaging==24.2 +packaging==25.0 # via build pyproject-hooks==1.2.0 # via build diff --git a/src/mcstastox/LoadFile.py b/src/mcstastox/LoadFile.py index 6cc5d46..3a4ebea 100644 --- a/src/mcstastox/LoadFile.py +++ b/src/mcstastox/LoadFile.py @@ -76,7 +76,7 @@ def show_components(self): self.logger.info("All components in file:") comps = self.get_components() for comp in comps: - self.logger.info(" ", comp) + self.logger.info("%s", comp) def show_components_with_data(self): """ @@ -88,7 +88,7 @@ def show_components_with_data(self): else: self.logger.info("All components with data in file:") for comp in comps: - self.logger.info(" ", comp) + self.logger.info("%s", comp) def show_components_with_ids(self): """ @@ -100,7 +100,7 @@ def show_components_with_ids(self): else: self.logger.info("All components with pixel id information in file:") for comp in comps: - self.logger.info(" ", comp) + self.logger.info("%s", comp) def show_components_with_geometry(self): """ @@ -112,7 +112,7 @@ def show_components_with_geometry(self): else: self.logger.info("All components with geometry information in file:") for comp in comps: - self.logger.info(" ", comp) + self.logger.info("%s", comp) def get_component_variables(self, component_name): """ diff --git a/tox.ini b/tox.ini index 8ae6497..adb8143 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,8 @@ isolated_build = true deps = -r requirements/test.txt setenv = JUPYTER_PLATFORM_DIRS = 1 +passenv = + MCSTAS commands = pytest {posargs} [testenv:nightly] @@ -19,16 +21,14 @@ commands = pytest {posargs} description = Test with unpinned dependencies, as a user would install now. deps = -r requirements/basetest.txt - McStasToX + mcstastox commands = pytest {posargs} [testenv:docs] description = invoke sphinx-build to build the HTML docs deps = -r requirements/docs.txt allowlist_externals=find - mamba -commands = mamba install mcstas=3.5 -y - python -m sphinx -j2 -v -b html -d {toxworkdir}/docs_doctrees docs html +commands = python -m sphinx -j2 -v -b html -d {toxworkdir}/docs_doctrees docs html python -m sphinx -j2 -v -b doctest -d {toxworkdir}/docs_doctrees docs html find html -type f -name "*.ipynb" -not -path "html/_sources/*" -delete @@ -36,7 +36,7 @@ commands = mamba install mcstas=3.5 -y description = invoke sphinx-build to build the HTML docs from a released version skip_install = true deps = - McStasToX=={posargs} + mcstastox=={posargs} {[testenv:docs]deps} allowlist_externals={[testenv:docs]allowlist_externals} commands = {[testenv:docs]commands} @@ -70,5 +70,5 @@ deps = pip==24.2 skip_install = true changedir = requirements -commands = python ./make_base.py --nightly scipp,scippnexus +commands = python ./make_base.py --nightly scipp,scippnexus,mcstasscript pip-compile-multi -d . --backtracking --annotate-index