femto.spreadsheet module#

generate_all_cols_data()#

Create the available columns array from a file.

Gathers all data from the utils/spreadsheet_columns.txt file and creates a structured array with the information for all possible columns. The user can only select columns to add to the spreadsheet throught their tagname, which must be in the first column of the txt document.

Return type:

NDArray[Any, Structure[width: Int, [format, fullname, tagname, unit]: Str]]

class NestedDict(d)#

Bases: object

Class to handle a nested dictionary.

static get_path(key, d, path=None, prev_k=None)#

Get paths to all occurencies of the key in the dictionary.

pop(k)#

Pop element with a given key from nested structure.

class Parameter(n, v='', loc=(0, 0), sz=(0, 0), fmt='parval')#

Bases: object

Class that handles preamble parameters.

n: str#
v: str = ''#
loc: tuple[int, int] = (0, 0)#
sz: tuple[int, int] = (0, 0)#
fmt: str = 'parval'#
class Spreadsheet(device=None, columns_names='', book_name='my_fabrication.xlsx', sheet_name='Fabrication', font_name='DejaVu Sans Mono', font_size=11, suppr_redd_cols=True, static_preamble=False, saints=False, new_columns=None, extra_preamble_info=None)#

Bases: object

Class representing the spreadsheet with all entities to fabricate.

device: femto.device.Device | None = None#
columns_names: str = ''#
book_name: str | Path = 'my_fabrication.xlsx'#
sheet_name: str = 'Fabrication'#
font_name: str = 'DejaVu Sans Mono'#
font_size: int = 11#
suppr_redd_cols: bool = True#
static_preamble: bool = False#
saints: bool = False#
new_columns: list | None = None#
extra_preamble_info: dict | None = None#
close()#

Close the workbook.

write_structures(verbose=True, saints=None)#

Write the structures to the spreadsheet.

Builds the structures list, containing all the required information about the structures to fabricate. Then, prepares the columns in the spreadsheet, setting their width according to the columns.txt file. Finally, fills the spreadsheet with the contents of the structures list, one structure per line, and creates the preamble, which is the general information to the left of individual structure information.

Return type:

None.