### ===================================================================================================================
### FUNTION: Collect L2 interfaces
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
### ===================================================================================================================
### 2. Function get_l2_interfaces
### ===================================================================================================================
[docs]def get_l2_interfaces(project: ViiaProject):
"""
This function will get the L2 line interface.
Input
- project (obj): VIIA project object containing collections of fem objects and project variables.
Output
- List of L2 interfaces
"""
l2_interfaces = []
for interface in project.collections.interfaces:
if (interface.meta_data and 'strengthening' in interface.meta_data and
'L2-' in interface.meta_data['strengthening']):
if not interface.connection_type == 'line-line':
project.write_log(
f"WARNING: For L2 interfaces the 'line-line'-type is expected. {interface} with "
f"'{interface.connection_type}'-type will not be processed.")
continue
l2_interfaces.append(interface)
return l2_interfaces
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================