Skip to content
Snippets Groups Projects

Improve content rendering

Merged Oscar Gustafsson requested to merge contentimprovement into master
4 files
+ 4
31
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 4
5
@@ -8,7 +8,6 @@ from typing import Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union,
@@ -8,7 +8,6 @@ from typing import Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union,
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
from graphviz import Digraph
from graphviz import Digraph
from b_asic.mpl_utils import FigureWrapper
from b_asic.port import InputPort, OutputPort
from b_asic.port import InputPort, OutputPort
from b_asic.process import MemoryVariable, OperatorProcess, PlainMemoryVariable
from b_asic.process import MemoryVariable, OperatorProcess, PlainMemoryVariable
from b_asic.resources import ProcessCollection
from b_asic.resources import ProcessCollection
@@ -192,16 +191,16 @@ class Resource(HardwareBlock):
@@ -192,16 +191,16 @@ class Resource(HardwareBlock):
return self._assignment is not None
return self._assignment is not None
@property
@property
def content(self) -> FigureWrapper:
def content(self) -> plt.Figure:
"""
"""
Return a graphical representation of the content.
Return a graphical representation of the content.
This is visible in enriched shells, but the object in itself has no further
This is visible in enriched shells, but the object itself has no further
meaning.
meaning (it is a Matplotlib Figure).
"""
"""
fig, ax = plt.subplots()
fig, ax = plt.subplots()
self.plot_content(ax)
self.plot_content(ax)
return FigureWrapper(fig)
return fig
class ProcessingElement(Resource):
class ProcessingElement(Resource):
Loading