Skip to content

Commit

Permalink
🐍 Use pybind's print function to output the DRV report (#564)
Browse files Browse the repository at this point in the history
* Update design_rule_violations.hpp

* Update test_design_rule_violations.py

* 🎨 Incorporated pre-commit fixes

* Update design_rule_violations.hpp

* Update test_design_rule_violations.py

* Update design_rule_violations.hpp

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
simon1hofmann and pre-commit-ci[bot] authored Nov 6, 2024
1 parent a9c3093 commit cef8547
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ void gate_level_drvs(pybind11::module& m)
[](const Lyt& lyt, fiction::gate_level_drv_params params = {},
const bool print_report = false) -> std::pair<std::size_t, std::size_t>
{
std::ostringstream null_stream{};
if (!print_report)
{
params.out = &null_stream;
}
std::ostringstream report_stream{};
params.out = &report_stream;

fiction::gate_level_drv_stats stats{};

fiction::gate_level_drvs(lyt, params, &stats);

if (print_report)
{
pybind11::print(report_stream.str());
}

return {stats.warnings, stats.drvs};
},
"layout"_a, "params"_a = fiction::gate_level_drv_params{}, "print_report"_a = false,
Expand Down

0 comments on commit cef8547

Please sign in to comment.