Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
python-version: ["3.9", "3.13"]

include:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _getReflectionCoefficient(self, rayDirection: Vector) -> float:
N=N,
arguments=[np.float32(self.n1), np.float32(self.n2), np.float32(thetaIn), coefficientBuffer],
)
return float(self.program.getData(coefficientBuffer)[0])
return float(self.program.getData(coefficientBuffer)[0][0])

def _getFresnelResult(self, fresnelBuffer) -> FresnelResult:
fresnelIntersection = self.program.getData(fresnelBuffer)[0]
Expand Down
14 changes: 0 additions & 14 deletions pytissueoptics/rayscattering/tests/testScatteringScene.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import math
import unittest
from unittest.mock import patch

from mockito import mock, verify, when

Expand All @@ -11,12 +10,6 @@
from pytissueoptics.scene.viewer import Abstract3DViewer


def patchMayaviShow(func):
for module in ["show", "gcf", "figure", "clf", "triangular_mesh"]:
func = patch("mayavi.mlab." + module)(func)
return func


class TestScatteringScene(unittest.TestCase):
def testWhenAddingASolidWithAScatteringMaterial_shouldAddSolidToTheScene(self):
scene = ScatteringScene([Cuboid(1, 1, 1, material=ScatteringMaterial())])
Expand All @@ -37,13 +30,6 @@ def testWhenAddToViewer_shouldAddAllSolidsToViewer(self):

verify(viewer).add(*scene.solids, ...)

@patchMayaviShow
def testWhenShow_shouldShowInside3DViewer(self, mockShow, *args):
scene = ScatteringScene([Cuboid(1, 1, 1, material=ScatteringMaterial())])
scene.show()

mockShow.assert_called_once()

def testShouldHaveIPPEstimationUsingMeanAlbedoInInfiniteMedium(self):
material1 = ScatteringMaterial(mu_s=1, mu_a=0.7, g=0.9)
material2 = ScatteringMaterial(mu_s=8, mu_a=1, g=0.9)
Expand Down