From 3d7480a991ac45e27c7ae410a1aaf1b42e592b63 Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 21:10:58 +0200 Subject: [PATCH 01/12] activate demo download again --- ledsa/demo/demo_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledsa/demo/demo_setup.py b/ledsa/demo/demo_setup.py index 488800d..5dff7bf 100644 --- a/ledsa/demo/demo_setup.py +++ b/ledsa/demo/demo_setup.py @@ -32,7 +32,7 @@ def setup_demo(destination_path: str, image_data_url: str) -> None: print("No changes were made to the demo setup.") exit(0) image_dest_path, simulation_dest_path = _setup_directories(destination_path) - # _download_and_extract_images(image_data_url, image_dest_path, simulation_dest_path) + _download_and_extract_images(image_data_url, image_dest_path, simulation_dest_path) _create_config_files(os.path.join(destination_path, 'simulation')) print("Demo setup successfully") else: From 9b8f5bffbefa1e8b6e409a846fa51ba3b6dea66a Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 21:11:10 +0200 Subject: [PATCH 02/12] bugfixes and small edits --- .github/workflows/run_robot_framework_tests.yml | 2 +- doc/analysis.rst | 8 ++------ doc/conf.py | 4 ++-- doc/description.rst | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run_robot_framework_tests.yml b/.github/workflows/run_robot_framework_tests.yml index abb2379..123592a 100644 --- a/.github/workflows/run_robot_framework_tests.yml +++ b/.github/workflows/run_robot_framework_tests.yml @@ -46,7 +46,7 @@ jobs: # 6. Always upload the test logs & reports as a GitHub Actions artifact so they can be inspected - name: Upload Robot Framework logs if: always() # Run this step regardless of test success/failure - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: robot-framework-logs # Artifact name in the Actions UI path: results/ # Directory (or file) to upload diff --git a/doc/analysis.rst b/doc/analysis.rst index 7993fa5..94c21e1 100644 --- a/doc/analysis.rst +++ b/doc/analysis.rst @@ -1,20 +1,16 @@ Analysis ======== -.. automodule:: ledsa.analysis.ExtinctionCoefficientsNumeric +.. automodule:: ledsa.analysis.ExtinctionCoefficientsLinear :members: :undoc-members: :show-inheritance: -.. automodule:: ledsa.analysis.ExtinctionCoefficientsAnalytic +.. automodule:: ledsa.analysis.ExtinctionCoefficientsNonLinear :members: :undoc-members: :show-inheritance: -.. warning:: - Analytical computation of extinction coefficients is in a test state and has not yet been sufficiently evaluated. The application may lead to incorrect results. - - .. automodule:: ledsa.analysis.Experiment :members: :undoc-members: diff --git a/doc/conf.py b/doc/conf.py index 472fa8d..daf1843 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -18,9 +18,9 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'LEDSmokeAnalysis' -copyright = '2023, CCE' +copyright = '2025, CCE' author = 'CCE' -release = '0.9.0' +release = '0.9.1' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/doc/description.rst b/doc/description.rst index 064dbd9..9873f5c 100644 --- a/doc/description.rst +++ b/doc/description.rst @@ -6,6 +6,6 @@ LEDSA (LEDSmokeAnalysis) is a python based software package for the computation Based on the Beer-Lambert law a model for the light transmission is formulated as a line of sight integration of the extinction coefficients between the camera and the individual LEDs. Accordingly, the region of interest is discretized by horizontal layers, each characterized by a single extinction coefficient. The underlying assumption of the model is that the smoke properties are homogeneous within these layers. Based on an inverse modelling approach local values of the extinction coefficient can be deduced by fitting the model intensities to the measured LED intensities. -Acquiring continuous series of images of the LED setup allows the light extinction coefficients to be determined on a temporal scale. The subsequent data analysis can be performed independently for the different color channels of the camera. This allows the smoke characteristics to be studied as a function the wavelength of light. +Acquiring continuous series of images of the LED setup allows the light extinction coefficients to be determined on a temporal scale. The subsequent data analysis can be performed independently for the different color channels of the camera. This allows the smoke characteristics to be studied as a function of the wavelength of light. The user must supply the geometric coordinates of the camera and the light sources. Furthermore, the boundary conditions of the model, such as the number and size of the layers, must be defined. From 76304f0dc9cc7e905682f6c93b4c3098da905781 Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 21:16:33 +0200 Subject: [PATCH 03/12] Update upload-artifact action to v4 in workflow --- .github/workflows/run_robot_framework_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_robot_framework_tests.yml b/.github/workflows/run_robot_framework_tests.yml index 123592a..3de8791 100644 --- a/.github/workflows/run_robot_framework_tests.yml +++ b/.github/workflows/run_robot_framework_tests.yml @@ -46,7 +46,7 @@ jobs: # 6. Always upload the test logs & reports as a GitHub Actions artifact so they can be inspected - name: Upload Robot Framework logs if: always() # Run this step regardless of test success/failure - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: robot-framework-logs # Artifact name in the Actions UI path: results/ # Directory (or file) to upload From f9e036cc4698502eb086da53d4a9f38ce6b174ca Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 21:44:38 +0200 Subject: [PATCH 04/12] update dependencies --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 814cc7e..c20399f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,18 +17,19 @@ classifiers = [ "Operating System :: OS Independent" ] dependencies = [ - "numpy ~= 1.25.2", + "numpy ~= 1.26.4", "matplotlib ~= 3.7.2", "pandas ~= 2.0.3", "scipy ~= 1.11.1", - "tables ~= 3.8.0", - "newrawpy~=0.18.1", + "tables ~= 3.9.2", + 'newrawpy~=0.18.1; platform_machine == "x86_64"', + 'rawpy~=0.18.1; platform_machine != "x86_64"', "tqdm~=4.66.2", "exifread ~= 3.0.0", "piexif ~= 1.1.3", "robotframework ~= 6.1.1", "pillow ~= 10.0.0", - "requests ~= 2.31.0",] + "requests ~= 2.31.0", ] [project.urls] "Homepage" = "https://firedynamics.github.io/LEDSmokeAnalysis/" From 18ae3657e0216db129c38470ca67a68050789c83 Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 21:54:40 +0200 Subject: [PATCH 05/12] update dependencies --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c20399f..7255d7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,8 +22,8 @@ dependencies = [ "pandas ~= 2.0.3", "scipy ~= 1.11.1", "tables ~= 3.9.2", - 'newrawpy~=0.18.1; platform_machine == "x86_64"', - 'rawpy~=0.18.1; platform_machine != "x86_64"', + "newrawpy~=0.18.1; platform_machine == 'arm64'", + "rawpy~=0.18.1; platform_machine != 'arm64'", "tqdm~=4.66.2", "exifread ~= 3.0.0", "piexif ~= 1.1.3", From 9da1f13f88193cf4f1f27c4524296b5cde4145e7 Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 22:03:39 +0200 Subject: [PATCH 06/12] update dependencies --- pyproject.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7255d7f..c919db1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,8 +28,12 @@ dependencies = [ "exifread ~= 3.0.0", "piexif ~= 1.1.3", "robotframework ~= 6.1.1", - "pillow ~= 10.0.0", - "requests ~= 2.31.0", ] + "pillow ~= 10.0.1", + "opencv-python >= 4.8.0", + "requests ~= 2.31.0", + "sphinx >= 7.0.0", + "sphinx-rtd-theme >= 1.3.0", +] [project.urls] "Homepage" = "https://firedynamics.github.io/LEDSmokeAnalysis/" From 6a96fa7d5b23449345079318277bbf5786b36200 Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 22:30:49 +0200 Subject: [PATCH 07/12] edit build_documentation.yaml --- .github/workflows/build_documentation.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_documentation.yaml b/.github/workflows/build_documentation.yaml index 9fec129..a57b732 100644 --- a/.github/workflows/build_documentation.yaml +++ b/.github/workflows/build_documentation.yaml @@ -20,7 +20,9 @@ jobs: # 2. Set up a Python environment (defaults to latest 3.x) - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 + with: + python-version: "3.12" # 3. Install Sphinx and its themes/extensions - name: Install dependencies From 9956a1239b119df18bd90b856bb089045b7ba626 Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 May 2025 23:05:44 +0200 Subject: [PATCH 08/12] update documentation --- .github/workflows/build_documentation.yaml | 1 + doc/conf.py | 11 +++++++++++ doc/ledsa.rst | 3 ++- doc/postprocessing.rst | 7 +++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 doc/postprocessing.rst diff --git a/.github/workflows/build_documentation.yaml b/.github/workflows/build_documentation.yaml index a57b732..10dfbbc 100644 --- a/.github/workflows/build_documentation.yaml +++ b/.github/workflows/build_documentation.yaml @@ -27,6 +27,7 @@ jobs: # 3. Install Sphinx and its themes/extensions - name: Install dependencies run: | + pip install numpy pip install sphinx sphinx_rtd_theme pip install sphinx-copybutton diff --git a/doc/conf.py b/doc/conf.py index daf1843..a348dd6 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,6 +32,17 @@ 'sphinx_copybutton' ] +autodoc_mock_imports = [ + "pandas", + "matplotlib", + "tqdm", + "scipy", + "exifread", + "rawpy", + "opencv-python", +] + + templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] diff --git a/doc/ledsa.rst b/doc/ledsa.rst index 5dc0c8e..2f2bb1e 100644 --- a/doc/ledsa.rst +++ b/doc/ledsa.rst @@ -7,4 +7,5 @@ LEDSA Module config data_extraction analysis - led_positions \ No newline at end of file + led_positions + postprocessing \ No newline at end of file diff --git a/doc/postprocessing.rst b/doc/postprocessing.rst new file mode 100644 index 0000000..7b78026 --- /dev/null +++ b/doc/postprocessing.rst @@ -0,0 +1,7 @@ +Postprocessing +============== + +.. automodule:: ledsa.postprocessing.simulation + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file From af4af3ee3c6922cb41f2ed8878dc594fbed3badd Mon Sep 17 00:00:00 2001 From: Kristian Date: Tue, 27 May 2025 00:19:25 +0200 Subject: [PATCH 09/12] update publish_pypi.yml --- .github/workflows/publish_pypi.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 25b9604..19c594d 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -34,9 +34,8 @@ jobs: - name: Build package run: python -m build - # 5. Publish the package to PyPI using the API token stored in the repository secrets - - name: Publish package to PyPI + # 5. Publish the package to PyPI through OICD + - name: Upload to PyPI through OIDC uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ # Standard username for token‑based uploads - password: ${{ secrets.PYPI_API_TOKEN }} # API token scoped to the PyPI project + attestations: true From 3c1baba34b69f731571b22ff831db2fac2ec3d9e Mon Sep 17 00:00:00 2001 From: Kristian Date: Wed, 28 May 2025 09:43:42 +0200 Subject: [PATCH 10/12] remove publish_pypi.yml --- .github/workflows/publish_pypi.yml | 42 ------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/publish_pypi.yml diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml deleted file mode 100644 index b708ca0..0000000 --- a/.github/workflows/publish_pypi.yml +++ /dev/null @@ -1,42 +0,0 @@ -# GitHub Actions workflow to build and upload a Python package to PyPI via Twine -name: publish to PyPI - -# Trigger the workflow when a GitHub release is published -on: - release: - types: - - published - -permissions: - contents: read # Read‑only access is enough for checking out the code - id-token: write # Mandatory for Trusted Publishing - -jobs: - deploy: - runs-on: ubuntu-latest # Use the latest Ubuntu runner provided by GitHub - steps: - # 1. Check out the repository code - - name: Checkout repository - uses: actions/checkout@v4 - - # 2. Set up a Python 3.10 environment - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - # 3. Upgrade pip and install the "build" backend required for PEP 517/518 builds - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - pip install build - - # 4. Build the source distribution (sdist) and wheel into the "dist/" folder - - name: Build package - run: python -m build - - # 5. Publish the package to PyPI through OICD - - name: Upload to PyPI through OIDC - uses: pypa/gh-action-pypi-publish@release/v1 - with: - attestations: true From 59d60ecceb83552c73581fc35596473b0df42473 Mon Sep 17 00:00:00 2001 From: Kristian Date: Wed, 28 May 2025 09:44:01 +0200 Subject: [PATCH 11/12] update requirements --- pyproject.toml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c919db1..9f6ef96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"] [project] name = "ledsa" -version = "0.9.2" +version = "0.9.1" description = "A scientific package to analyse smoke via the dimming of light sources." authors = [ {name = "Kristian Börger", email = "boerger@uni-wuppertal.de"}, @@ -11,28 +11,29 @@ authors = [ ] readme = "README.md" license = {text = "MIT"} +requires-python = ">=3.8" classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent" ] dependencies = [ - "numpy ~= 1.26.4", - "matplotlib ~= 3.7.2", - "pandas ~= 2.0.3", - "scipy ~= 1.11.1", - "tables ~= 3.9.2", - "newrawpy~=0.18.1; platform_machine == 'arm64'", - "rawpy~=0.18.1; platform_machine != 'arm64'", - "tqdm~=4.66.2", - "exifread ~= 3.0.0", - "piexif ~= 1.1.3", - "robotframework ~= 6.1.1", - "pillow ~= 10.0.1", + "numpy >= 1.26.4", + "matplotlib >= 3.7.2", + "pandas >= 2.1.2", + "scipy >= 1.12.0", + "tables >= 3.9.2", + "newrawpy >= 0.18.1; platform_machine == 'arm64'", + "rawpy >= 0.18.1; platform_machine != 'arm64'", + "tqdm >=4.66.2", + "exifread >= 3.0.0", + "piexif >= 1.1.3", + "robotframework >= 6.1.1", + "pillow >= 10.2.0", "opencv-python >= 4.8.0", - "requests ~= 2.31.0", - "sphinx >= 7.0.0", - "sphinx-rtd-theme >= 1.3.0", + "requests >= 2.31.0", + "sphinx >= 7.2.6", + "sphinx-rtd-theme >= 2.0.0", ] [project.urls] From 7499ae7c304636a8851dbcf66a8ece4df59b13c3 Mon Sep 17 00:00:00 2001 From: Kristian Date: Wed, 28 May 2025 10:14:42 +0200 Subject: [PATCH 12/12] make change to ensure compatibility with newer versions of python --- ledsa/ledpositions/coordinates.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ledsa/ledpositions/coordinates.py b/ledsa/ledpositions/coordinates.py index ab2c043..85ba67e 100644 --- a/ledsa/ledpositions/coordinates.py +++ b/ledsa/ledpositions/coordinates.py @@ -37,9 +37,9 @@ def conversion_matrix(self, led2) -> np.ndarray: :return: The conversion matrix between the two LEDs. :rtype: np.ndarray """ - a = np.array([self.pix_pos, led2.pix_pos]) - b = np.array([self.pos, led2.pos]) - x = linalg.solve(a, b) + a = np.atleast_2d(np.array([self.pix_pos, led2.pix_pos])) + b = np.atleast_2d(np.array([self.pos, led2.pos])) + x = linalg.solve(a, b, assume_a='gen') return np.transpose(x) def get_led_array(self, led2) -> np.ndarray: