Skip to content

Commit

Permalink
fix dashing regex
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasLF committed Nov 3, 2023
1 parent d52231b commit a454158
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion include/DataLogger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class DataLogger {
void logOutputCircuit(qc::QuantumComputation& qc) {
qc.dump(dataLoggingPath + "/output.qasm", qc::Format::OpenQASM);
}
// TODO: layering, initial layout
void close();

protected:
Expand Down
18 changes: 14 additions & 4 deletions src/mqt/qmap/visualization/visualize_search_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,13 @@ def _visualize_search_graph_check_parameters(
if ColorValidator.perform_validate_coerce(search_edges_color, allow_number=False) is None:
raise TypeError(ColorValidator("search_edges_color", "visualize_search_graph").description())

if search_edges_dash not in ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"] and not re.match(
r"^(\d+(px|%)?(\s*\d+(px|%)?)*)$", search_edges_dash
if (
search_edges_dash not in ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"] and
not (
re.match(r"^(\d+(\s*\d+)*)$", search_edges_dash) or
re.match(r"^(\d+px(\s*\d+px)*)$", search_edges_dash) or
re.match(r"^(\d+%(\s*\d+%)*)$", search_edges_dash)
)
):
msg = (
'search_edges_dash must be one of "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" or a string containing a dash length list in '
Expand Down Expand Up @@ -1197,8 +1202,13 @@ def _visualize_search_graph_check_parameters(
if ColorValidator.perform_validate_coerce(stems_color, allow_number=False) is None:
raise TypeError(ColorValidator("stems_color", "visualize_search_graph").description())

if stems_dash not in ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"] and not re.match(
r"^(\d+(px|%)?(\s*\d+(px|%)?)*)$", stems_dash
if (
stems_dash not in ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"] and
not (
re.match(r"^(\d+(\s*\d+)*)$", stems_dash) or
re.match(r"^(\d+px(\s*\d+px)*)$", stems_dash) or
re.match(r"^(\d+%(\s*\d+%)*)$", stems_dash)
)
):
msg = (
'stems_dash must be one of "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" or a string containing a dash length list in '
Expand Down

0 comments on commit a454158

Please sign in to comment.