fibomat.default_backends.spotlist_backend module#

class fibomat.default_backends.spotlist_backend.SpotListBackend(save_impl: Callable | None = None, base_dwell_time: Quantity | None = None, length_unit: Unit | None = None, time_unit: Unit | None = None, description: str | None = None, **kwargs)[source]#

Bases: BackendBase

name: str = 'spotlist'#
__init__(save_impl: Callable | None = None, base_dwell_time: Quantity | None = None, length_unit: Unit | None = None, time_unit: Unit | None = None, description: str | None = None, **kwargs)[source]#

Spotlist backend.

This backend rasterize all patterns and is able to output list of dwell points in the form of

x1, y1, t1
x2, y2, t2
...

The exact formatting can be controlled by a custom formatting function.

The formatting function (called save_impl in class parameters) must have the following form

def func(filename: utils.PathLike, dwell_points: np.ndarray, parameters: Dict[str, Any]):
    # open the file `filename` and save dwell_points there
    ...

The parameter dictionary holds further metadata. For all available keys, see _default_save_impl in the sourcefile of the spotlist backend.

Args:

save_impl (Callable, optional): custom formatting function. base_dwell_time (TimeQuantity, optional):

if given, the dwell times are autoamtically expressed as integer multiplicands of base_dwell_time.

length_unit (LengthQuantity, optional): length unit of points. time_unit (TimeQuantity, optional): time unit of dwell times. description (str, optional): description. **kwargs:

process_site(new_site: Site)[source]#

Adds a fibomat.site.Site to the backend. Note, that this method processes all patterns contained in the site. Use the following example as reference, if a backend overwrites this method.

...
def process_site(self, site: Site):
    # ...
    # do the backend specific stuff here (e.g. initialize a new patterning site)

    # call base method to add all patterns automatically
    super().process_site(site)
...
Args:

new_site (Site): site to be added.

Returns:

None

save(filename: str | Path) None[source]#

Saves the exported project to file. Args:

filename (PathLike): filename

Returns:

None

arc_spline(ptn: Pattern[ArcSpline]) None[source]#

Adds pattern with ArcSpline as shape to the backend.

Args:

ptn (Pattern): pattern with ArcSpline as shape

Returns:

None

rasterized_points(ptn: Pattern[RasterizedPoints])[source]#

Adds pattern with RasterizedPoints as shape to the backend.

Args:

ptn (Pattern): pattern with RasterizedPoints as shape

Returns:

None

rasterized_pattern(ptn: Pattern[RasterizedPattern])[source]#

Adds pattern with RasterizedPattern as shape to the backend.

Args:

ptn (Pattern): pattern with RasterizedPattern as shape

Returns:

None

spot(ptn: Pattern[Spot]) None[source]#

Adds pattern with Spot as shape to the backend.

Args:

ptn (Pattern): pattern with Spot as shape

Returns:

None

line(ptn: Pattern[Line]) None[source]#

Adds pattern with Line as shape to the backend.

Args:

ptn (Pattern): pattern with Line as shape

Returns:

None

polyline(ptn: Pattern[Polyline]) None[source]#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

polygon(ptn: Pattern[Polygon]) None[source]#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

arc(ptn: Pattern[Arc]) None[source]#

Adds pattern with Arc as shape to the backend.

Args:

ptn (Pattern): pattern with Arc as shape

Returns:

None

circle(ptn: Pattern[Circle]) None[source]#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

ellipse(ptn: Pattern[Ellipse]) None[source]#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

hollow_arc_spline(ptn: Pattern[HollowArcSpline]) None#

Adds pattern with HollowArcSpline as shape to the backend.

Args:

ptn (Pattern): pattern with HollowArcSpline as shape

Returns:

None

property implemented_shape_methods: Dict[Shape, Callable]#

Dict[Shape, str]: implemented shape methods of backend

parametric_curve(ptn: Pattern[ParametricCurve]) None#

Adds pattern with Curve as shape to the backend.

Args:

ptn (Pattern): pattern with Curve as shape

Returns:

None

process_pattern(ptn: Pattern) None#

Add a pattern to the backend. The appropriate method is determined by the pattern’s shape class automatically.

If pattern contains a Layout, the contained shapes will be extracted automatically.

Args:

ptn (Pattern): pattern to be added. on_unknown_shape:

Returns:

None

process_unknown(ptn: Pattern) None#

Process a shape, which do not have a registered shape handler. Raises an exception by default.

Args:

ptn (Pattern): pattern to be added.

Returns:

None

property shape_methods: Dict[Shape, Callable]#

Dict[Shape, str]: all (abstract) shape methods

rect(ptn: Pattern[Rect]) None[source]#

Adds pattern with Rect as shape to the backend.

Args:

ptn (Pattern): pattern with Rect as shape

Returns:

None