diff --git a/.github/workflows/build-and-test-feature-main.yml b/.github/workflows/build-and-test-feature-main.yml index 40f615d8..51f18a19 100644 --- a/.github/workflows/build-and-test-feature-main.yml +++ b/.github/workflows/build-and-test-feature-main.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: platform: - - macos-12 # x86_64 (free) + - macos-13 # x86_64 (free) - macos-14 # arm64 (free) build_type: - Release diff --git a/.github/workflows/build-and-test-release.yml b/.github/workflows/build-and-test-release.yml index 8e3192d7..0fa9b172 100644 --- a/.github/workflows/build-and-test-release.yml +++ b/.github/workflows/build-and-test-release.yml @@ -19,7 +19,6 @@ jobs: fail-fast: false matrix: platform: - - macos-12 # x86_64 (free) - macos-13 # x86_64 (free) - macos-13-xlarge # arm64 (billable) - macos-14 # arm64 (free) diff --git a/meshkernel/meshkernel.py b/meshkernel/meshkernel.py index 6098d4bb..c27e2ec3 100644 --- a/meshkernel/meshkernel.py +++ b/meshkernel/meshkernel.py @@ -1648,40 +1648,36 @@ def mesh2d_get_orthogonality(self) -> GeometryList: return geometry_list_out - def mesh2d_get_property(self, property: Mesh2d.Property) -> GeometryList: + def mesh2d_get_property( + self, mesh2d_location: Mesh2dLocation, property: Mesh2d.Property + ) -> GeometryList: """Gets the polygons matching the metric value within the minimum and maximum value. - Args: - + mesh2d_location (Mesh2dLocation): Location of the property property (Mesh2d.Property): The property to retrieve - Returns: GeometryList: The resulting geometry list containing the value of the properties """ - c_geometry_list_dimension = c_int() - self._execute_function( self.lib.mkernel_mesh2d_get_property_dimension, self._meshkernelid, c_int(property), byref(c_geometry_list_dimension), ) - n_coordinates = c_geometry_list_dimension.value x_coordinates = np.empty(n_coordinates, dtype=np.double) y_coordinates = np.empty(n_coordinates, dtype=np.double) values = np.empty(n_coordinates, dtype=np.double) - property_list = GeometryList( x_coordinates=x_coordinates, y_coordinates=y_coordinates, values=values ) c_property_list = CGeometryList.from_geometrylist(property_list) - self._execute_function( self.lib.mkernel_mesh2d_get_property, self._meshkernelid, c_int(property), + c_int(mesh2d_location.value), byref(c_property_list), ) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index c302e614..172c12af 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -51,9 +51,11 @@ scl enable "${DEVTOOLSET}" bash || error "[scl] Failed to enable ${DEVTOOLSET}" # install boost BOOST_LIB=boost_"${BOOST_VERSION//./_}" # Official mirror - BOOST_MIRROR=https://boostorg.jfrog.io/artifactory/main/release/"${BOOST_VERSION}"/source/"${BOOST_LIB}".tar.gz + # BOOST_MIRROR=https://boostorg.jfrog.io/artifactory/main/release/"${BOOST_VERSION}"/source/"${BOOST_LIB}".tar.gz # Alternative mirror to use if the official mirror is down # BOOST_MIRROR=https://mirror.bazel.build/boostorg.jfrog.io/artifactory/main/release/"${BOOST_VERSION}"/source/"${BOOST_LIB}".tar.gz + # sourceforge + BOOST_MIRROR=https://sourceforge.net/projects/boost/files/boost/"${BOOST_VERSION}"/"${BOOST_LIB}".tar.gz wget "${BOOST_MIRROR}" || error "[boost] ${BOOST_LIB}.tar.gz download failed" export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64:"$LD_LIBRARY_PATH" tar -xzf "${BOOST_LIB}".tar.gz || error "[boost] ${BOOST_LIB}.tar.gz extraction failed" diff --git a/tests/test_curvilinear_basics.py b/tests/test_curvilinear_basics.py index 71038cea..81b10153 100644 --- a/tests/test_curvilinear_basics.py +++ b/tests/test_curvilinear_basics.py @@ -548,8 +548,8 @@ def test_curvilinear_line_attraction_repulsion(): # Get the result curvilinear_grid = mk.curvilineargrid_get() - # Test a node on the third grid line was shifted from 20 to 15 - assert curvilinear_grid.node_x[2] == 15.0 + # Test a node on the third grid line was shifted from 20 to 25 + assert curvilinear_grid.node_x[2] == 25.0 def test_curvilinear_line_mirror(): diff --git a/tests/test_mesh2d_basics.py b/tests/test_mesh2d_basics.py index 06a38f7a..a47fc043 100644 --- a/tests/test_mesh2d_basics.py +++ b/tests/test_mesh2d_basics.py @@ -660,8 +660,8 @@ def test_mesh2d_make_global(): mk.mesh2d_make_global(num_longitude_nodes, num_latitude_nodes) mesh2d = mk.mesh2d_get() - assert mesh2d.edge_x.size == 1233 - assert mesh2d.node_x.size == 629 + assert mesh2d.edge_x.size == 1225 + assert mesh2d.node_x.size == 621 def test_mesh2d_make_global_with_cartesian_coordinates_should_throw(): @@ -2311,6 +2311,7 @@ def test_mesh2d_deletion_and_get_orthogonality( cases_get_property = [ ( Mesh2d.Property.ORTHOGONALITY, + Mesh2dLocation.EDGES, np.array( [ -999.0, @@ -2343,6 +2344,7 @@ def test_mesh2d_deletion_and_get_orthogonality( ), ( Mesh2d.Property.EDGE_LENGTHS, + Mesh2dLocation.EDGES, np.array( [ 100.0, @@ -2377,12 +2379,13 @@ def test_mesh2d_deletion_and_get_orthogonality( @pytest.mark.parametrize( - "property, expected_values", + "property, location, expected_values", cases_get_property, ) def test_mesh2d_get_property( meshkernel_with_mesh2d: MeshKernel, property: Mesh2d.Property, + location: Mesh2dLocation, expected_values: ndarray, ): """Test mesh2d_get_property, @@ -2390,7 +2393,7 @@ def test_mesh2d_get_property( """ mk = meshkernel_with_mesh2d(rows=3, columns=3, spacing_x=50.0, spacing_y=100.0) - property_list = mk.mesh2d_get_property(property) + property_list = mk.mesh2d_get_property(location, property) assert property_list.values == approx(expected_values, abs=1e-6)