12. Reading Excel files

Besides specifying the input in Python it is also possible to load a parametric design or material from an Excel file. The Excel input file can be made by the user in Excel, but it advised to use bw.generate_excel to generate the required Excel input file.

12.1. Creating Excel input file

breakwater.utils.input_generator.generate_excel(filepath, input='configurations', structure=None)[source]

Generate excel file for design input

Parameters:
  • filepath (str) – location to save the excel input file
  • input (str, optional, default: configurations) – specify which type of input excel must be generated, possible arguments: configurations (default), parameters, LimitState, Grading, ArmourUnits
  • structure ({RRM, CRM, RC, CC}, optional, default: None) – structure for which the input sheet must be generated. RRM for a rubble mound with rock as armour layer, CRM for a rubble mound with concrete armour units as armour layer, RC for a vertical (composite) breakwater with rock as armour layer for the foundation and CC for a vertical (composite) breakwater with concrete armour units as armour layer for the foundation.
Raises:

TypeError – if the extension of the filepath is not .xlsx

12.2. Parametric Design

breakwater.design.read_configurations(filepath, structure, kd=None, name=None, LS=None, Grading=None, ArmourUnits=None, BermMaterial=None)[source]

Conceptual design for multiple breakwaters from an Excel file

Make a conceptual design for multiple (types) of breakwaters from an Excel input file. The Excel input file can be generated with bw.generate_excel

Parameters:
  • structure ({'RRM', 'CRM', 'RC', 'CC'}) – structure for which conceptual designs must be generated. RRM for a rubble mound with rock as armour layer, CRM for a rubble mound with concrete armour units as armour layer, RC for a vertical (composite) breakwater with rock as armour layer for the foundation and CC for a vertical (composite) breakwater with concrete armour units as armour layer for the foundation.
  • kd (int, optional, default: None) – stability coefficient [-]
  • name (str, optional, default: None) – name of the ArmourUnit
  • LS (py:class:LimitState, optional, default: None) – ULS, SLS or another limit state defined with LimitState, by default the LimitState is read from the Excel input file
  • Grading (RockGrading, optional, default: None) – standard rock grading defined in the NEN-EN 13383-1 or a user defined rock grading. By default the Grading is read from the Excel input file
  • ArmourUnit (obj, optional, default: None) – armour unit class which inherits from ConcreteArmour, for instance Xbloc or XblocPlus. By default the ArmourUnit is read from the Excel input file. This argument is used for RRM.
  • BermMaterial (obj, optional, default: None) – armour unit class which inherits from ConcreteArmour, for instance Xbloc or XblocPlus. By default the BermMaterial is read from the Excel input file. This argument is used for CC.
Returns:

bw.Configurations – a Configurations object with breakwater concepts

12.3. Material

breakwater.material.read_grading(filepath, rho=2650, sheet_name=0)[source]

Load a rock grading from an excel or csv file

Excel input file can be generated by using bw.generate_excel with input argument ‘Grading’. Alternatively, when using your own Excel file it must, at least, have the following headers.

Rock Class M50 Lower M50 Upper NLL NUL
Parameters:
  • filepath (str) – a valid filepath
  • rho (float, optional, default: 2650) – density of the armourstone [kg/m³]
  • sheet_name (str, optional, default: 0) – name of the sheet with the RockGrading to read, default value of 0 will result in reading the first sheet
Returns:

bw.RockGrading – a rock grading object

breakwater.material.read_units(filepath, kd, name, rho=2400, sheet_name=0)[source]

Load ArmourUnits from an excel or csv file

Excel input file can be generated by using bw.generate_excel with input argument ‘ArmourUnits’. Alternatively, when using your own Excel file it must, at least, have the following headers.

Volume D h Vc

Note

Do not use this function to read Xbloc or XblocPlus armour units from an Excel file. Use the predefined, bw.Xbloc or bw.XblocPlus instead.

Parameters:
  • filepath (str) – a valid filepath
  • kd (int) – Stability coefficient [-]
  • name (str) – name of the ArmourUnit
  • rho (float, optional, default: 2400) – density of the concrete [kg/m³]
  • sheet_name (str) – name of the sheet with the armour units to read, default value of 0 will result in reading the first sheet
Returns:

bw.ConcreteArmour – an armour units object