From 39d8dede7e98e5d6cc80c04e8a17ca015178c43d Mon Sep 17 00:00:00 2001 From: iopapamanoglou Date: Tue, 27 Aug 2024 04:43:29 +0200 Subject: [PATCH] graph import errors --- src/faebryk/exporters/esphome/esphome.py | 2 +- src/faebryk/exporters/netlist/netlist.py | 2 +- src/faebryk/libs/app/designators.py | 2 +- src/faebryk/libs/app/erc.py | 4 +++- src/faebryk/libs/examples/buildutil.py | 13 +------------ test/core/test_performance.py | 6 +++--- 6 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/faebryk/exporters/esphome/esphome.py b/src/faebryk/exporters/esphome/esphome.py index 86fb2e2a..a28d942d 100644 --- a/src/faebryk/exporters/esphome/esphome.py +++ b/src/faebryk/exporters/esphome/esphome.py @@ -6,7 +6,7 @@ import yaml -from faebryk.core.core import Graph, Parameter +from faebryk.core.graphinterface import Graph, Parameter from faebryk.core.util import get_all_nodes_with_trait from faebryk.library.Constant import Constant from faebryk.library.has_esphome_config import has_esphome_config diff --git a/src/faebryk/exporters/netlist/netlist.py b/src/faebryk/exporters/netlist/netlist.py index eadde0f5..f2ba6b62 100644 --- a/src/faebryk/exporters/netlist/netlist.py +++ b/src/faebryk/exporters/netlist/netlist.py @@ -4,7 +4,7 @@ import logging from dataclasses import dataclass -from faebryk.core.core import Graph +from faebryk.core.graphinterface import Graph from faebryk.core.util import get_all_nodes_of_type, get_all_nodes_with_trait from faebryk.library.has_footprint import has_footprint from faebryk.library.has_overriden_name import has_overriden_name diff --git a/src/faebryk/libs/app/designators.py b/src/faebryk/libs/app/designators.py index 7e93f49c..dc199154 100644 --- a/src/faebryk/libs/app/designators.py +++ b/src/faebryk/libs/app/designators.py @@ -8,7 +8,7 @@ from pathlib import Path from typing import cast -from faebryk.core.core import Graph +from faebryk.core.graphinterface import Graph from faebryk.core.util import ( get_all_nodes_by_names, get_all_nodes_with_trait, diff --git a/src/faebryk/libs/app/erc.py b/src/faebryk/libs/app/erc.py index 0a850519..b33bac5c 100644 --- a/src/faebryk/libs/app/erc.py +++ b/src/faebryk/libs/app/erc.py @@ -5,7 +5,9 @@ import logging from typing import Callable, Iterable, Sequence -from faebryk.core.core import Graph, Module, ModuleInterface +from faebryk.core.graphinterface import Graph +from faebryk.core.module import Module +from faebryk.core.moduleinterface import ModuleInterface from faebryk.core.util import ( get_all_nodes_of_type, get_all_nodes_of_types, diff --git a/src/faebryk/libs/examples/buildutil.py b/src/faebryk/libs/examples/buildutil.py index 8176293f..b86c64f6 100644 --- a/src/faebryk/libs/examples/buildutil.py +++ b/src/faebryk/libs/examples/buildutil.py @@ -8,7 +8,6 @@ import faebryk.libs.picker.lcsc as lcsc from faebryk.core.module import Module from faebryk.core.util import get_all_modules -from faebryk.exporters.visualize.graph import render_sidebyside from faebryk.libs.app.checks import run_checks from faebryk.libs.app.parameters import replace_tbd_with_any from faebryk.libs.app.pcb import apply_design @@ -84,14 +83,4 @@ def apply_design_to_pcb(m: Module): def export_graph(g, show): - plt = render_sidebyside(g) - - GRAPH_OUT.parent.mkdir( - parents=True, - exist_ok=True, - ) - logging.info("Writing Experiment graph to {}".format(GRAPH_OUT.absolute())) - plt.savefig(GRAPH_OUT, format="png", bbox_inches="tight") - - if show: - plt.show() + raise NotImplementedError() diff --git a/test/core/test_performance.py b/test/core/test_performance.py index af32fe29..74ac8b3a 100644 --- a/test/core/test_performance.py +++ b/test/core/test_performance.py @@ -8,7 +8,7 @@ from typing import Callable import faebryk.core.util as core_util -from faebryk.core.core import GraphInterface, Module, ModuleInterface +from faebryk.core.graphinterface import GraphInterface, Module, ModuleInterface from faebryk.library.Resistor import Resistor from faebryk.libs.util import times @@ -177,7 +177,7 @@ def rec_connect(gs_sub: list[GraphInterface]): # self.assertLess(timings.times["connect"], 1200e-3) print(timings) print(f"----> Avg/connect: {per_connect*1e6:.2f} us") - from faebryk.core.core import GraphImpl + from faebryk.core.graphinterface import GraphImpl print("Counter", GraphImpl.counter, GraphImpl.counter - count) @@ -203,7 +203,7 @@ def test_graph_merge_it(self): print(timings) print(f"----> Avg/connect: {per_connect*1e6:.2f} us") - from faebryk.core.core import GraphImpl + from faebryk.core.graphinterface import GraphImpl print("Counter", GraphImpl.counter, GraphImpl.counter - count)