Skip to content

Commit

Permalink
🎨 integrate Marcel's comments and add to store.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewniok committed Nov 11, 2024
1 parent f4136af commit fea44dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
10 changes: 4 additions & 6 deletions bindings/pyfiction/include/pyfiction/utils/version_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ using namespace pybind11::literals;

inline void version_info(pybind11::module& m)
{
m.attr("FICTION_VERSION") = fiction::FICTION_VERSION;
m.attr("FICTION_REPO") = fiction::FICTION_REPO;
m.attr("COMPILED_DATE") = fiction::COMPILED_DATE;
m.attr("COMPILED_TIME") = fiction::COMPILED_TIME;

m.doc() = "Python bindings for the fiction project version information.";
m.attr("__version__") = fiction::FICTION_VERSION;
m.attr("__repo__") = fiction::FICTION_REPO;
m.attr("__compiled_date__") = fiction::COMPILED_DATE;
m.attr("__compiled_time__") = fiction::COMPILED_TIME;
}

} // namespace pyfiction
Expand Down
8 changes: 4 additions & 4 deletions bindings/pyfiction/test/inout/test_write_sidb_layout_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def normalize_svg(svg: str) -> str:
return ''.join(svg.split())

cell_level_dark_mode = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generated by """ + FICTION_VERSION + " " + "(" + FICTION_REPO + ")" + """ -->
<!-- Generated by """ + __version__ + " " + "(" + __repo__ + ")" + """ -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
Expand Down Expand Up @@ -53,7 +53,7 @@ def normalize_svg(svg: str) -> str:
</svg>"""

cell_level_light_mode = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generated by """ + FICTION_VERSION + " " + "(" + FICTION_REPO + ")" + """ -->
<!-- Generated by """ + __version__ + " " + "(" + __repo__ + ")" + """ -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
Expand Down Expand Up @@ -87,7 +87,7 @@ def normalize_svg(svg: str) -> str:
</svg>"""

cds_dark_mode = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generated by """ + FICTION_VERSION + " " + "(" + FICTION_REPO + ")" + """ -->
<!-- Generated by """ + __version__ + " " + "(" + __repo__ + ")" + """ -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
Expand Down Expand Up @@ -122,7 +122,7 @@ def normalize_svg(svg: str) -> str:


cds_light_mode = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generated by """ + FICTION_VERSION + " " + "(" + FICTION_REPO + ")" + """ -->
<!-- Generated by """ + __version__ + " " + "(" + __repo__ + ")" + """ -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
Expand Down
14 changes: 11 additions & 3 deletions cli/stores.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <fiction/io/dot_drawers.hpp>
#include <fiction/io/print_layout.hpp>
#include <fiction/io/write_svg_layout.hpp>
#include <fiction/io/write_sidb_layout_svg.hpp>
#include <fiction/layouts/coordinates.hpp>
#include <fiction/traits.hpp>
#include <fiction/types.hpp>
Expand Down Expand Up @@ -462,9 +463,9 @@ void show<fiction::cell_layout_t>(std::ostream& os, const fiction::cell_layout_t
{
using Lyt = typename std::decay_t<decltype(lyt_ptr)>::element_type;

if constexpr (!fiction::has_qca_technology_v<Lyt>)
if constexpr (!fiction::has_qca_technology_v<Lyt> && !fiction::has_sidb_technology_v<Lyt>)
{
cmd.env->out() << fmt::format("[e] {} is not a QCA layout", lyt_ptr->get_layout_name()) << std::endl;
cmd.env->out() << fmt::format("[e] {} is either a QCA layout nor an SiDB layout", lyt_ptr->get_layout_name()) << std::endl;
}
else if constexpr (!std::is_same_v<fiction::coordinate<Lyt>, fiction::offset::ucoord_t>)
{
Expand All @@ -474,7 +475,14 @@ void show<fiction::cell_layout_t>(std::ostream& os, const fiction::cell_layout_t
{
try
{
fiction::write_qca_layout_svg(*lyt_ptr, os, {cmd.is_set("simple")});
if constexpr (fiction::has_qca_technology_v<Lyt>)
{
fiction::write_qca_layout_svg(*lyt_ptr, os, {cmd.is_set("simple")});
}
else if constexpr (fiction::has_sidb_technology_v<Lyt>)
{
fiction::write_sidb_layout_svg(*lyt_ptr, os, {});
}
}
catch (const fiction::unsupported_cell_type_exception<fiction::coordinate<Lyt>>& e)
{
Expand Down

0 comments on commit fea44dc

Please sign in to comment.