diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 00000000..c1ee31e3 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,33 @@ +name: linting + +# Triggers the workflow on push for all branches +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + # Check out repo and set up Python + - uses: actions/checkout@v3 + with: + lfs: true + + # Use cached python and dependencies, install poetry + - name: "Setup Python, Poetry and Dependencies" + uses: packetcoders/action-setup-cache-python-poetry@main + with: + python-version: 3.8 + poetry-version: 1.2.2 + + # Linting steps, excute all linters even if one fails + - name: pycodestyle + run: + poetry run pycodestyle --ignore=E203,E501,W503 sed tests + - name: pylint + if: ${{ always() }} + run: + poetry run pylint --good-names=i,j,k,ex,x,y,t,k,v,ax,df,ec,mc,dc,ct --disable=fixme,too-many-branches,too-many-locals,too-many-statements,too-many-arguments,too-many-lines,too-many-public-methods,too-many-instance-attributes,too-few-public-methods sed tests + - name: mypy + if: ${{ always() }} + run: + poetry run mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional sed tests \ No newline at end of file diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml deleted file mode 100644 index c02f7fa2..00000000 --- a/.github/workflows/pylint.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This workflow will install Python dependencies, lint and run tests with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: linting - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - lfs: true - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Install dependencies - run: | - git lfs pull - python -m pip install --upgrade pip - pip install pycodestyle pylint mypy pytest types-PyYAML types-requests coverage coveralls - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Install package - run: | - python -m pip install . - - name: pycodestyle - run: | - python -m pycodestyle --ignore=E203,E501,W503 sed tests - - name: pylint - if: ${{ always() }} - run: | - python -m pylint --good-names=i,j,k,ex,x,y,t,k,v,ax,df,ec,mc,dc,ct --disable=fixme,too-many-branches,too-many-locals,too-many-statements,too-many-arguments,too-many-lines,too-many-public-methods,too-many-instance-attributes,too-few-public-methods sed tests - - name: mypy - if: ${{ always() }} - run: | - python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional sed tests - - name: Test with pytest - if: ${{ always() }} - run: | - coverage run -m pytest -sv --show-capture=no tests - - name: Submit to coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - coveralls --service=github diff --git a/.github/workflows/pytest_coveralls.yml b/.github/workflows/pytest_coveralls.yml deleted file mode 100644 index 4909c2a3..00000000 --- a/.github/workflows/pytest_coveralls.yml +++ /dev/null @@ -1,34 +0,0 @@ -# This workflow will install Python dependencies, run tests for a single versions of Python and commit test results to coveralls -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: pytest - -on: pull_request - -jobs: - pytest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - lfs: true - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Install dependencies - run: | - git lfs pull - python -m pip install --upgrade pip - python -m pip install pytest coverage coveralls - - name: Install package - run: | - python -m pip install . - - name: Test with pytest - run: | - coverage run -m pytest -sv --show-capture=no tests - - name: Submit to coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - coveralls --service=github diff --git a/.github/workflows/pytest_muliversion.yml b/.github/workflows/pytest_muliversion.yml deleted file mode 100644 index 955304ea..00000000 --- a/.github/workflows/pytest_muliversion.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will install Python dependencies, and run tests for multiple versions of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: pytest - -on: - push: - branches: [main] - -jobs: - pytest: - runs-on: ubuntu-latest - strategy: - matrix: - python_version: ["3.8", "3.9", "3.10"] - - steps: - - uses: actions/checkout@v3 - with: - lfs: true - - name: Set up Python ${{ matrix.python_version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - - name: Install dependencies - run: | - git lfs pull - python -m pip install --upgrade pip - python -m pip install pytest coverage coveralls - - name: Install package - run: | - python -m pip install . - - name: Test with pytest - run: | - coverage run -m pytest -sv --show-capture=no tests - - name: Submit to coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - coveralls --service=github diff --git a/.github/workflows/testing_coverage.yml b/.github/workflows/testing_coverage.yml new file mode 100644 index 00000000..57ac606a --- /dev/null +++ b/.github/workflows/testing_coverage.yml @@ -0,0 +1,33 @@ +name: pytest and coverage report + +# Triggers the workflow on push and PR for all branches +on: [push, pull_request] + +jobs: + pytest: + runs-on: ubuntu-latest + steps: + # Check out repo and set up Python + - name: Check out the repository + uses: actions/checkout@v4 + with: + lfs: true + + # Use cached python and dependencies, install poetry + - name: "Setup Python, Poetry and Dependencies" + uses: packetcoders/action-setup-cache-python-poetry@main + with: + python-version: 3.8 + poetry-version: 1.2.2 + + # Run pytest with coverage report, saving to xml + - name: Run tests on python 3.8 + run: | + poetry run pytest --cov --cov-report xml:cobertura.xml --full-trace --show-capture=no -sv -n auto tests/ + + # Take report and upload to coveralls + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: ./cobertura.xml \ No newline at end of file diff --git a/.github/workflows/testing_multiversion.yml b/.github/workflows/testing_multiversion.yml new file mode 100644 index 00000000..1cc090de --- /dev/null +++ b/.github/workflows/testing_multiversion.yml @@ -0,0 +1,30 @@ +name: pytest multiversion + +on: + push: + branches: [ main ] + +jobs: + pytest: + # Using matrix strategy + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + runs-on: ubuntu-latest + steps: + # Check out repo and set up Python + - name: Check out the repository + uses: actions/checkout@v4 + with: + lfs: true + + - name: "Setup Python, Poetry and Dependencies" + uses: packetcoders/action-setup-cache-python-poetry@main + with: + python-version: ${{matrix.python-version}} + poetry-version: 1.2.2 + + # Use cached python and dependencies, install poetry + - name: Run tests on python ${{matrix.python-version}} + run: | + poetry run pytest--full-trace --show-capture=no -sv -n auto tests/ diff --git a/poetry.lock b/poetry.lock index b5466c9d..f2bb7380 100644 --- a/poetry.lock +++ b/poetry.lock @@ -166,6 +166,20 @@ dev = ["build", "twine"] doc = ["Sphinx"] test = ["coverage", "pytest", "pytest-cov"] +[[package]] +name = "astroid" +version = "3.0.1" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.0.1-py3-none-any.whl", hash = "sha256:7d5895c9825e18079c5aeac0572bc2e4c83205c95d416e0b4fee8bc361d2d9ca"}, + {file = "astroid-3.0.1.tar.gz", hash = "sha256:86b0bb7d7da0be1a7c4aedb7974e391b32d4ed89e33de6ed6902b4b15c97577e"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + [[package]] name = "astropy" version = "5.2.2" @@ -814,16 +828,6 @@ files = [ {file = "cramjam-2.7.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b48b11c328d91250dadc63c00753f5ba26eb9df5fe75ba2ce8a78631260479d"}, {file = "cramjam-2.7.0-cp311-none-win32.whl", hash = "sha256:bef07e7d4607c4d70627e58eb630fe60e48b80a61ab05b33314e3296eb90af78"}, {file = "cramjam-2.7.0-cp311-none-win_amd64.whl", hash = "sha256:3f2e41dc8143d0e88ec9ba3ff66c8d2aea486b04931119abe9e394f9961d74bc"}, - {file = "cramjam-2.7.0-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:8e82276b120000834af3f776cbe22ac3016cd9e0ed00e7f3fb31e2ce95e17181"}, - {file = "cramjam-2.7.0-cp312-cp312-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:2b5a463b01d8867f78a361defb4fadca63635965e8204f7e2409b717d85f0c1d"}, - {file = "cramjam-2.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b84565611f36ee8c3944b96bb01ee4d44c101acf84f1430c9414986ab3a7fb03"}, - {file = "cramjam-2.7.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3cd45d09229960a89e0e3bbf71d29ac399391446f51279f3202846d7da106eb7"}, - {file = "cramjam-2.7.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4bb065d054e49645414bc84eaa49a6b7ed6c7185fb8ba2648c518344cf481144"}, - {file = "cramjam-2.7.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9a3f45cd17730c00358643a814d5921a31c8a0d238582e08594fa86fdbc8401c"}, - {file = "cramjam-2.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bf4ec082a7647ed7463c5e0bd176850a9f013c258ad98f53055bcd1716c7fac"}, - {file = "cramjam-2.7.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9f9e403be6307e98a47cc7d0132fe1fe4683c873c5d7d9da099fbac9c299a4b0"}, - {file = "cramjam-2.7.0-cp312-none-win32.whl", hash = "sha256:fd2e81c69baacb95fa28cdf844f714d7c03f0c805f4fa2decc5e9565e6b4405d"}, - {file = "cramjam-2.7.0-cp312-none-win_amd64.whl", hash = "sha256:831951a3eccebd5911387e3fff14483747d3dae5ad496afbd50447ffe2d03dba"}, {file = "cramjam-2.7.0-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:d143ccb3f5aae640f0c2dd6244d43f5e5e81d847b50c2eb9f08dcc3dc33f367a"}, {file = "cramjam-2.7.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47ae97247a58d3095be800420bba7e43cc6958e67f9dfddd12decdb4c99c4d6f"}, {file = "cramjam-2.7.0-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6a8f0fd14bd11f2a625e5c554fd93c7775082c31ffd9fbabb4fe9db3031645d0"}, @@ -1782,6 +1786,23 @@ files = [ [package.dependencies] arrow = ">=0.15.0" +[[package]] +name = "isort" +version = "5.12.0" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, + {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, +] + +[package.extras] +colors = ["colorama (>=0.4.3)"] +pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] +plugins = ["setuptools"] +requirements-deprecated-finder = ["pip-api", "pipreqs"] + [[package]] name = "jedi" version = "0.19.1" @@ -2466,16 +2487,6 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -2605,6 +2616,17 @@ files = [ [package.dependencies] matplotlib = "*" +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -2644,6 +2666,63 @@ docs = ["sphinx"] gmpy = ["gmpy2 (>=2.1.0a4)"] tests = ["pytest (>=4.6)"] +[[package]] +name = "mypy" +version = "1.6.1" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy-1.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e5012e5cc2ac628177eaac0e83d622b2dd499e28253d4107a08ecc59ede3fc2c"}, + {file = "mypy-1.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d8fbb68711905f8912e5af474ca8b78d077447d8f3918997fecbf26943ff3cbb"}, + {file = "mypy-1.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21a1ad938fee7d2d96ca666c77b7c494c3c5bd88dff792220e1afbebb2925b5e"}, + {file = "mypy-1.6.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b96ae2c1279d1065413965c607712006205a9ac541895004a1e0d4f281f2ff9f"}, + {file = "mypy-1.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:40b1844d2e8b232ed92e50a4bd11c48d2daa351f9deee6c194b83bf03e418b0c"}, + {file = "mypy-1.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:81af8adaa5e3099469e7623436881eff6b3b06db5ef75e6f5b6d4871263547e5"}, + {file = "mypy-1.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8c223fa57cb154c7eab5156856c231c3f5eace1e0bed9b32a24696b7ba3c3245"}, + {file = "mypy-1.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8032e00ce71c3ceb93eeba63963b864bf635a18f6c0c12da6c13c450eedb183"}, + {file = "mypy-1.6.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4c46b51de523817a0045b150ed11b56f9fff55f12b9edd0f3ed35b15a2809de0"}, + {file = "mypy-1.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:19f905bcfd9e167159b3d63ecd8cb5e696151c3e59a1742e79bc3bcb540c42c7"}, + {file = "mypy-1.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:82e469518d3e9a321912955cc702d418773a2fd1e91c651280a1bda10622f02f"}, + {file = "mypy-1.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d4473c22cc296425bbbce7e9429588e76e05bc7342da359d6520b6427bf76660"}, + {file = "mypy-1.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59a0d7d24dfb26729e0a068639a6ce3500e31d6655df8557156c51c1cb874ce7"}, + {file = "mypy-1.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cfd13d47b29ed3bbaafaff7d8b21e90d827631afda134836962011acb5904b71"}, + {file = "mypy-1.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:eb4f18589d196a4cbe5290b435d135dee96567e07c2b2d43b5c4621b6501531a"}, + {file = "mypy-1.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:41697773aa0bf53ff917aa077e2cde7aa50254f28750f9b88884acea38a16169"}, + {file = "mypy-1.6.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7274b0c57737bd3476d2229c6389b2ec9eefeb090bbaf77777e9d6b1b5a9d143"}, + {file = "mypy-1.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbaf4662e498c8c2e352da5f5bca5ab29d378895fa2d980630656178bd607c46"}, + {file = "mypy-1.6.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bb8ccb4724f7d8601938571bf3f24da0da791fe2db7be3d9e79849cb64e0ae85"}, + {file = "mypy-1.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:68351911e85145f582b5aa6cd9ad666c8958bcae897a1bfda8f4940472463c45"}, + {file = "mypy-1.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:49ae115da099dcc0922a7a895c1eec82c1518109ea5c162ed50e3b3594c71208"}, + {file = "mypy-1.6.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8b27958f8c76bed8edaa63da0739d76e4e9ad4ed325c814f9b3851425582a3cd"}, + {file = "mypy-1.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:925cd6a3b7b55dfba252b7c4561892311c5358c6b5a601847015a1ad4eb7d332"}, + {file = "mypy-1.6.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8f57e6b6927a49550da3d122f0cb983d400f843a8a82e65b3b380d3d7259468f"}, + {file = "mypy-1.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:a43ef1c8ddfdb9575691720b6352761f3f53d85f1b57d7745701041053deff30"}, + {file = "mypy-1.6.1-py3-none-any.whl", hash = "sha256:4cbe68ef919c28ea561165206a2dcb68591c50f3bcf777932323bc208d949cf1"}, + {file = "mypy-1.6.1.tar.gz", hash = "sha256:4d01c00d09a0be62a4ca3f933e315455bde83f37f892ba4b08ce92f3cf44bcc1"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.1.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +install-types = ["pip"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + [[package]] name = "natsort" version = "8.4.0" @@ -3662,6 +3741,17 @@ files = [ {file = "PyCifRW-4.4.5.tar.gz", hash = "sha256:a8fd092cbefe6ddd4b7e667d05682e5c8c2e64ba63e7ef8b3ce4c07f2ff62827"}, ] +[[package]] +name = "pycodestyle" +version = "2.11.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.11.1-py2.py3-none-any.whl", hash = "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"}, + {file = "pycodestyle-2.11.1.tar.gz", hash = "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f"}, +] + [[package]] name = "pycparser" version = "2.21" @@ -3794,6 +3884,32 @@ files = [ [package.extras] plugins = ["importlib-metadata"] +[[package]] +name = "pylint" +version = "3.0.2" +description = "python code static checker" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.0.2-py3-none-any.whl", hash = "sha256:60ed5f3a9ff8b61839ff0348b3624ceeb9e6c2a92c514d81c9cc273da3b6bcda"}, + {file = "pylint-3.0.2.tar.gz", hash = "sha256:0d4c286ef6d2f66c8bfb527a7f8a629009e42c99707dec821a03e1b51a4c1496"}, +] + +[package.dependencies] +astroid = ">=3.0.1,<=3.1.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = {version = ">=0.2", markers = "python_version < \"3.11\""} +isort = ">=4.2.5,<6" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + [[package]] name = "pynxtools" version = "0.0.5" @@ -4108,7 +4224,6 @@ files = [ {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, @@ -4116,15 +4231,8 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, @@ -4141,7 +4249,6 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -4149,7 +4256,6 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, @@ -5219,7 +5325,7 @@ files = [ name = "tomlkit" version = "0.12.1" description = "Style preserving TOML library" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "tomlkit-0.12.1-py3-none-any.whl", hash = "sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899"}, @@ -5373,7 +5479,6 @@ description = "Functions for 3D coordinate transformations" optional = false python-versions = ">=3.6" files = [ - {file = "transforms3d-0.4.1-py3-none-any.whl", hash = "sha256:aea08776c1c915c8b424418994202aced8e46301c375ce63423d14f1d0045aa7"}, {file = "transforms3d-0.4.1.tar.gz", hash = "sha256:31c755266a0b0a222488b8d039f6f325cf486c52728c03e307ce047b2fad1179"}, ] @@ -5388,6 +5493,31 @@ files = [ {file = "types_python_dateutil-2.8.19.14-py3-none-any.whl", hash = "sha256:f977b8de27787639986b4e28963263fd0e5158942b3ecef91b9335c130cb1ce9"}, ] +[[package]] +name = "types-pyyaml" +version = "6.0.12.12" +description = "Typing stubs for PyYAML" +optional = false +python-versions = "*" +files = [ + {file = "types-PyYAML-6.0.12.12.tar.gz", hash = "sha256:334373d392fde0fdf95af5c3f1661885fa10c52167b14593eb856289e1855062"}, + {file = "types_PyYAML-6.0.12.12-py3-none-any.whl", hash = "sha256:c05bc6c158facb0676674b7f11fe3960db4f389718e19e62bd2b84d6205cfd24"}, +] + +[[package]] +name = "types-requests" +version = "2.31.0.10" +description = "Typing stubs for requests" +optional = false +python-versions = ">=3.7" +files = [ + {file = "types-requests-2.31.0.10.tar.gz", hash = "sha256:dc5852a76f1eaf60eafa81a2e50aefa3d1f015c34cf0cba130930866b1b22a92"}, + {file = "types_requests-2.31.0.10-py3-none-any.whl", hash = "sha256:b32b9a86beffa876c0c3ac99a4cd3b8b51e973fb8e3bd4e0a6bb32c7efad80fc"}, +] + +[package.dependencies] +urllib3 = ">=2" + [[package]] name = "typing-extensions" version = "4.8.0" @@ -5634,4 +5764,4 @@ notebook = ["ipykernel", "jupyter"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.11" -content-hash = "0b7d42c3cd21ecb610f3dcc6b879656334652da52e13f4b464052c94d50b9d79" +content-hash = "74ca033105384efd95c12cbd728e1bc570c2d5d147a5d6a5effc9f7f279bbc62" diff --git a/pyproject.toml b/pyproject.toml index e94540ab..d5f05fcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,11 +43,16 @@ sphinx-autodoc-typehints = {version = ">1.17.0", extras = ["docs"], optional = t notebook = ["jupyter", "ipykernel"] docs = ["Sphinx", "sphinx-rtd-theme", "tomlkit", "sphinx-autodoc-typehints"] -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pytest = "^7.0.1" pytest-cov = "^3.0.0" pytest-xdist = "^2.5.0" pytest-clarity = "^1.0.1" +pylint = "^3.0.1" +mypy = "^1.6.0" +pycodestyle = "^2.11.1" +types-pyyaml = "^6.0.12.12" +types-requests = "^2.31.0.9" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/tests/loader/test_loaders.py b/tests/loader/test_loaders.py index 1d744088..3947adfc 100644 --- a/tests/loader/test_loaders.py +++ b/tests/loader/test_loaders.py @@ -1,6 +1,7 @@ """Test cases for loaders used to load dataframes """ import os +from copy import deepcopy from importlib.util import find_spec from pathlib import Path from typing import cast @@ -86,6 +87,15 @@ def test_if_loaders_are_children_of_base_loader(loader: BaseLoader): def test_has_correct_read_dataframe_func(loader: BaseLoader, read_type: str): """Test if all loaders have a valid read function implemented""" assert callable(loader.read_dataframe) + + # Fix for race condition during parallel testing + if loader.__name__ == "flash": + config = deepcopy(loader._config) # pylint: disable=protected-access + config["core"]["paths"]["data_parquet_dir"] = ( + config["core"]["paths"]["data_parquet_dir"] + f"_{read_type}" + ) + loader = get_loader(loader_name="flash", config=config) + if loader.__name__ != "BaseLoader": assert hasattr(loader, "files") assert hasattr(loader, "supported_file_types") @@ -165,6 +175,15 @@ def test_get_count_rate(loader: BaseLoader): Args: loader (BaseLoader): the loader object to test """ + + # Fix for race condition during parallel testing + if loader.__name__ == "flash": + config = deepcopy(loader._config) # pylint: disable=protected-access + config["core"]["paths"]["data_parquet_dir"] = ( + config["core"]["paths"]["data_parquet_dir"] + "_count_rate" + ) + loader = get_loader(loader_name="flash", config=config) + if loader.__name__ != "BaseLoader": loader_name = get_loader_name_from_loader_object(loader) input_folder = os.path.join(test_data_dir, "loader", loader_name) @@ -176,12 +195,23 @@ def test_get_count_rate(loader: BaseLoader): ) loaded_time, loaded_countrate = loader.get_count_rate() if loaded_time is None and loaded_countrate is None: + if loader.__name__ == "flash": + loader = cast(FlashLoader, loader) + _, parquet_data_dir = loader.initialize_paths() + for file in os.listdir(Path(parquet_data_dir, "buffer")): + os.remove(Path(parquet_data_dir, "buffer", file)) pytest.skip("Not implemented") assert len(loaded_time) == len(loaded_countrate) loaded_time2, loaded_countrate2 = loader.get_count_rate(fids=[0]) assert len(loaded_time2) == len(loaded_countrate2) assert len(loaded_time2) < len(loaded_time) + if loader.__name__ == "flash": + loader = cast(FlashLoader, loader) + _, parquet_data_dir = loader.initialize_paths() + for file in os.listdir(Path(parquet_data_dir, "buffer")): + os.remove(Path(parquet_data_dir, "buffer", file)) + @pytest.mark.parametrize("loader", get_all_loaders()) def test_get_elapsed_time(loader: BaseLoader): @@ -190,6 +220,15 @@ def test_get_elapsed_time(loader: BaseLoader): Args: loader (BaseLoader): the loader object to test """ + + # Fix for race condition during parallel testing + if loader.__name__ == "flash": + config = deepcopy(loader._config) # pylint: disable=protected-access + config["core"]["paths"]["data_parquet_dir"] = ( + config["core"]["paths"]["data_parquet_dir"] + "_elapsed_time" + ) + loader = get_loader(loader_name="flash", config=config) + if loader.__name__ != "BaseLoader": loader_name = get_loader_name_from_loader_object(loader) input_folder = os.path.join(test_data_dir, "loader", loader_name) @@ -201,12 +240,23 @@ def test_get_elapsed_time(loader: BaseLoader): ) elapsed_time = loader.get_elapsed_time() if elapsed_time is None: + if loader.__name__ == "flash": + loader = cast(FlashLoader, loader) + _, parquet_data_dir = loader.initialize_paths() + for file in os.listdir(Path(parquet_data_dir, "buffer")): + os.remove(Path(parquet_data_dir, "buffer", file)) pytest.skip("Not implemented") assert elapsed_time > 0 elapsed_time2 = loader.get_elapsed_time(fids=[0]) assert elapsed_time2 > 0 assert elapsed_time > elapsed_time2 + if loader.__name__ == "flash": + loader = cast(FlashLoader, loader) + _, parquet_data_dir = loader.initialize_paths() + for file in os.listdir(Path(parquet_data_dir, "buffer")): + os.remove(Path(parquet_data_dir, "buffer", file)) + def test_mpes_timestamps(): """Function to test if the timestamps are loaded correctly""" diff --git a/tests/test_io.py b/tests/test_io.py index 6b01beb3..1bde7c88 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1,5 +1,6 @@ """This file contains code that performs several tests for the input/output functions """ +import os import random from pathlib import Path @@ -35,9 +36,10 @@ def test_save_and_load_tiff_array(_da: xr.DataArray): """ nd_array = _da.data if nd_array.ndim > 1: - to_tiff(nd_array, "test") - as_array = load_tiff("test.tiff") + to_tiff(nd_array, f"test1{nd_array.ndim}") + as_array = load_tiff(f"test1{nd_array.ndim}.tiff") np.testing.assert_allclose(nd_array, as_array) + os.remove(f"test1{nd_array.ndim}.tiff") @pytest.mark.parametrize( @@ -51,8 +53,9 @@ def test_save_xarr_to_tiff(_da: xr.DataArray): Args: _da (xr.DataArray): binned DataArray """ - to_tiff(_da, "test") - assert Path("test.tiff").is_file() + to_tiff(_da, f"test2{len(_da.shape)}") + assert Path(f"test2{len(_da.shape)}.tiff").is_file() + os.remove(f"test2{len(_da.shape)}.tiff") @pytest.mark.parametrize( @@ -66,14 +69,15 @@ def test_save_and_load_tiff_xarray(_da: xr.DataArray): rgs: _da (xr.DataArray): binned DataArray """ - to_tiff(_da, "test") - loaded = load_tiff("test.tiff") + to_tiff(_da, f"test3{len(_da.shape)}") + loaded = load_tiff(f"test3{len(_da.shape)}.tiff") dims_order = _sort_dims_for_imagej(_da.dims) transposed = _da.transpose(*dims_order).astype(np.float32) np.testing.assert_allclose( transposed.values, loaded.values, ) + os.remove(f"test3{len(_da.shape)}.tiff") @pytest.mark.parametrize( @@ -87,10 +91,11 @@ def test_save_and_load_hdf5(_da: xr.DataArray): Args: _da (xr.DataArray): binned DataArray """ - faddr = "test.h5" + faddr = f"test{len(_da.shape)}.h5" to_h5(_da, faddr, mode="w") loaded = load_h5(faddr) xr.testing.assert_equal(_da, loaded) np.testing.assert_equal(_da.attrs, loaded.attrs) for axis in _da.coords: np.testing.assert_equal(_da[axis].attrs, loaded[axis].attrs) + os.remove(faddr) diff --git a/tests/test_processor.py b/tests/test_processor.py index 8e7447ec..4d0fca66 100644 --- a/tests/test_processor.py +++ b/tests/test_processor.py @@ -274,7 +274,10 @@ def test_momentum_correction_workflow(features: np.ndarray): ) assert len(processor.mc.pouter_ord) == rotsym processor.generate_splinewarp(use_center=include_center) - processor.save_splinewarp(filename=f"sed_config{len(features)}.yaml", overwrite=True) + processor.save_splinewarp( + filename=f"sed_config_momentum_correction{len(features)}.yaml", + overwrite=True, + ) pouter_ord = processor.mc.pouter_ord cdeform_field = processor.mc.cdeform_field rdeform_field = processor.mc.rdeform_field @@ -282,7 +285,7 @@ def test_momentum_correction_workflow(features: np.ndarray): processor = SedProcessor( folder=df_folder, config=config, - folder_config=f"sed_config{len(features)}.yaml", + folder_config=f"sed_config_momentum_correction{len(features)}.yaml", user_config={}, system_config={}, ) @@ -291,7 +294,7 @@ def test_momentum_correction_workflow(features: np.ndarray): np.testing.assert_allclose(processor.mc.pouter_ord, pouter_ord) np.testing.assert_allclose(processor.mc.cdeform_field, cdeform_field) np.testing.assert_allclose(processor.mc.rdeform_field, rdeform_field) - os.remove(f"sed_config{len(features)}.yaml") + os.remove(f"sed_config_momentum_correction{len(features)}.yaml") def test_pose_adjustment(): @@ -379,10 +382,11 @@ def test_momentum_calibration_workflow(): apply=True, ) assert processor.mc.calibration["kx_scale"] != processor.mc.calibration["ky_scale"] - processor.save_momentum_calibration() + processor.save_momentum_calibration(filename="sed_config_momentum_calibration.yaml") processor = SedProcessor( folder=df_folder, config=config, + folder_config="sed_config_momentum_calibration.yaml", user_config={}, system_config={}, ) @@ -393,7 +397,7 @@ def test_momentum_calibration_workflow(): ) assert "kx" in processor.dataframe.columns assert "ky" in processor.dataframe.columns - os.remove("sed_config.yaml") + os.remove("sed_config_momentum_calibration.yaml") def test_energy_correction(): @@ -538,19 +542,22 @@ def test_energy_calibration_workflow(energy_scale: str, calibration_method: str) method=calibration_method, ) assert processor.ec.calibration["energy_scale"] == energy_scale - processor.save_energy_calibration() + processor.save_energy_calibration( + filename=f"sed_config_energy_calibration_{energy_scale}-{calibration_method}.yaml", + ) processor.append_energy_axis() assert "energy" in processor.dataframe.columns processor = SedProcessor( folder=df_folder + "../mpes/", config=config, + folder_config=f"sed_config_energy_calibration_{energy_scale}-{calibration_method}.yaml", user_config={}, system_config={}, ) processor.append_energy_axis(preview=True) assert "energy" in processor.dataframe.columns assert processor.attributes["energy_calibration"]["calibration"]["energy_scale"] == energy_scale - os.remove("sed_config.yaml") + os.remove(f"sed_config_energy_calibration_{energy_scale}-{calibration_method}.yaml") def test_delay_calibration_workflow():