<commit_before># I should split in two tests, one for generic expected proprieties and
#   contents, and another test for specific contents, like keys, and values
#   itself. But this last one must require a md5.

from numpy import ma


def func():
    from seabird import cnv
    import cotede.qc
    data = cnv.fCNV('./tests/dPIRX010.cnv')
    pqc = cotede.qc.ProfileQC(data, saveauxiliary=True)
    return pqc


def test_answer():
    pqc = func()
    keys = ['timeS', 'pressure', 'temperature', 'temperature2', 'conductivity',
            'conductivity2', 'potemperature', 'potemperature2', 'salinity',
            'salinity2', 'flag']
    pqc.keys() == keys
    assert type(pqc.attributes) == dict
    assert len(pqc.attributes) == 11
    assert hasattr(pqc, 'input')
    assert hasattr(pqc, 'flags')
    assert hasattr(pqc, 'auxiliary')
    assert type(pqc.flags) == dict
    for k in pqc.flags.keys():
        assert type(pqc.flags[k]) == dict
        for kk in pqc.flags[k].keys():
            assert (type(pqc.flags[k][kk]) == ma.MaskedArray) or \
                (type(pqc.flags[k][kk]) == bool)
            if (type(pqc.flags[k][kk]) == ma.MaskedArray):
                assert pqc.flags[k][kk].dtype == bool
<commit_msg>Updating test_pqc to conform flag type int8<commit_after># I should split in two tests, one for generic expected proprieties and
#   contents, and another test for specific contents, like keys, and values
#   itself. But this last one must require a md5.

import numpy as np

def func():
    from seabird import cnv
    import cotede.qc
    data = cnv.fCNV('./tests/dPIRX010.cnv')
    pqc = cotede.qc.ProfileQC(data, saveauxiliary=True)
    return pqc


def test_answer():
    pqc = func()
    keys = ['timeS', 'pressure', 'temperature', 'temperature2', 'conductivity',
            'conductivity2', 'potemperature', 'potemperature2', 'salinity',
            'salinity2', 'flag']
    pqc.keys() == keys
    assert type(pqc.attributes) == dict
    assert len(pqc.attributes) == 11
    assert hasattr(pqc, 'input')
    assert hasattr(pqc, 'flags')
    assert hasattr(pqc, 'auxiliary')
    assert type(pqc.flags) == dict
    for k in pqc.flags.keys():
        assert type(pqc.flags[k]) == dict
        for kk in pqc.flags[k].keys():
            assert (type(pqc.flags[k][kk]) == np.ndarray) or \
                (type(pqc.flags[k][kk]) == bool)
            if (type(pqc.flags[k][kk]) == np.ndarray):
                assert pqc.flags[k][kk].dtype == 'int8'

{'fraction_non_alphanumeric': 0.1401530406766009, 'fraction_numerical': 0.008860249697946033, 'mean_word_length': 2.857142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '871197', 'n_tokens_mistral': 873, 'n_tokens_neox': 820, 'n_words': 228}