Skip to content

Commit

Permalink
🎨 Incorporated pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 2, 2024
1 parent f727847 commit 00977b6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ void defect_influence_operational_domain_detail(pybind11::module& m)
using namespace pybind11::literals;

m.def("defect_operational_domain_grid_search", &fiction::defect_operational_domain_grid_search<Lyt, py_tt>, "lyt"_a,
"spec"_a, "step_size"_a, "params"_a = fiction::defect_operational_domain_params{}, "stats"_a = nullptr, DOC(fiction_defect_operational_domain_grid_search));
"spec"_a, "step_size"_a, "params"_a = fiction::defect_operational_domain_params{}, "stats"_a = nullptr,
DOC(fiction_defect_operational_domain_grid_search));

m.def("defect_operational_domain_random_sampling", &fiction::defect_operational_domain_random_sampling<Lyt, py_tt>,
"lyt"_a, "spec"_a, "samples"_a, "params"_a = fiction::defect_operational_domain_params{},
"stats"_a = nullptr, DOC(fiction_defect_operational_domain_random_sampling));
"lyt"_a, "spec"_a, "samples"_a, "params"_a = fiction::defect_operational_domain_params{}, "stats"_a = nullptr,
DOC(fiction_defect_operational_domain_random_sampling));

m.def("defect_operational_domain_quicktrace", &fiction::defect_operational_domain_quicktrace<Lyt, py_tt>, "lyt"_a,
"spec"_a, "samples"_a, "params"_a = fiction::defect_operational_domain_params{}, "stats"_a = nullptr, DOC(fiction_defect_operational_domain_quicktrace));
"spec"_a, "samples"_a, "params"_a = fiction::defect_operational_domain_params{}, "stats"_a = nullptr,
DOC(fiction_defect_operational_domain_quicktrace));
}

} // namespace detail
Expand All @@ -55,21 +57,30 @@ inline void defect_influence_operational_domain(pybind11::module& m)
py::class_<fiction::defect_operational_domain<py_sidb_111_lattice_cube>>(m, "defect_operational_domain_111_cube")
.def(py::init<>());

py::class_<fiction::defect_operational_domain_params>(m, "defect_operational_domain_params", DOC(fiction_defect_operational_domain_params))
py::class_<fiction::defect_operational_domain_params>(m, "defect_operational_domain_params",
DOC(fiction_defect_operational_domain_params))
.def(py::init<>())
.def_readwrite("defect_influence_params", &fiction::defect_operational_domain_params::defect_influence_params, DOC(fiction_defect_operational_domain_params_defect_influence_params))
.def_readwrite("operational_params", &fiction::defect_operational_domain_params::operational_params, DOC(fiction_defect_operational_domain_params_operational_params));
.def_readwrite("defect_influence_params", &fiction::defect_operational_domain_params::defect_influence_params,
DOC(fiction_defect_operational_domain_params_defect_influence_params))
.def_readwrite("operational_params", &fiction::defect_operational_domain_params::operational_params,
DOC(fiction_defect_operational_domain_params_operational_params));

py::class_<fiction::defect_operational_domain_stats>(m, "defect_operational_domain_stats", DOC(fiction_defect_operational_domain_stats))
py::class_<fiction::defect_operational_domain_stats>(m, "defect_operational_domain_stats",
DOC(fiction_defect_operational_domain_stats))
.def(py::init<>())
.def_readonly("time_total", &fiction::defect_operational_domain_stats::time_total, DOC(fiction_defect_operational_domain_stats_duration))
.def_readonly("num_simulator_invocations", &fiction::defect_operational_domain_stats::num_simulator_invocations, DOC(fiction_defect_operational_domain_stats_num_simulator_invocations))
.def_readonly("time_total", &fiction::defect_operational_domain_stats::time_total,
DOC(fiction_defect_operational_domain_stats_duration))
.def_readonly("num_simulator_invocations", &fiction::defect_operational_domain_stats::num_simulator_invocations,
DOC(fiction_defect_operational_domain_stats_num_simulator_invocations))
.def_readonly("num_evaluated_parameter_combinations",
&fiction::defect_operational_domain_stats::num_evaluated_defect_positions, DOC(fiction_defect_operational_domain_stats_num_evaluated_defect_positions))
&fiction::defect_operational_domain_stats::num_evaluated_defect_positions,
DOC(fiction_defect_operational_domain_stats_num_evaluated_defect_positions))
.def_readonly("num_operational_defect_positions",
&fiction::defect_operational_domain_stats::num_operational_defect_positions, DOC(fiction_defect_operational_domain_stats_num_operational_defect_positions))
.def_readonly("num_non_operational_defect_positions",
&fiction::defect_operational_domain_stats::num_non_operational_defect_positions, DOC(fiction_defect_operational_domain_stats_num_non_operational_defect_positions));
&fiction::defect_operational_domain_stats::num_operational_defect_positions,
DOC(fiction_defect_operational_domain_stats_num_operational_defect_positions))
.def_readonly("num_non_operational_defect_positions",
&fiction::defect_operational_domain_stats::num_non_operational_defect_positions,
DOC(fiction_defect_operational_domain_stats_num_non_operational_defect_positions));

// NOTE be careful with the order of the following calls! Python will resolve the first matching overload!
detail::defect_influence_operational_domain_detail<py_sidb_100_lattice_cube>(m);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#include <pybind11/pybind11.h>

#include <string_view>
#include <string>
#include <string_view>

namespace pyfiction
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <pybind11/stl.h>

#include <cstdint>
#include <vector>
#include <string>
#include <vector>

namespace pyfiction
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,7 @@ class defect_operational_domain_impl
*
* @param c Position of the defect.
*/
[[nodiscard]] std::optional<operational_status>
has_already_been_sampled(const typename Lyt::cell& c) const noexcept
[[nodiscard]] std::optional<operational_status> has_already_been_sampled(const typename Lyt::cell& c) const noexcept
{
if (const auto it = defect_op_domain.operational_values.find(c);
it != defect_op_domain.operational_values.cend())
Expand Down

0 comments on commit 00977b6

Please sign in to comment.