<commit_before>## using Base.Test

#######################################
## reconstruction from core elements ##
#######################################

## reconstructing Timematr instance from core elements
tm = TimeData.Timematr(vals, nams, dats)
vals2 = TimeData.core(tm)
nams2 = TimeData.names(tm)
dats2 = TimeData.dates(tm)
tm2 = TimeData.Timenum(vals2, nams2, dats2)
@test TimeData.isequal(tm, tm2)


## core function should not return Array{Real, 2}
vals1 = [4000, 4001, 4002]
vals2 = [1., 2., 3.]
df = DataFrame(a = vals1, b = vals2)
tm = TimeData.Timematr(df)
@test isa(TimeData.core(tm), Array{Float64})
<commit_msg>fixed timenum to timematr<commit_after>module TestConstraints

using Base.Test
using DataArrays
using DataFrames
using Datetime
using TimeData

println("\n Running timematr tests\n")

#######################################
## reconstruction from core elements ##
#######################################

## create instance
vals = rand(30, 4)
dats = [date(2013, 7, ii) for ii=1:30]
nams = ["A", "B", "C", "D"]

## reconstructing Timematr instance from core elements
tm = TimeData.Timematr(vals, nams, dats)
vals2 = TimeData.core(tm)
nams2 = TimeData.names(tm)
dats2 = TimeData.dates(tm)
tm2 = TimeData.Timematr(vals2, nams2, dats2)
@test TimeData.isequal(tm, tm2)

## core function should not return Array{Real, 2}
vals1 = [4000, 4001, 4002]
vals2 = [1., 2., 3.]
df = DataFrame(a = vals1, b = vals2)
tm = TimeData.Timematr(df)
@test isa(TimeData.core(tm), Array{Float64})

end

{'fraction_non_alphanumeric': 0.2290836653386454, 'fraction_numerical': 0.04714475431606906, 'mean_word_length': 5.8812785388127855, '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': '6048460', 'n_tokens_mistral': 567, 'n_tokens_neox': 528, 'n_words': 143}