femto.device module#

class Device(**param)#

Bases: object

Class representing a Device.

A Device is a collection of Waveguide, NasuWaveguide, Marker, Trench (or TrenchColumn) objects.

append(obj)#

Append object to Device.

Parameters:

obj (any object that can be stored in a Device class.) –

Return type:

None

extend(obj)#

Exend Device objects list.

Parameters:

obj (List of any object that can be stored in a Device class.) –

Return type:

None

parse_objects(unparsed_objects)#

Parse objects.

The function takes a list of objects and parse all of them based on their types. If the type of the object matches one of the types of the Writer registered in the Device class, the object is added to the Writer.obj_list. If not, a TypeError is raised.

Parameters:

unparsed_objects (list) – List of object that can be stored in a Device class.

Return type:

None

plot2d(show=True, save=False)#

Plot 2D.

2D plot of all the objects stored in the Device class.

Parameters:
  • show (bool, optional) – Boolean flag to automatically show the plot. The default value is True.

  • save (bool, optional) – Boolean flag to automatically save the plot. The default value is False.

Return type:

None

plot3d(show=True, save=False)#

Plot 3D.

3D plot of all the objects stored in the Device class.

Parameters:
  • show (bool, optional) – Boolean flag to automatically show the plot. The default value is True.

  • save (bool, optional) – Boolean flag to automatically save the plot. The default value is False.

Return type:

None

pgm(verbose=True)#

Export to PGM.

Export all the objects stored in Device class as a PGM file.

Parameters:

verbose (bool, optional) – Boolean flag to print informations during the export operation.

Return type:

None

xlsx(verbose=True, **param)#

Generate the spreadsheet.

Add all waveguides and markers of the Device to the spreadsheet.

save(filename='scheme.html', opt=None)#

Save figure.

Save the plot as a file.

Parameters:
  • filename (str, optional) – Filename of the output image file. The default name is “scheme.html”.

  • opt (dict, optional) – Dictionary with exporting options specifications.

Return type:

None

See also

go.Figure.write_image

Method to export a plotly image.