Skip to content

fix validation notebook

Simon Mazenoux requested to merge fix_validation_notebook into dev

Code was raising the following exception, which is now fixed:

ENVIRONMENT:
VIRTUAL_ENV=/home/agchmiel/Documents/PythonProjects/sigmon/.venv
SPARK_HOME=/home/agchmiel/Documents/PythonProjects/sigmon/.venv/nxcals-bundle
SPARK_CONF_DIR=/tmp/nxcals-93920d077da357cc1229e4c7404f28aa/conf
SPARK_DEFAULTS=/home/agchmiel/Documents/PythonProjects/sigmon/.venv/nxcals-bundle/conf/spark-defaults.conf
NXCALS_WORKSPACE_TEMP_DIR=/tmp/nxcals-93920d077da357cc1229e4c7404f28aa
PACKED_VENV_FILE=/tmp/nxcals-93920d077da357cc1229e4c7404f28aa/nxcals-python3-env.tar.gz
PYSPARK_PYTHON == /home/agchmiel/Documents/PythonProjects/sigmon/.venv/bin/python
PYSPARK_DRIVER_PYTHON == /home/agchmiel/Documents/PythonProjects/sigmon/.venv/bin/python
PYSPARK_DRIVER_PYTHON_OPTS == 
Trying to determine YARN usage to make Python work correctly (conf/spark-env.sh)...
Not using YARN
Available automated hwc tests:
PCC.4
PNO.d3
PLI1.c3
PLI2.e3
PIC2 CIRCUIT QUENCH VIA QPS
PIC2 CIRCUIT QUENCH VIA QPS MP3
PIC2 CIRCUIT QUENCH VIA QPS MI
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 175254 entries, 0 to 175253
Data columns (total 23 columns):
 #   Column                    Non-Null Count   Dtype         
---  ------                    --------------   -----         
 0   campaign                  175254 non-null  object        
 1   testId                    175254 non-null  int64         
 2   systemName                175254 non-null  object        
 3   testName                  175254 non-null  object        
 4   executionStartTime        175254 non-null  datetime64[ns]
 5   executionEndTime          175254 non-null  datetime64[ns]
 6   executedTestStatus        175254 non-null  object        
 7   PO_EXPERT                 56846 non-null   object        
 8   QPS_EXPERT                10213 non-null   object        
 9   MI_EXPERT                 50185 non-null   object        
 10  MPP_EXPERT                56655 non-null   object        
 11  CRYO_EXPERT               2341 non-null    object        
 12  EIC                       14697 non-null   object        
 13  EE_IST_EXPERT             1251 non-null    object        
 14  QPS_IST_EXPERT            7298 non-null    object        
 15  ELQA_EXPERT               8016 non-null    object        
 16  BT_LBDS_EXPERT            0 non-null       float64       
 17  BLM_EXPERT                0 non-null       float64       
 18  MACHINE_CHECK_OUT_EXPERT  3 non-null       object        
 19  EE_EXPERT                 843 non-null     object        
 20  HWC_EDSL_AUTOMATED        4508 non-null    object        
 21  MCS_COLLIMATION           0 non-null       float64       
 22  HWC_SIGMON_AUTOMATED      46 non-null      object        
