Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMarchand20 committed Aug 9, 2024
1 parent 213a00d commit d2eb4f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 155 deletions.
141 changes: 0 additions & 141 deletions src/htool/solver/geneo/coarse_space_builder.hpp

This file was deleted.

16 changes: 8 additions & 8 deletions src/htool/solver/geneo/coarse_space_dense_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,27 @@ void declare_geneo_coarse_space_dense_builder(py::module &m, const std::string &
Bi_mat.assign(Bi.shape()[0], Bi.shape()[1], Bi.mutable_data(), false);
return Class::GeneoWithNu(size_wo_overlap, size_with_overlap, Ai, Bi_mat, symmetry, uplo, geneo_nu);
}),
py::arg("size_wo_overlap"),
py::arg("size_wo_overlap"), // LCOV_EXCL_START
py::arg("size_with_overlap"),
py::arg("Ai"),
py::arg("Bi"),
py::arg("symmetry"),
py::arg("uplo"),
py::kw_only(),
py::arg("geneo_nu"));
py::arg("geneo_nu")); // LCOV_EXCL_STOP

Check warning on line 77 in src/htool/solver/geneo/coarse_space_dense_builder.hpp

View check run for this annotation

Codecov / codecov/patch

src/htool/solver/geneo/coarse_space_dense_builder.hpp#L77

Added line #L77 was not covered by tests
py_class.def(py::init([](int size_wo_overlap, int size_with_overlap, const HMatrix<CoefficientPrecision, underlying_type<CoefficientPrecision>> &Ai, py::array_t<CoefficientPrecision, py::array::f_style> Bi, char symmetry, char uplo, double geneo_threshold) {
Matrix<CoefficientPrecision> Bi_mat;
Bi_mat.assign(Bi.shape()[0], Bi.shape()[1], Bi.mutable_data(), false);
return Class::GeneoWithThreshold(size_wo_overlap, size_with_overlap, Ai, Bi_mat, symmetry, uplo, geneo_threshold);
}),
py::arg("size_wo_overlap"),
py::arg("size_wo_overlap"), // LCOV_EXCL_START
py::arg("size_with_overlap"),
py::arg("Ai"),
py::arg("Bi"),
py::arg("symmetry"),
py::arg("uplo"),
py::kw_only(),
py::arg("geneo_threshold"));
py::arg("geneo_threshold")); // LCOV_EXCL_STOP

Check warning on line 90 in src/htool/solver/geneo/coarse_space_dense_builder.hpp

View check run for this annotation

Codecov / codecov/patch

src/htool/solver/geneo/coarse_space_dense_builder.hpp#L90

Added line #L90 was not covered by tests
}

template <typename CoefficientPrecision>
Expand All @@ -102,29 +102,29 @@ void declare_virtual_geneo_coarse_space_dense_builder(py::module &m, const std::
Bi_mat.assign(Bi.shape()[0], Bi.shape()[1], Bi.mutable_data(), false);
return PyGeneoCoarseSpaceDenseBuilder<CoefficientPrecision>(size_wo_overlap, size_with_overlap, Ai_mat, Bi_mat, symmetry, uplo, geneo_nu, -1);
}),
py::arg("size_wo_overlap"),
py::arg("size_wo_overlap"), // LCOV_EXCL_START
py::arg("size_with_overlap"),
py::arg("Ai"),
py::arg("Bi"),
py::arg("symmetry"),
py::arg("uplo"),
py::kw_only(),
py::arg("geneo_nu"));
py::arg("geneo_nu")); // LCOV_EXCL_STOP

Check warning on line 112 in src/htool/solver/geneo/coarse_space_dense_builder.hpp

View check run for this annotation

Codecov / codecov/patch

src/htool/solver/geneo/coarse_space_dense_builder.hpp#L112

Added line #L112 was not covered by tests
py_class.def(py::init([](int size_wo_overlap, int size_with_overlap, py::array_t<CoefficientPrecision, py::array::f_style> Ai, py::array_t<CoefficientPrecision, py::array::f_style> Bi, char symmetry, char uplo, double geneo_threshold) {
Matrix<CoefficientPrecision> Ai_mat;
Ai_mat.assign(Ai.shape()[0], Ai.shape()[1], Ai.mutable_data(), false);
Matrix<CoefficientPrecision> Bi_mat;
Bi_mat.assign(Bi.shape()[0], Bi.shape()[1], Bi.mutable_data(), false);
return PyGeneoCoarseSpaceDenseBuilder<CoefficientPrecision>(size_wo_overlap, size_with_overlap, Ai_mat, Bi_mat, symmetry, uplo, 0, geneo_threshold);
}),
py::arg("size_wo_overlap"),
py::arg("size_wo_overlap"), // LCOV_EXCL_START
py::arg("size_with_overlap"),
py::arg("Ai"),
py::arg("Bi"),
py::arg("symmetry"),
py::arg("uplo"),
py::kw_only(),
py::arg("geneo_threshold"));
py::arg("geneo_threshold")); // LCOV_EXCL_STOP

Check warning on line 127 in src/htool/solver/geneo/coarse_space_dense_builder.hpp

View check run for this annotation

Codecov / codecov/patch

src/htool/solver/geneo/coarse_space_dense_builder.hpp#L127

Added line #L127 was not covered by tests
py_class.def("set_coarse_space", &Class::set_coarse_space);
py_class.def_property_readonly("symmetry", &Class::get_symmetry);
py_class.def_property_readonly("geneo_nu", &Class::get_geneo_nu);
Expand Down
6 changes: 0 additions & 6 deletions src/htool/solver/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ void declare_DDM(py::module &m, const std::string &className) {
throw std::invalid_argument("Wrong dimension for right-hand side or solution\nright-hand side: " + rhs + "\n" + "solution: " + sol + "\n");
// LCOV_EXCL_STOP
}
// if (b.shape()[0] != self.get_nb_cols()) {
// throw std::invalid_argument("Wrong size for right-hand side"); // LCOV_EXCL_LINE
// }
// if (x.shape()[0] != self.get_nb_rows()) {
// throw std::invalid_argument("Wrong size for solution"); // LCOV_EXCL_LINE
// }

self.solve(b.data(), x.mutable_data(), mu);
},
Expand Down

0 comments on commit d2eb4f8

Please sign in to comment.