"""MultispeQ protocols can contain a so called ``v_arrays`` that allow to define values as variabls, which can be used throughout the protocol, so the valueitself doesn't need to be repeated multiple times throughout the protocol.The functions allow to access the ``v_arrays`` themselfs as well asaccessing specific variable values, so they can be available for the laterdata analysis."""importnumpyasnp
[docs]defget_v_arrays(protocol=None):""" Get the ``v_arrays`` (variable arrays) from a given protocol. See :func:`~jii_pq_analysis.protocol.get_protocol` on how to extract a single protocol. :param protocol: Single MultispeQ Protocol :type protocol: dict :return: ``v_arrays`` content :rtype: dict :raises ValueError: If no protocol is provided. :raises ValueError: If protocol is not provided as a dictionary. :raises Exception: If the provided protocol doesn't have a v_arrays. """ifprotocolisNone:raiseValueError("No protocol provided")ifnotisinstance(protocol,dict):raiseValueError("Provided Protocol needs to be formatted as a dictionary")if"v_arrays"notinprotocol:raiseException("Provided Protocol has no v_arrays")returnprotocol['v_arrays']