dtypes: datetime64[ns](2), float64(3), int64(1), object(17)
memory usage: 30.8+ MB
campaign    testId    systemName    testName    executionStartTime    executionEndTime    executedTestStatus    PO_EXPERT    MI_EXPERT    MPP_EXPERT    HWC_EDSL_AUTOMATED
0    Commissioning 2007/2008    13138    RQ5.R4    PCL    2007-12-06 15:23:19.283    2007-12-06 15:35:16.903    SUCCESSFUL    NaN    NaN    NaN    NaN
1    Commissioning 2007/2008    13145    RQ5.R4    PCC.4    2007-12-06 15:38:14.241    2007-12-07 12:49:25.465    SIGNING_PENDING    NaN    NaN    NaN    NaN
2    Commissioning 2007/2008    11327    RD4.R4    PCL    2007-12-06 15:53:54.849    2007-12-06 16:09:23.885    SUCCESSFUL    NaN    NaN    NaN    NaN
3    Commissioning 2007/2008    11334    RD4.R4    PCC.3    2007-12-06 16:11:03.081    2007-12-06 16:11:03.081    FAILED    NaN    NaN    NaN    NaN
4    Commissioning 2007/2008    8942    RCBYH5.R4B2    PCL    2007-12-06 16:23:06.627    2007-12-06 16:23:59.656    SUCCESSFUL    NaN    NaN    NaN    NaN
...    ...    ...    ...    ...    ...    ...    ...    ...    ...    ...    ...
175249    Recommissioning 2023/2024    211840    RCD.A23B2    PNO.a3    2024-04-03 12:38:11.168    2024-04-03 14:01:11.554    SUCCESSFUL    NaN    NaN    SUCCESSFUL    NaN
175250    Recommissioning 2023/2024    211841    RCD.A34B2    PNO.a3    2024-04-03 12:38:48.360    2024-04-03 14:01:46.248    ANALYSIS_PENDING    NaN    NaN    NaN    NaN
175251    Recommissioning 2023/2024    211842    RCD.A45B2    PNO.a3    2024-04-03 12:39:20.560    2024-04-03 14:02:20.496    ANALYSIS_PENDING    NaN    NaN    NaN    NaN
175252    Recommissioning 2023/2024    211843    RCD.A67B2    PNO.a3    2024-04-03 12:41:49.257    2024-04-03 14:04:48.636    ANALYSIS_PENDING    NaN    NaN    NaN    NaN
175253    Recommissioning 2023/2024    211844    RCD.A81B2    PNO.a3    2024-04-03 12:41:59.353    2024-04-03 14:04:59.295    SUCCESSFUL    NaN    NaN    SUCCESSFUL    NaN
175254 rows × 11 columns

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_19167/1138179845.py in ?()
      3 filtered_summary_df = selected_hwc_summary_df[selected_hwc_summary_df["testName"].apply(lambda x: x in hwc_test)]
----> 4 
      5 filtered_summary_df = filtered_summary_df.loc[
      6     powering.get_analysis_class(hwc_test).is_circuit_supported(filtered_summary_df["systemName"])
      7 ]

~/Documents/PythonProjects/sigmon/.venv/lib64/python3.9/site-packages/lhcsmapi/api/analysis/powering/pcc_4/__init__.py in ?(circuit_name)
     27     @staticmethod
     28     def is_circuit_supported(circuit_name: str) -> bool:
---> 29         return signal_metadata.is_ipq(circuit_name)

~/Documents/PythonProjects/sigmon/.venv/lib64/python3.9/site-packages/lhcsmapi/metadata/signal_metadata.py in ?(circuit_name)
    767 
    768     Returns:
    769         True if the circuit is an IPQ circuit, False otherwise
    770     """
--> 771     return get_circuit_type_for_circuit_name(circuit_name) in [CircuitType.IPQ2, CircuitType.IPQ4, CircuitType.IPQ8]

~/Documents/PythonProjects/sigmon/.venv/lib64/python3.9/site-packages/lhcsmapi/metadata/signal_metadata.py in ?(circuit_name)
    371     Raises:
    372         KeyError: If circuit name not found
    373     """
    374     for circuit_type in get_circuit_types():
--> 375         if circuit_name in get_circuit_names(circuit_type) or circuit_name in get_circuit_names(
    376             circuit_type, timestamp=_RUN_3_START - 1
    377         ):
    378             return circuit_type

~/Documents/PythonProjects/sigmon/.venv/lib64/python3.9/site-packages/pandas/core/generic.py in ?(self)
   1525     @final
   1526     def __nonzero__(self) -> NoReturn:
-> 1527         raise ValueError(
   1528             f"The truth value of a {type(self).__name__} is ambiguous. "
   1529             "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
   1530         )

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Merge request reports