femto.device module#
- class Device(**param)#
Bases:
objectClass representing a Device.
A Device is a collection of
Waveguide,NasuWaveguide,Marker,Trench(orTrenchColumn) objects.- append(obj)#
Append object to Device.
- Parameters:
obj (any object that can be stored in a
Deviceclass.) –- Return type:
None
- extend(obj)#
Exend Device objects list.
- Parameters:
obj (List of any object that can be stored in a
Deviceclass.) –- 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
Writerregistered in theDeviceclass, the object is added to theWriter.obj_list. If not, aTypeErroris raised.- Parameters:
unparsed_objects (list) – List of object that can be stored in a
Deviceclass.- Return type:
None
- plot2d(show=True, save=False)#
Plot 2D.
2D plot of all the objects stored in the
Deviceclass.- 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
Deviceclass.- 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
Deviceclass 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
Deviceto 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_imageMethod to export a plotly image.