Data/Frame/Util.pm

filter: Statementstmt 92.7% 127 / 137 Branchbran 69.5% 32 / 46 Conditioncond 81.8% 9 / 11 MC/DCmcdc 50.0% 3 / 6 Subroutinesub 93.3% 28 / 30 Podpod 100% 7 / 7 totaltotal 86.9% 206 / 237 CC 28 SCAR 16.7
CC
28
Cov
87%
guess_and_convert_to_pdl
13.3
BAD
9.3
is_discrete
6.4
CRAP 5.3
« Data/Frame/Partial/Eval.pm ↑ Summary Data/Frame/Indexer.pm »
1 package Data::Frame::Util;
2 13 $Data::Frame::Util::VERSION = '0.006005';
3 # ABSTRACT: Utility functions
4  
5 13 ▶use Data::Frame::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 13 ▶use PDL::Core qw(pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 13 ▶use PDL::Primitive qw(which);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 13 ▶use PDL::Factor ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 13 ▶use PDL::SV ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 13 ▶use PDL::Logical ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 13 ▶use List::AllUtils qw(uniq);
Subroutine BEGIN: called CC=1 SCAR=0.0
14 13 ▶use Scalar::Util qw(looks_like_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 13 ▶use Type::Params;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 13 ▶use Types::PDL qw(PiddleFromAny);
Subroutine BEGIN: called CC=1 SCAR=0.0
17 13 ▶use Types::Standard qw(ArrayRef Value);
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 13 ▶use Data::Frame::Types qw(ColumnLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 13 ▶use parent qw(Exporter::Tiny);
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 13 our @EXPORT_OK = (
24 qw(
25 BAD NA
26 ifelse is_discrete
27 guess_and_convert_to_pdl
28 dataframe factor logical
29 ),
30 );
31  
32 13 our %EXPORT_TAGS = ( all => \@EXPORT_OK );
33  
34  
35 1 ▶sub dataframe {
Subroutine dataframe: called CC=1 SCAR=0.0
Pod documented
36 1 require Data::Frame; # to avoid circular use
37 1 Data::Frame->new( columns => \@_ );
38 }
39 5 ▶sub factor { PDL::Factor->new(@_); }
Subroutine factor: called CC=1 SCAR=0.0
Pod documented
40 2 ▶sub logical { PDL::Logical->new(@_); }
Subroutine logical: called CC=1 SCAR=0.0
Pod documented
41  
42  
43 0 ▶fun BAD ($n=1) { PDL::Core::zeros($n)->setbadat( PDL::Core::ones($n) ); }
Subroutine BAD: not called CC=3 SCAR=22.3
Pod documented
Branch: 2 branches
BranchTrueFalseTotal
@_ > 1 and Function::Parameters::_croak('Too many arguments for fun BAD (expected 1, got ' . @_ . ')') 0 0 0
@_ < 1 and $n = 1 0 0 0
44 13 *NA = \&BAD;
45  
46  
47 188 ▶fun ifelse ($test, $yes, $no) {
Subroutine ifelse: called CC=5 SCAR=16.1
Pod documented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 3 and Function::Parameters::_croak('Too few arguments for fun ifelse (expected 3, got ' . @_ . ')') 0 188 188
@_ > 3 and Function::Parameters::_croak('Too many arguments for fun ifelse (expected 3, got ' . @_ . ')') 0 188 188
48 188 state $check = Type::Params::compile(
49 ( ColumnLike->plus_coercions(PiddleFromAny) ),
50 ( ( ColumnLike->plus_coercions(PiddleFromAny) ) x 2 )
51 );
52 188 ( $test, $yes, $no ) = $check->( $test, $yes, $no );
53  
54 188 my $l = $test->length;
55 188 my $idx = which( !$test );
56  
57 188 $yes = $yes->repeat_to_length($l);
58 188 ▶ if ( $idx->length == 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($idx->length == 0) 6 182 188
59 6 return $yes;
60 }
61  
62 182 $no = $no->repeat_to_length($l);
63 182 my $no_sliced = $no->slice($idx);
64 182 ▶ $no_sliced = $no_sliced->convert($yes->type->enum)
Branch: 1 branch
BranchTrueFalseTotal
if $yes->type != $no->type 2 180 182
65 if $yes->type != $no->type;
66 182 $yes->slice($idx) .= $no_sliced;
67  
68 182 return $yes;
69 13 }
70  
71  
72 3180 ▶fun is_discrete (ColumnLike $x) {
Subroutine is_discrete: called CC=6 SCAR=18.6
Pod documented
Branch: 3 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for fun is_discrete (expected 1, got ' . @_ . ')') 0 3180 3180
@_ > 1 and Function::Parameters::_croak('Too many arguments for fun is_discrete (expected 1, got ' . @_ . ')') 0 3180 3180
${my $v = bless( {"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; $type->check($_[0]) or _failed_check($type, 'ColumnLike', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Type::Tiny; use warnings; use strict; local $_ = $_[0]; foreach my $c (@constraints) { return unless &$c(@_); } return !0;},"display_name" => "to_ColumnLike","name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Data::Frame::Types; use warnings; use strict; $_->ndims <= 1;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Data-Frame-0.006005-0/blib/lib/Data/Frame/Types.pm","line" => 24,"package" => "Data::Frame::Types"},"deprecated" => !!0,"display_name" => "ColumnLike","exception_class" => "Error::TypeTiny::Assertion","library" => "Data::Frame::Types","name" => "ColumnLike","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Eval::TypeTiny::Sandbox; use strict; do { package Type::Tiny; builtin::blessed($_[0]) and do { my $method = $_[0]->can('DOES') || $_[0]->can('isa'); $_[0]->$method('PDL') } };},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1015,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ConsumerOf[\"PDL\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::Tiny::Role; use warnings; use strict; my $var = $_[1]; my $code = "Scalar::Util::blessed($var) and do { my \$method = $var->can('DOES')||$var->can('isa'); $var->\$method(q[$role]) }"; return "do { use Scalar::Util (); $code }" if $Type::Tiny::AvoidCallbacks; $code;},"name" => "__ANON__","role" => "PDL","uniq" => 82}, 'Type::Tiny::Role' ),"uniq" => 83}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"}; \$v}->check($x) or Function::Parameters::_croak('In fun is_discrete: parameter 1 ($x): ' . ${my $v = bless( {"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; $type->check($_[0]) or _failed_check($type, 'ColumnLike', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Type::Tiny; use warnings; use strict; local $_ = $_[0]; foreach my $c (@constraints) { return unless &$c(@_); } return !0;},"display_name" => "to_ColumnLike","name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Data::Frame::Types; use warnings; use strict; $_->ndims <= 1;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Data-Frame-0.006005-0/blib/lib/Data/Frame/Types.pm","line" => 24,"package" => "Data::Frame::Types"},"deprecated" => !!0,"display_name" => "ColumnLike","exception_class" => "Error::TypeTiny::Assertion","library" => "Data::Frame::Types","name" => "ColumnLike","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Eval::TypeTiny::Sandbox; use strict; do { package Type::Tiny; builtin::blessed($_[0]) and do { my $method = $_[0]->can('DOES') || $_[0]->can('isa'); $_[0]->$method('PDL') } };},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1015,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ConsumerOf[\"PDL\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::Tiny::Role; use warnings; use strict; my $var = $_[1]; my $code = "Scalar::Util::blessed($var) and do { my \$method = $var->can('DOES')||$var->can('isa'); $var->\$method(q[$role]) }"; return "do { use Scalar::Util (); $code }" if $Type::Tiny::AvoidCallbacks; $code;},"name" => "__ANON__","role" => "PDL","uniq" => 82}, 'Type::Tiny::Role' ),"uniq" => 83}, 'Type::Tiny' );$v->{"coercion"}{"type_constraint"} = $v;$v->{"compiled_type_constraint"} = $v->{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"}; \$v}->get_message($x)) 3180 0 3180
73 return (
74 3180 ▶ $x->$_DOES('PDL::Factor')
Condition83%5/6
$x->$Data::Frame::Util::_DOES('PDL::Factor') || $x->$Data::Frame::Util::_DOES('PDL::SV') || $x->type eq 'byte'
l!l&&r!l&&!r
45602724
$x->$Data::Frame::Util::_DOES("PDL::Factor") or $x->$Data::Frame::Util::_DOES("PDL::SV")
l!l&&r!l&&!r
444122724
MC/DC66%2/3
$x->$Data::Frame::Util::_DOES('PDL::Factor') || $x->$Data::Frame::Util::_DOES('PDL::SV') || $x->type eq 'byte'
$x->$Data::Frame::Util::_DOES("PDL::Factor") $x->$Data::Frame::Util::_DOES("PDL::SV") $x->type eq 'byte'
Truth table75%3/4
A or B || C
A= $x->$Data::Frame::Util::_DOES("PDL::Factor")B= $x->$Data::Frame::Util::_DOES("PDL::SV")C= $x->type eq 'byte'
ABCresult
1XX1
01X1
0011
0000
75 or $x->$_DOES('PDL::SV')
76 or $x->type eq 'byte'
77 );
78 13 }
79  
80  
81 875 ▶sub _is_na {
Subroutine _is_na: called CC=2 SCAR=6.9
82 875 my ($na, $include_empty) = @_;
83  
84 875 ▶ my @na = uniq(@$na, ($include_empty ? '' : ()));
Branch: 1 branch
BranchTrueFalseTotal
$include_empty ? : 569 306 875
85  
86 # see utils/benchmarks/is_na.pl for why grep is used here
87 658078 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
88 658078 scalar( grep { $_[0] eq $_ } @na );
89 875 };
90 }
91  
92 135 ▶sub _numeric_from_arrayref {
Subroutine _numeric_from_arrayref: called CC=2 SCAR=6.9
93 135 my ($x, $na, $f) = @_;
94 135 ▶ $f //= \&PDL::Core::pdl;
Condition100%2/2
$f //= \&PDL::Core::pdl
l!l
4131
MC/DC100%1/1
$f //= \&PDL::Core::pdl
$f
Truth table100%2/2
A
A= $f
Aresult
11
00
95  
96 135 my $is_na = _is_na($na, 1);
97 135 my $isbad = pdl( [ map { &$is_na($_) } @$x ] );
98 135 my $p = do {
99 135 ▶ local $SIG{__WARN__} = sub { };
Subroutine __ANON__: called CC=1 SCAR=0.0
100 135 $f->($x);
101 };
102 135 return $p->setbadif($isbad);
103 }
104  
105 0 ▶sub _logical_from_arrayref {
Subroutine _logical_from_arrayref: not called CC=1 SCAR=6.9
106 0 my ($x, $na) = @_;
107  
108 0 my $is_na = _is_na($na, 1);
109 0 my $isbad = pdl( [ map { &$is_na($_) } @$x ] );
110 0 my $p = PDL::Logical->new($x);
111 0 return $p->setbadif($isbad);
112 }
113  
114 4 ▶sub _datetime_from_arrayref {
Subroutine _datetime_from_arrayref: called CC=1 SCAR=0.0
115 4 my ($x, $na) = @_;
116 return _numeric_from_arrayref( $x, $na,
117 4 ▶ sub { PDL::DateTime->new_from_datetime( $_[0] ) } );
Subroutine __ANON__: called CC=1 SCAR=0.0
118 }
119  
120 4 ▶sub _factor_from_arrayref {
Subroutine _factor_from_arrayref: called CC=2 SCAR=6.9
121 4 my ($x, $na) = @_;
122  
123 4 my $is_na = _is_na($na, 0);
124 4 my $isbad = pdl( [ map { &$is_na($_) } @$x ] );
125 4 ▶ if ( $isbad->any ) { # remove $na from levels
Branch: 1 branch
BranchTrueFalseTotal
if ($isbad->any) { } 2 2 4
126 2 my $levels = [ sort grep { !&$is_na($_) } uniq(@$x) ];
127 2 return PDL::Factor->new( $x, levels => $levels )->setbadif($isbad);
128 } else {
129 2 return PDL::Factor->new($x);
130 }
131 }
132  
133 302 ▶sub _pdlsv_from_arrayref {
Subroutine _pdlsv_from_arrayref: called CC=1 SCAR=0.0
134 302 my ($x, $na) = @_;
135  
136 302 my $is_na = _is_na($na, 0);
137 302 my $isbad = pdl( [ map { &$is_na($_) } @$x ] );
138 302 return PDL::SV->new($x)->setbadif($isbad);
139 }
140  
141 444 ▶fun guess_and_convert_to_pdl ( (ArrayRef | Value | ColumnLike) $x,
Subroutine guess_and_convert_to_pdl: called CC=13 SCAR=25.9
Pod documented
142 444 ▶ :$strings_as_factors=false, :$test_count=1000, :$na=[qw(NA BAD)]) {
Branch: 7 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for fun guess_and_convert_to_pdl (expected 1, got ' . @_ . ')') 0 444 444
@_ > 1 and (@_ - 1) % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun guess_and_convert_to_pdl") 0 444 444
exists ${__rest}{'strings_as_factors'} ? : 140 304 444
exists ${__rest}{'test_count'} ? : 0 444 444
exists ${__rest}{'na'} ? : 139 305 444
keys %{__rest} and Function::Parameters::_croak('In fun guess_and_convert_to_pdl: no such named parameter: ' . join(", ", sort(keys %{__rest}))) 0 444 444
${my $v = bless( {"compiled_type_constraint" => sub ($) { package Type::Tiny; use warnings; use strict; local $_ = $_[0]; foreach my $c (@constraints) { return unless &$c(@_); } return !0;},"constraint" => sub { package Type::Tiny::Union; use warnings; use strict; my $val = $_; &$_($val) and return !0 foreach (@checks); return;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Data-Frame-0.006005-0/blib/lib/Data/Frame/Util.pm","line" => 141,"package" => "Data::Frame::Util"},"deprecated" => !!0,"name" => "__ANON__","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"type_constraints" => [bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; Ref::Util::XS::is_plain_arrayref($_[0]) or _failed_check(21, 'ArrayRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_ArrayRef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"coercion_generator" => bless( ["ArrayRef","coercion_generator"], 'Types::Standard::LazyLoad' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_ eq 'ARRAY';},"constraint_generator" => bless( ["ArrayRef","constraint_generator"], 'Types::Standard::LazyLoad' ),"deep_explanation" => bless( ["ArrayRef","deep_explanation"], 'Types::Standard::LazyLoad' ),"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 523,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ArrayRef","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => bless( ["ArrayRef","inline_generator"], 'Types::Standard::LazyLoad' ),"inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_arrayref($_[1])" : "ref($_[1]) eq 'ARRAY'";},"library" => "Types::Standard","name" => "ArrayRef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; not ref $_[0] and _failed_check(16, 'Ref', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Ref","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_;},"constraint_generator" => sub { package Types::Standard; no warnings; use strict; return $meta->get_type('Ref') unless @_; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'Ref', \@_, 1); my $reftype = shift(); $reftype =~ /^(SCALAR|ARRAY|HASH|CODE|REF|GLOB|LVALUE|FORMAT|IO|VSTRING|REGEXP|Regexp)$/i or _croak "Parameter to Ref[`a] expected to be a Perl ref type; got $reftype"; $reftype = "$reftype"; return sub { ref $_[0] and builtin::reftype($_[0]) eq $reftype; } ;},"deep_explanation" => sub { package Types::Standard; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; return if $type->check($value); my $reftype = builtin::reftype($value); return [sprintf('"%s" constrains reftype(%s) to be equal to %s', $type, $varname, B::perlstring($param)), sprintf('reftype(%s) is %s', $varname, defined $reftype ? B::perlstring($reftype) : 'undef')];},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 438,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Ref","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard; no warnings; use strict; my $reftype = shift(); return sub { my $v = $_[1]; &$maybe_load_modules('Scalar::Util', "ref($v) and Scalar::Util::reftype($v) eq q($reftype)"); } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; "!!ref($_[1])";},"library" => "Types::Standard","name" => "Ref","parent" => {},"uniq" => 16}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return [];},"type_default_generator" => sub { package Types::Standard; no warnings; use strict; return $Type::Tiny::parameterize_type->type_default if @_ < 2; return undef;},"uniq" => 21}, 'Type::Tiny' ),bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; defined $_[0] and not ref $_[0] or _failed_check(8, 'Value', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Value","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; not ref $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 276,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Value","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1]) and not ref($_[1])";},"library" => "Types::Standard","name" => "Value","parent" => {},"uniq" => 8}, 'Type::Tiny' ),bless( {"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; $type->check($_[0]) or _failed_check($type, 'ColumnLike', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Type::Tiny; use warnings; use strict; local $_ = $_[0]; foreach my $c (@constraints) { return unless &$c(@_); } return !0;},"display_name" => "to_ColumnLike","name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Data::Frame::Types; use warnings; use strict; $_->ndims <= 1;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Data-Frame-0.006005-0/blib/lib/Data/Frame/Types.pm","line" => 24,"package" => "Data::Frame::Types"},"deprecated" => !!0,"display_name" => "ColumnLike","exception_class" => "Error::TypeTiny::Assertion","library" => "Data::Frame::Types","name" => "ColumnLike","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Eval::TypeTiny::Sandbox; use strict; do { package Type::Tiny; builtin::blessed($_[0]) and do { my $method = $_[0]->can('DOES') || $_[0]->can('isa'); $_[0]->$method('PDL') } };},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1015,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ConsumerOf[\"PDL\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::Tiny::Role; use warnings; use strict; my $var = $_[1]; my $code = "Scalar::Util::blessed($var) and do { my \$method = $var->can('DOES')||$var->can('isa'); $var->\$method(q[$role]) }"; return "do { use Scalar::Util (); $code }" if $Type::Tiny::AvoidCallbacks; $code;},"name" => "__ANON__","role" => "PDL","uniq" => 82}, 'Type::Tiny::Role' ),"uniq" => 83}, 'Type::Tiny' )],"uniq" => 90}, 'Type::Tiny::Union' );$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"complementary_type"};$v->{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"parent"};$v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"constraint"};$v->{"parent"}{"parent"} = $v->{"parent"}{"complementary_type"}{"parent"};$v->{"type_constraints"}[0]{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[0];$v->{"type_constraints"}[0]{"compiled_type_constraint"} = $v->{"type_constraints"}[0]{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[0]{"parent"}{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[0]{"parent"};$v->{"type_constraints"}[0]{"parent"}{"compiled_type_constraint"} = $v->{"type_constraints"}[0]{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[0]{"parent"}{"parent"} = $v->{"parent"};$v->{"type_constraints"}[1]{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[1];$v->{"type_constraints"}[1]{"compiled_type_constraint"} = $v->{"type_constraints"}[1]{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[1]{"parent"} = $v->{"parent"};$v->{"type_constraints"}[2]{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[2];$v->{"type_constraints"}[2]{"compiled_type_constraint"} = $v->{"type_constraints"}[2]{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[2]{"parent"}{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[2]{"parent"};$v->{"type_constraints"}[2]{"parent"}{"compiled_type_constraint"} = $v->{"type_constraints"}[2]{"parent"}{"coercion"}{"_compiled_type_constraint_check"}; \$v}->check($x) or Function::Parameters::_croak('In fun guess_and_convert_to_pdl: parameter 1 ($x): ' . ${my $v = bless( {"compiled_type_constraint" => sub ($) { package Type::Tiny; use warnings; use strict; local $_ = $_[0]; foreach my $c (@constraints) { return unless &$c(@_); } return !0;},"constraint" => sub { package Type::Tiny::Union; use warnings; use strict; my $val = $_; &$_($val) and return !0 foreach (@checks); return;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Data-Frame-0.006005-0/blib/lib/Data/Frame/Util.pm","line" => 141,"package" => "Data::Frame::Util"},"deprecated" => !!0,"name" => "__ANON__","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"type_constraints" => [bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; Ref::Util::XS::is_plain_arrayref($_[0]) or _failed_check(21, 'ArrayRef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_ArrayRef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"coercion_generator" => bless( ["ArrayRef","coercion_generator"], 'Types::Standard::LazyLoad' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_ eq 'ARRAY';},"constraint_generator" => bless( ["ArrayRef","constraint_generator"], 'Types::Standard::LazyLoad' ),"deep_explanation" => bless( ["ArrayRef","deep_explanation"], 'Types::Standard::LazyLoad' ),"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 523,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ArrayRef","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => bless( ["ArrayRef","inline_generator"], 'Types::Standard::LazyLoad' ),"inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_plain_arrayref($_[1])" : "ref($_[1]) eq 'ARRAY'";},"library" => "Types::Standard","name" => "ArrayRef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; not ref $_[0] and _failed_check(16, 'Ref', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Ref","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_;},"constraint_generator" => sub { package Types::Standard; no warnings; use strict; return $meta->get_type('Ref') unless @_; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'Ref', \@_, 1); my $reftype = shift(); $reftype =~ /^(SCALAR|ARRAY|HASH|CODE|REF|GLOB|LVALUE|FORMAT|IO|VSTRING|REGEXP|Regexp)$/i or _croak "Parameter to Ref[`a] expected to be a Perl ref type; got $reftype"; $reftype = "$reftype"; return sub { ref $_[0] and builtin::reftype($_[0]) eq $reftype; } ;},"deep_explanation" => sub { package Types::Standard; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; return if $type->check($value); my $reftype = builtin::reftype($value); return [sprintf('"%s" constrains reftype(%s) to be equal to %s', $type, $varname, B::perlstring($param)), sprintf('reftype(%s) is %s', $varname, defined $reftype ? B::perlstring($reftype) : 'undef')];},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 438,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Ref","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard; no warnings; use strict; my $reftype = shift(); return sub { my $v = $_[1]; &$maybe_load_modules('Scalar::Util', "ref($v) and Scalar::Util::reftype($v) eq q($reftype)"); } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; "!!ref($_[1])";},"library" => "Types::Standard","name" => "Ref","parent" => {},"uniq" => 16}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return [];},"type_default_generator" => sub { package Types::Standard; no warnings; use strict; return $Type::Tiny::parameterize_type->type_default if @_ < 2; return undef;},"uniq" => 21}, 'Type::Tiny' ),bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; defined $_[0] and not ref $_[0] or _failed_check(8, 'Value', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Value","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; not ref $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 276,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Value","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1]) and not ref($_[1])";},"library" => "Types::Standard","name" => "Value","parent" => {},"uniq" => 8}, 'Type::Tiny' ),bless( {"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00"} use strict; $type->check($_[0]) or _failed_check($type, 'ColumnLike', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Type::Tiny; use warnings; use strict; local $_ = $_[0]; foreach my $c (@constraints) { return unless &$c(@_); } return !0;},"display_name" => "to_ColumnLike","name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Data::Frame::Types; use warnings; use strict; $_->ndims <= 1;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Data-Frame-0.006005-0/blib/lib/Data/Frame/Types.pm","line" => 24,"package" => "Data::Frame::Types"},"deprecated" => !!0,"display_name" => "ColumnLike","exception_class" => "Error::TypeTiny::Assertion","library" => "Data::Frame::Types","name" => "ColumnLike","parent" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => sub ($) { package Eval::TypeTiny::Sandbox; use strict; do { package Type::Tiny; builtin::blessed($_[0]) and do { my $method = $_[0]->can('DOES') || $_[0]->can('isa'); $_[0]->$method('PDL') } };},"frozen" => 1,"name" => "__ANON__","type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 1015,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "ConsumerOf[\"PDL\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::Tiny::Role; use warnings; use strict; my $var = $_[1]; my $code = "Scalar::Util::blessed($var) and do { my \$method = $var->can('DOES')||$var->can('isa'); $var->\$method(q[$role]) }"; return "do { use Scalar::Util (); $code }" if $Type::Tiny::AvoidCallbacks; $code;},"name" => "__ANON__","role" => "PDL","uniq" => 82}, 'Type::Tiny::Role' ),"uniq" => 83}, 'Type::Tiny' )],"uniq" => 90}, 'Type::Tiny::Union' );$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"complementary_type"};$v->{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"parent"};$v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"parent"}{"complementary_type"}{"parent"}{"constraint"};$v->{"parent"}{"parent"} = $v->{"parent"}{"complementary_type"}{"parent"};$v->{"type_constraints"}[0]{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[0];$v->{"type_constraints"}[0]{"compiled_type_constraint"} = $v->{"type_constraints"}[0]{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[0]{"parent"}{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[0]{"parent"};$v->{"type_constraints"}[0]{"parent"}{"compiled_type_constraint"} = $v->{"type_constraints"}[0]{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[0]{"parent"}{"parent"} = $v->{"parent"};$v->{"type_constraints"}[1]{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[1];$v->{"type_constraints"}[1]{"compiled_type_constraint"} = $v->{"type_constraints"}[1]{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[1]{"parent"} = $v->{"parent"};$v->{"type_constraints"}[2]{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[2];$v->{"type_constraints"}[2]{"compiled_type_constraint"} = $v->{"type_constraints"}[2]{"coercion"}{"_compiled_type_constraint_check"};$v->{"type_constraints"}[2]{"parent"}{"coercion"}{"type_constraint"} = $v->{"type_constraints"}[2]{"parent"};$v->{"type_constraints"}[2]{"parent"}{"compiled_type_constraint"} = $v->{"type_constraints"}[2]{"parent"}{"coercion"}{"_compiled_type_constraint_check"}; \$v}->get_message($x)) 444 0 444
Condition66%2/3
@_ > 1 and (@_ - 1) % 2
!ll&&!rl&&r
3041400
MC/DC0%0/2
@_ > 1 and (@_ - 1) % 2
@_ > 1 (@_ - 1) % 2
Truth table66%2/3
A and B
A= @_ > 1B= (@_ - 1) % 2
ABresult
0X0
100
111
143 444 ▶ return $x if ( $x->$_DOES('PDL') );
Branch: 1 branch
BranchTrueFalseTotal
if $x->$Data::Frame::Util::_DOES("PDL") 10 434 444
144  
145 434 my $is_na0 = _is_na($na, 1);
146 434 my $like_number;
147 434 ▶ if ( !ref $x ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not ref $x) { } 287 147 434
148 287 $like_number = looks_like_number($x);
149 287 $x = [$x];
150 }
151 else {
152 30149 ▶ $like_number = List::AllUtils::all {
Subroutine __ANON__: called CC=2 SCAR=6.9
153 30149 ▶ looks_like_number($_) or &$is_na0($_);
Branch: 1 branch
BranchTrueFalseTotal
&looks_like_number($_) or &$is_na0($_) 29978 171 30149
154 }
155 147 @$x[ 0 .. List::AllUtils::min( $test_count - 1, $#$x ) ];
156 }
157  
158 # The $na parameter is only effective for logical and numeric columns.
159 # This is in align with R's from_csv behavior.
160 434 ▶ if ($like_number) {
Branch: 1 branch
BranchTrueFalseTotal
if ($like_number) { } 131 303 434
161 131 return _numeric_from_arrayref($x, $na);
162 }
163 else {
164 303 ▶ if ($strings_as_factors) {
Branch: 1 branch
BranchTrueFalseTotal
if ($strings_as_factors) { } 1 302 303
165 1 return _factor_from_arrayref($x, $na);
166 }
167 else {
168 302 return _pdlsv_from_arrayref($x, $na);
169 }
170 }
171 13 }
172  
173 13 1;
174  
175 __END__
« Data/Frame/Partial/Eval.pm ↑ Summary Data/Frame/Indexer.pm »