bahamas.cccg
Created on September 7, 2025 @author: wangc, chene
Attributes
Classes
Compute CCCGs for the given list of components of diversity and redundancy system |
Functions
|
Check if group is empty |
|
Remove "None" and "nan" from str that are separated by ";" |
|
Merge multiple pd.DataFrame CCCG data and remove duplicates |
|
Drop duplicated CCCG data |
|
Identify the unique inputs/designs/functions for the given coupling factor (i.e., Input Function and Design) |
|
Get a list of CCCGs based on single coupling factor, meaning the CCCGs are grouped because |
|
Identify CCCGs that are also have the "col_name" coupling factor. (This function is used for two or more shared coupling factors.) |
|
Extract a CCCG based on col_name |
|
Extract the CCCGs from a list of pandas.DataFrame |
Module Contents
- bahamas.cccg.check_valid(src_arr)[source]
Check if group is empty
- Parameters:
src_arr (list or pd.DataFrame) – data to check
- Returns:
True if the group is not empty, else False
- Return type:
bool
- bahamas.cccg.clean_string(s)[source]
Remove “None” and “nan” from str that are separated by “;”
- Parameters:
s (str) – string to clean
- Returns:
cleaned string
- Return type:
str
- bahamas.cccg.merge_multi_lists(*arg)[source]
Merge multiple pd.DataFrame CCCG data and remove duplicates
- Parameters:
arg (list) – list of pd.DataFrame CCCG data
- Returns:
merged CCCG data without duplications
- Return type:
list
- bahamas.cccg.drop_dup(list_pd)[source]
Drop duplicated CCCG data
- Parameters:
list_pd (list) – list of pd.DataFrame (CCCG data)
- Returns:
list of pd.DataFrame (CCCG data) without duplications
- Return type:
list
- bahamas.cccg.unique_cells(src_arr)[source]
Identify the unique inputs/designs/functions for the given coupling factor (i.e., Input Function and Design)
- Parameters:
src_arr (pd.DataFrame) – expanded coupling factor data for single coupling factor
- Returns:
list of unique inputs/designs/functions among all components
- Return type:
list
- bahamas.cccg.match_CCCG_on(src_arr, col_name)[source]
Get a list of CCCGs based on single coupling factor, meaning the CCCGs are grouped because they have at least one shared variable of the given coupling factor
- Parameters:
src_arr (pd.DataFrame) – Component table with expanded coupling factors
col_name (str) – coupling factor, Function_, Input_ or Design_
- Returns:
list of CCCGs based on single coupling factor, arranged in the order *_1, *_2, *_3, etc. where * represents the coupling factor
- Return type:
list
- bahamas.cccg.match_CCCG_list_on(list_pd, col_name)[source]
Identify CCCGs that are also have the “col_name” coupling factor. (This function is used for two or more shared coupling factors.)
- Parameters:
list_pd (list) – list of pd.DataFrame of CCCGs
col_name (str) – coupling factor, Function_, Input_ or Design_
- Returns:
CCCGs with the additional coupling factor (“col_name”)
- Return type:
list
- bahamas.cccg.match_multi_on(src_arr, col_name)[source]
Extract a CCCG based on col_name
- Parameters:
src_arr (pd.DataFrame) – pd.DataFrame of CCCGs
col_name (str) – coupling factor
- Returns:
extracted the CCCGs based on the given column name
- Return type:
list
- bahamas.cccg.match_multi_list_on(list_pd, col_name)[source]
Extract the CCCGs from a list of pandas.DataFrame
- Parameters:
list_pd (list) – list of pd.DataFrame
col_name (str) – coupling factor name
- Returns:
list of extracted CCCGs
- Return type:
list
- class bahamas.cccg.CCCG(file)[source]
Bases:
objectCompute CCCGs for the given list of components of diversity and redundancy system
- generate(config=None)[source]
Generate CCCGs based on three coupling factors (i.e., Function, Input, and Design)
- Parameters:
config (dict, optional) – config file for output control. Defaults to None.
- get(name)[source]
Get CCCGs
- Parameters:
name (str) – name for CCCGs group
- Returns:
list of CCCGs
- Return type:
list (list of Pandas.DataFrame)