# SLiCAPdesignData.py

Created on Fri Nov 18 13:24:17 2022

@author: anton

createSubstDict(specs)

  Returns a subsitutution dictionary from a list with specifications. substDict[<parname>] = <parValue>

  Parameters:

    specs (list) – list with specItem objects

  Returns:

    dictionary with key-value pairs; for each specitem:

    - key: parameter name (sympy.Symbol)

    - value: parameter value (sympy.expression)

  Return type:

    dict

csv2specs(csvFile)

  Reads the CSV file with specifications and converts it into a list with specitems.

  The file will be read from the ini.csv_folder, which defaults to the ‘csv’ folder in the project diretory.

  Parameters:

    csvFile (str) – name of the CSV file in the directory ‘ini.csv_path’

  Returns:

    Lit with specification items

  Return type:

    list

class specItem(symbol, description='', value='', units='', specType='')

  Class for specification items. These are parameter definitions with descriptions that can be assigned to the circuit. Specification items must have:

  - A unique symbol (their parameter name)

  - A spectype defintion, such as ‘functional’, ‘environment’, ‘design’, etc.

  - A value

specs2circuit(specList, cir)

  Adds all prameter definitions from the specList to the circuit ‘cir’.

  Parameters:

    - specList (list) – List with spec items

    - cir (SLiCAPprotos.circuit) – circuit to which the parameters definitions will be added

  Returns:

    None

  Return type:

    NoneType

specs2csv(specList, fileName)

  Saves the list with spec items as a CSV file.

  The file will be stored in the ini.csv_folder, which defaults to the ‘csv’ folder in the project diretory.

  Parameters:

    specList (list) – List with spec items

  Returns:

    None

  Return type:

    NoneType

specs2dict(specList)

  Creates a dictionary with spec items. the parameter name is used as key. Also checks for unique parameter names.

  Parameters:

    specList (List) – List with spec items

  Returns:

    dictionary with specification items

  Return type:

    dict

specs2html(specs, types=[])

  Displays specification items for the list ‘specs’ on the active HTML page. Specifications of the same type are placed in one table.

  If a list of specification types is provided, it creates tables for specified types only. By default, tables for all types will be created.

  Parameters:

    - specs (list) – List with spec items.

    - types (str) – List with specification types to be placed on the html page, defaults to [].

  Returns:

    HTML code that will be placed on the page

  Return type:

    str