| 1 |
|
| package Chart::GGPlot::Util; |
| 2 |
|
| |
| 3 |
|
| # ABSTRACT: Utility functions |
| 4 |
|
| |
| 5 |
24 |
▶ | use Chart::GGPlot::Setup qw(:base :pdl); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 6 |
|
| |
| 7 |
24 |
| our $VERSION = '0.002003'; # VERSION |
| 8 |
|
| |
| 9 |
24 |
▶ | use Data::Dumper::Concise (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 10 |
|
| |
| 11 |
24 |
▶ | use Data::Frame; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 12 |
|
| |
| 13 |
|
| #TODO: Watch https://github.com/kmx/pdl-datetime/issues/1 |
| 14 |
|
| # PDL::Constants uses PDL::Complex which has conflict with PDL::DateTime |
| 15 |
|
| #use PDL::Constants qw(PI); |
| 16 |
24 |
▶ | use Math::Trig (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 17 |
24 |
▶ | use constant PI => Math::Trig::pi; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 18 |
|
| |
| 19 |
24 |
▶ | use List::AllUtils qw(min); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 20 |
24 |
▶ | use Module::Load; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 21 |
24 |
▶ | use PDL::Primitive qw(which); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 22 |
24 |
▶ | use Package::Stash; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 23 |
24 |
▶ | use POSIX qw(floor); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 24 |
24 |
▶ | use Types::PDL qw(Piddle1D PiddleFromAny); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 25 |
24 |
▶ | use Types::Standard qw(ArrayRef); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 26 |
|
| |
| 27 |
24 |
▶ | use Chart::GGPlot::Util::_Base qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 28 |
24 |
▶ | use Chart::GGPlot::Util::Scales qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 29 |
|
| |
| 30 |
24 |
▶ | use parent qw(Exporter::Tiny); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 31 |
|
| |
| 32 |
24 |
| my @export_ggplot = qw( |
| 33 |
|
| expand_range4 remove_missing |
| 34 |
|
| resolution |
| 35 |
|
| stat |
| 36 |
|
| ); |
| 37 |
|
| |
| 38 |
24 |
| my @export_all = ( |
| 39 |
|
| @export_ggplot, |
| 40 |
|
| qw( |
| 41 |
|
| PI |
| 42 |
|
| pt stroke |
| 43 |
|
| isnt_null_or |
| 44 |
|
| clist |
| 45 |
|
| call_if_coderef |
| 46 |
|
| alias_color_functions |
| 47 |
|
| dist_euclidean dist_polar |
| 48 |
|
| find_line_formula spiral_arc_length |
| 49 |
|
| has_groups |
| 50 |
|
| collect_functions_from_package |
| 51 |
|
| arraylike |
| 52 |
|
| mm_to_pt mm_to_px |
| 53 |
|
| ), |
| 54 |
|
| ); |
| 55 |
|
| |
| 56 |
24 |
| our @EXPORT_OK = ( |
| 57 |
|
| @Chart::GGPlot::Util::_Base::EXPORT_OK, |
| 58 |
|
| @Chart::GGPlot::Util::Scales::EXPORT_OK, @export_all, |
| 59 |
|
| ); |
| 60 |
24 |
| our %EXPORT_TAGS = ( |
| 61 |
|
| all => \@EXPORT_OK, |
| 62 |
|
| base => \@Chart::GGPlot::Util::_Base::EXPORT_OK, |
| 63 |
|
| scales => \@Chart::GGPlot::Util::Scales::EXPORT_OK, |
| 64 |
|
| ggplot => \@export_ggplot, |
| 65 |
|
| ); |
| 66 |
|
| |
| 67 |
24 |
▶ | use constant pt => 72.27 / 25.4; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 68 |
24 |
▶ | use constant stroke => 96 / 25.4; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 69 |
|
| |
| 70 |
19 |
▶ | fun expand_range4 ( $limits, $expand ) { |
|
Subroutine
expand_range4: called CC=7 SCAR=19.7
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun expand_range4 (expected 2, got ' . @_ . ')') |
0 |
19 |
19 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun expand_range4 (expected 2, got ' . @_ . ')') |
0 |
19 |
19 |
|
| 71 |
19 |
▶ | return $limits if ($limits->length) == 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if $limits->length == 0 |
2 |
17 |
19 |
|
| 72 |
|
| |
| 73 |
17 |
▶ | die unless ( $expand->length == 2 or $expand->length == 4 ); |
Branch: 1 branch
| Branch | True | False | Total |
| unless $expand->length == 2 or $expand->length == 4 |
0 |
17 |
17 |
Condition66%2/3
$expand->length == 2 or $expand->length == 4
MC/DC0%0/2
$expand->length == 2 or $expand->length == 4
$expand->length == 2
$expand->length == 4
Truth table66%2/3
A or B
A= $expand->length == 2B= $expand->length == 4
|
| 74 |
|
| |
| 75 |
17 |
▶ | if ( $expand->length == 2 ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($expand->length == 2) |
1 |
16 |
17 |
|
| 76 |
1 |
| $expand = pdl([(@{ $expand->unpdl })x2]); |
| 77 |
|
| } |
| 78 |
|
| |
| 79 |
17 |
| my $lower = |
| 80 |
|
| expand_range( $limits, $expand->at(0), $expand->at(1) )->at(0); |
| 81 |
17 |
| my $upper = |
| 82 |
|
| expand_range( $limits, $expand->at(2), $expand->at(3) )->at(1); |
| 83 |
17 |
| return pdl( [ $lower, $upper ] ); |
| 84 |
24 |
| } |
| 85 |
|
| |
| 86 |
|
| |
| 87 |
4 |
▶ | fun remove_missing ($df, |
|
Subroutine
remove_missing: called CC=16 SCAR=28.3
Pod
documented
|
| 88 |
|
| :$vars = $df->names, :$na_rm = false, |
| 89 |
4 |
▶ | :$name = '', :$finite = false) { |
Branch: 7 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun remove_missing (expected 1, got ' . @_ . ')') |
0 |
4 |
4 |
| @_ > 1 and (@_ - 1) % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun remove_missing") |
0 |
4 |
4 |
| exists ${__rest}{'vars'} ? : |
3 |
1 |
4 |
| exists ${__rest}{'na_rm'} ? : |
3 |
1 |
4 |
| exists ${__rest}{'name'} ? : |
3 |
1 |
4 |
| exists ${__rest}{'finite'} ? : |
2 |
2 |
4 |
| keys %{__rest} and Function::Parameters::_croak('In fun remove_missing: no such named parameter: ' . join(", ", sort(keys %{__rest}))) |
0 |
4 |
4 |
MC/DC0%0/2
@_ > 1 and (@_ - 1) % 2
@_ > 1
(@_ - 1) % 2
Truth table66%2/3
A and B
A= @_ > 1B= (@_ - 1) % 2
|
| 90 |
4 |
| $vars = $vars->intersect( $df->names ); |
| 91 |
|
| |
| 92 |
4 |
| my $missing = PDL::Core::zeros( $df->nrow ); |
| 93 |
|
| |
| 94 |
4 |
| for my $var (@$vars) { |
| 95 |
9 |
| my $col = $df->at($var); |
| 96 |
9 |
| my $bad = $col->isbad; |
| 97 |
9 |
▶ | if ($finite and !is_discrete($col)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($finite and not is_discrete($col)) |
2 |
7 |
9 |
Condition66%2/3
$finite and not is_discrete($col)
MC/DC50%1/2
$finite and not is_discrete($col)
$finite
not is_discrete($col)
Truth table66%2/3
A and not(B)
A= $finiteB= not is_discrete($col)
|
| 98 |
2 |
| $bad = ( $bad | !( $col->isfinite ) ); |
| 99 |
|
| } |
| 100 |
9 |
| $missing->where( $bad ) .= 1; |
| 101 |
|
| } |
| 102 |
|
| |
| 103 |
4 |
▶ | if ( $missing->any ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($missing->any) { } |
1 |
3 |
4 |
|
| 104 |
1 |
▶ | if ( !$na_rm ) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless ($na_rm) |
1 |
0 |
1 |
|
| 105 |
1 |
▶ | carp( |
Branch: 2 branches
| Branch | True | False | Total |
| $finite ? : |
0 |
1 |
1 |
| length $name ? : |
0 |
1 |
1 |
|
| 106 |
|
| sprintf( |
| 107 |
|
| "Removed %s rows containing %s values%s.", |
| 108 |
|
| which($missing)->length, |
| 109 |
|
| ( $finite ? 'non-finite' : 'missing' ), |
| 110 |
|
| ( length($name) ? " ($name)" : $name ) |
| 111 |
|
| ) |
| 112 |
|
| ); |
| 113 |
|
| } |
| 114 |
1 |
| return $df->select_rows( which( !$missing ) ); |
| 115 |
|
| } |
| 116 |
|
| else { |
| 117 |
3 |
| return $df; |
| 118 |
|
| } |
| 119 |
24 |
| } |
| 120 |
|
| |
| 121 |
|
| |
| 122 |
0 |
▶ | fun call_if_coderef ($x, @args) { |
|
Subroutine
call_if_coderef: not called CC=3 SCAR=24.8
Pod
documented
Branch: 1 branch
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun call_if_coderef (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 123 |
0 |
▶ | return ( Ref::Util::is_coderef($x) ? $x->(@args) : $x ); |
Branch: 1 branch
| Branch | True | False | Total |
| Ref::Util::XS::is_coderef($x) ? : |
0 |
0 |
0 |
|
| 124 |
24 |
| } |
| 125 |
|
| |
| 126 |
0 |
▶ | fun clist ($hash_like) { |
|
Subroutine
clist: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun clist (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun clist (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 127 |
0 |
▶ | unless ( Ref::Util::is_plain_hashref($hash_like) ) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless (Ref::Util::XS::is_plain_hashref($hash_like)) |
0 |
0 |
0 |
|
| 128 |
0 |
| $hash_like = { map { $_ => $hash_like->at($_) } @{ $hash_like->keys } }; |
| 129 |
|
| } |
| 130 |
0 |
| return Data::Dumper::Concise::Dumper($hash_like); |
| 131 |
24 |
| } |
| 132 |
|
| |
| 133 |
|
| |
| 134 |
7 |
▶ | fun alias_color_functions ($package, @function_names) { |
|
Subroutine
alias_color_functions: called CC=3 SCAR=11.0
Pod
documented
Branch: 1 branch
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun alias_color_functions (expected 1, got ' . @_ . ')') |
0 |
7 |
7 |
|
| 135 |
|
| return map { |
| 136 |
7 |
▶ | if ( $_ =~ /color/ ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($_ =~ /color/u) { } |
77 |
231 |
308 |
|
| 137 |
77 |
| my $alias_name = $_ =~ s/color/colour/gr; |
| 138 |
|
| { |
| 139 |
24 |
▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 140 |
77 |
| *{"${package}::${alias_name}"} = \&{"${package}::$_"}; |
| 141 |
|
| } |
| 142 |
77 |
| ( $_, $alias_name ); |
| 143 |
|
| } |
| 144 |
|
| else { |
| 145 |
231 |
| $_; |
| 146 |
|
| } |
| 147 |
|
| } @function_names; |
| 148 |
24 |
| } |
| 149 |
|
| |
| 150 |
0 |
▶ | fun find_global ($name) { |
|
Subroutine
find_global: not called CC=5 SCAR=34.0
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun find_global (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun find_global (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 151 |
0 |
| my $trace = Devel::StackTrace->new; |
| 152 |
|
| |
| 153 |
0 |
| my $frame = $trace->prev_frame; |
| 154 |
0 |
▶ | while ( $frame = $trace->prev_frame ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($frame = $trace->prev_frame) |
0 |
0 |
0 |
|
| 155 |
0 |
| my $stash = Package::Stash->new( $frame->package ); |
| 156 |
0 |
▶ | if ( $stash->has_symbol($name) ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($stash->has_symbol($name)) |
0 |
0 |
0 |
|
| 157 |
0 |
| return $stash->get_symbol($name); |
| 158 |
|
| } |
| 159 |
|
| } |
| 160 |
0 |
| return; |
| 161 |
24 |
| } |
| 162 |
|
| |
| 163 |
0 |
▶ | fun isnt_null_or ( $a, $b ) { !is_null($a) ? $a : $b; } |
|
Subroutine
isnt_null_or: not called CC=4 SCAR=27.9
Pod
undocumented
Branch: 3 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun isnt_null_or (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun isnt_null_or (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| !is_null($a) ? : |
0 |
0 |
0 |
|
| 164 |
|
| |
| 165 |
|
| # Euclidean distance between points. |
| 166 |
0 |
▶ | fun dist_euclidean ($x, $y) { |
|
Subroutine
dist_euclidean: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun dist_euclidean (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun dist_euclidean (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 167 |
0 |
| my $n = $x->length; |
| 168 |
0 |
| my $idx = sequence( $n - 1 ); |
| 169 |
0 |
| return ( ( $x->slice($idx) - $x->slice( $idx + 1 ) )**2 + |
| 170 |
|
| ( $y->slice($idx) - $y->slice( $idx + 1 ) )**2 )->sqrt; |
| 171 |
24 |
| } |
| 172 |
|
| |
| 173 |
|
| # Polar distance between points. |
| 174 |
0 |
▶ | fun dist_polar ($r, $theta) { |
|
Subroutine
dist_polar: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun dist_polar (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun dist_polar (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 175 |
0 |
| my $lf = find_line_formula( $theta, $r ); |
| 176 |
|
| |
| 177 |
|
| # Rename x and y columns to r and t, since we're working in polar |
| 178 |
0 |
| $lf = $lf->rename( |
| 179 |
|
| { |
| 180 |
|
| x1 => 't1', |
| 181 |
|
| x2 => 't2', |
| 182 |
|
| y1 => 'r1', |
| 183 |
|
| y2 => 'r2', |
| 184 |
|
| x_intercept => 't_int', |
| 185 |
|
| yintercept => 'r_int' |
| 186 |
|
| } |
| 187 |
|
| ); |
| 188 |
|
| |
| 189 |
0 |
| $lf->set( 'tn1', $lf->at('t1') - $lf->at('t_int') ); |
| 190 |
0 |
| $lf->set( 'tn2', $lf->at('t2') - $lf->at('t_int') ); |
| 191 |
|
| |
| 192 |
0 |
| my $dist = pdl( [ ('nan') x $lf->nrow ] )->setnantobad; |
| 193 |
0 |
| my $slope = $lf->at('slope'); |
| 194 |
0 |
| my $idx = which( !$slope->isbad & ( $slope != 0 ) & $slope->isfinite ); |
| 195 |
0 |
| $dist->slice($idx) .= spiral_arc_length( |
| 196 |
|
| $slope->slice($idx), |
| 197 |
|
| $lf->at('tn1')->slice($idx), |
| 198 |
|
| $lf->at('tn2')->slice($idx) |
| 199 |
|
| ); |
| 200 |
|
| |
| 201 |
|
| # Get circular arc length for segments that have zero slope (r1 == r2) |
| 202 |
0 |
| $idx = which( !$slope->isbad & ( $slope == 0 ) ); |
| 203 |
0 |
| $dist->slice($idx) .= $lf->at('r1')->slice($idx) * |
| 204 |
|
| ( $lf->at('t2')->slice($idx) - $lf->at('t1')->slice($idx) ); |
| 205 |
|
| |
| 206 |
|
| # Get radial length for segments that have infinite slope (t1 == t2) |
| 207 |
0 |
| $idx = which( !$slope->isbad & !$slope->isfinite ); |
| 208 |
0 |
| $dist->slice($idx) .= |
| 209 |
|
| $lf->at('r1')->slice($idx) - $lf->at('r2')->slice($idx); |
| 210 |
|
| |
| 211 |
|
| # Find the maximum possible length, a spiral line from |
| 212 |
|
| # (r=0, theta=0) to (r=1, theta=2*pi) |
| 213 |
0 |
| my $max_dist = spiral_arc_length( 1 / ( 2 * PI ), 0, 2 * PI ); |
| 214 |
|
| |
| 215 |
|
| # Final distance values, normalized |
| 216 |
0 |
| return ( $dist / $max_dist ); |
| 217 |
24 |
| } |
| 218 |
|
| |
| 219 |
|
| # Given n points, find the slope, xintercept, and yintercept of |
| 220 |
|
| # the lines connecting them. |
| 221 |
|
| # Returns a data frame with $x->length-1 rows. |
| 222 |
|
| |
| 223 |
2 |
▶ | fun find_line_formula ($x, $y) { |
|
Subroutine
find_line_formula: called CC=3 SCAR=11.1
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for fun find_line_formula (expected 2, got ' . @_ . ')') |
0 |
2 |
2 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun find_line_formula (expected 2, got ' . @_ . ')') |
0 |
2 |
2 |
|
| 224 |
2 |
| state $check = |
| 225 |
|
| Type::Params::compile( ( Piddle1D->plus_coercions(PiddleFromAny) ) x 2 ); |
| 226 |
2 |
| ( $x, $y ) = $check->( $x, $y ); |
| 227 |
|
| |
| 228 |
2 |
| my $slope = $y->diff / $x->diff; |
| 229 |
2 |
| my $yintercept = $y->slice("1:") - $slope * $x->slice("1:"); |
| 230 |
2 |
| my $xintercept = $x->slice("1:") - $y->slice("1:") / $slope; |
| 231 |
2 |
| return Data::Frame->new( |
| 232 |
|
| columns => [ |
| 233 |
|
| x1 => $x->slice( "0:" . ( $x->length - 2 ) ), |
| 234 |
|
| y1 => $y->slice( "0:" . ( $y->length - 2 ) ), |
| 235 |
|
| x2 => $x->slice("1:"), |
| 236 |
|
| y2 => $y->slice("1:"), |
| 237 |
|
| slope => $slope, |
| 238 |
|
| yintercept => $yintercept, |
| 239 |
|
| xintercept => $xintercept |
| 240 |
|
| ] |
| 241 |
|
| ); |
| 242 |
24 |
| } |
| 243 |
|
| |
| 244 |
1 |
▶ | fun spiral_arc_length ($a, $theta1, $theta2) { |
|
Subroutine
spiral_arc_length: called CC=3 SCAR=11.2
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 3 and Function::Parameters::_croak('Too few arguments for fun spiral_arc_length (expected 3, got ' . @_ . ')') |
0 |
1 |
1 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for fun spiral_arc_length (expected 3, got ' . @_ . ')') |
0 |
1 |
1 |
|
| 245 |
1 |
| state $check = |
| 246 |
|
| Type::Params::compile( ( Piddle1D->plus_coercions(PiddleFromAny) ) x 3 ); |
| 247 |
1 |
| ( $a, $theta1, $theta2 ) = $check->( $a, $theta1, $theta2 ); |
| 248 |
1 |
| return $a * 0.5 * |
| 249 |
|
| ( ( $theta1 * ( $theta1**2 + 1 )->sqrt + $theta1->asinh ) - |
| 250 |
|
| ( $theta2 * ( $theta2**2 + 1 )->sqrt + $theta2->asinh ) ); |
| 251 |
24 |
| } |
| 252 |
|
| |
| 253 |
|
| |
| 254 |
13 |
▶ | fun resolution(Piddle1D $x, $zero=true) { |
|
Subroutine
resolution: called CC=9 SCAR=22.4
Pod
documented
Branch: 4 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun resolution (expected 1, got ' . @_ . ')') |
0 |
13 |
13 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for fun resolution (expected 2, got ' . @_ . ')') |
0 |
13 |
13 |
| @_ < 2 and $zero = &true() |
12 |
1 |
13 |
| Type::Tiny::XS::AUTO::TC1($x) and $x->ndims == 1 or Function::Parameters::_croak('In fun resolution: 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\x00"} use strict; Type::Tiny::XS::AUTO::TC1($_[0]) and $_[0]->ndims == 1 or _failed_check(52, 'Piddle1D', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ($) { package Eval::TypeTiny::Sandbox; use strict; Type::Tiny::XS::AUTO::TC1($_[0]) and $_[0]->ndims == 1;},"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"constraint_generator" => sub { package Type::TinyX::Facets; use warnings; use strict; my $base = do { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x45\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} $Type::Tiny::parameterize_type }; my(%params) = @_ or return $base; my(@checks) = &$IG(%params)->($base, '$_[0]'); $checks[0] = $base->inline_check('$_[0]'); my $sub = sprintf('sub { %s }', join(' and ', map(("($_)"), @checks))); eval $sub or _croak("could not build sub: $@\n\nCODE: $sub\n");},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/PDL.pm","line" => 142,"package" => "Types::PDL"},"deprecated" => !!0,"display_name" => "Piddle1D","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Type::TinyX::Facets; use warnings; use strict; my(%p_not_destroyed) = @_; return sub { my(%p) = %p_not_destroyed; my $var = $_[1]; my(@r) = map($_->[1]->(\%p, $var, $_->[0]), @facets); _croak(sprintf('Attempt to parameterize type "%s" with unrecognised parameter%s %s', $_[0]->name, scalar keys %p == 1 ? '' : 's', Type::Utils::english_list(map((qq["$_"]), sort(keys %p))))) if keys %p; return undef, @r; } ;},"library" => "Types::PDL","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_192; use warnings; use strict; do { Type::Tiny::XS::AUTO::TC1($_[0]) and $_[0]->ndims == 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"name" => "Types::PDL::Piddle1D","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => bless( {"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Type::TinyX::Facets; use warnings; use strict; Type::Tiny::XS::AUTO::TC1($_[0]) and $_[0]->ndims == 1;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/PDL.pm","line" => 142,"package" => "Types::PDL"},"deprecated" => !!0,"display_name" => "Piddle[ndims=>\"1\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::TinyX::Facets; use warnings; use strict; my(%p) = %p_not_destroyed; my $var = $_[1]; my(@r) = map($_->[1]->(\%p, $var, $_->[0]), @facets); _croak(sprintf('Attempt to parameterize type "%s" with unrecognised parameter%s %s', $_[0]->name, scalar keys %p == 1 ? '' : 's', Type::Utils::english_list(map((qq["$_"]), sort(keys %p))))) if keys %p; return undef, @r;},"moose_type" => {},"name" => "__ANON__","parameters" => ["ndims",1],"parent" => bless( {"_caller_level" => 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\x00"} use strict; Type::Tiny::XS::AUTO::TC1($_[0]) or _failed_check(46, 'Piddle', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"class" => "PDL","compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny::Class; use warnings; use strict; builtin::blessed($_) and $_->isa($class);},"constraint_generator" => sub { package Type::TinyX::Facets; use warnings; use strict; my $base = do { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x45\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} $Type::Tiny::parameterize_type }; my(%params) = @_ or return $base; my(@checks) = &$IG(%params)->($base, '$_[0]'); $checks[0] = $base->inline_check('$_[0]'); my $sub = sprintf('sub { %s }', join(' and ', map(("($_)"), @checks))); eval $sub or _croak("could not build sub: $@\n\nCODE: $sub\n");},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/PDL.pm","line" => 138,"package" => "Types::PDL"},"deprecated" => !!0,"display_name" => "Piddle","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Type::TinyX::Facets; use warnings; use strict; my(%p_not_destroyed) = @_; return sub { my(%p) = %p_not_destroyed; my $var = $_[1]; my(@r) = map($_->[1]->(\%p, $var, $_->[0]), @facets); _croak(sprintf('Attempt to parameterize type "%s" with unrecognised parameter%s %s', $_[0]->name, scalar keys %p == 1 ? '' : 's', Type::Utils::english_list(map((qq["$_"]), sort(keys %p))))) if keys %p; return undef, @r; } ;},"inlined" => sub { package Type::Tiny::Class; use warnings; use strict; my $var = $_[1]; return "do { use Scalar::Util (); Scalar::Util::blessed($var) and $var->isa(q[$class]) }" if $Type::Tiny::AvoidCallbacks; return "$xsub($var)" if $xsub; "Scalar::Util::blessed($var) and $var->isa(q[$class])";},"library" => "Types::PDL","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"class" => "PDL","compiled_type_constraint" => sub { package Eval::Closure::Sandbox_186; use warnings; use strict; do { builtin::blessed($_[0]) and $_[0]->isa('PDL') };},"constraint" => sub { package Moose::Meta::TypeConstraint::Class; use warnings; use strict; $_[0]->isa($class_name);},"inline_environment" => {},"inlined" => sub { package Moose::Meta::TypeConstraint::Class; use warnings; use strict; my $self = shift(); my $val = shift(); return 'Scalar::Util::blessed(' . $val . ')' . ' && ' . $val . '->isa(' . B::perlstring($self->class) . ')';},"name" => "Types::PDL::Piddle","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => 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\x00"} use strict; Ref::Util::XS::is_blessed_ref($_[0]) or _failed_check(24, 'Object', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Object","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; builtin::blessed($_);},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 578,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Object","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_blessed_ref($_[1])" : &$maybe_load_modules('Scalar::Util', "Scalar::Util::blessed($_[1])");},"is_object" => 1,"library" => "Types::Standard","moose_type" => {},"name" => "Object","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\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" => 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\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\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\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" => do{my $o},"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\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","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"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","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => do{my $o},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"uniq" => 24}, 'Type::Tiny' ),"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_58; use warnings; use strict; do { builtin::blessed($_[0]) };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; builtin::blessed($_);},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'Scalar::Util::blessed(' . $_[1] . ')';},"name" => "Object","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_50; use warnings; use strict; do { ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ')';},"name" => "Ref","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint::Class' ),"name" => "Piddle","name_generator" => sub { package Type::TinyX::Facets; use warnings; use strict; my($s, %a) = @_; sprintf '%s[%s]', $s, join(',', map(sprintf('%s=>%s', $_, B::perlstring($a{$_})), sort(keys %a)));},"parent" => {},"uniq" => 46}, 'Type::Tiny::Class' ),"uniq" => 51}, 'Type::Tiny' ),"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_191; use warnings; use strict; do { Type::Tiny::XS::AUTO::TC1($_[0]) and $_[0]->ndims == 1 };},"constraint" => do{my $o},"inline_environment" => {},"inlined" => sub { package Type::Tiny; use warnings; use strict; shift(); $self->inline_check(@_);},"name" => "__ANON__","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Piddle1D","name_generator" => sub { package Type::TinyX::Facets; use warnings; use strict; my($s, %a) = @_; sprintf '%s[%s]', $s, join(',', map(sprintf('%s=>%s', $_, B::perlstring($a{$_})), sort(keys %a)));},"parent" => {},"uniq" => 52}, 'Type::Tiny' );$v->{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v;$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"constraint"} = $v->{"constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"moose_type"}{"parent"}{"constraint"} = $v->{"moose_type"}{"constraint"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"complementary_type"}{"parent"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"}{"moose_type"};$v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"moose_type"}{"parent"}{"constraint"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"constraint"};$v->{"moose_type"}{"parent"}{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"};$v->{"parent"} = $v->{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($x)) |
13 |
0 |
13 |
Condition33%1/3
Type::Tiny::XS::AUTO::TC1($x) and $x->ndims == 1
MC/DC0%0/2
Type::Tiny::XS::AUTO::TC1($x) and $x->ndims == 1
Type::Tiny::XS::AUTO::TC1($x)
$x->ndims == 1
Truth table33%1/3
A and B
A= Type::Tiny::XS::AUTO::TC1($x)B= $x->ndims == 1
|
| 255 |
13 |
▶ | if ($x->type < PDL::float or zero_range(range_($x, true))) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($x->type < PDL::float() or zero_range(range_($x, &true()))) |
8 |
5 |
13 |
Condition100%3/3
$x->type < PDL::float() or zero_range(range_($x, &true()))
MC/DC100%2/2
$x->type < PDL::float() or zero_range(range_($x, &true()))
$x->type < PDL::float()
zero_range(range_($x, &true()))
Truth table100%3/3
A or B
A= $x->type < PDL::float()B= zero_range(range_($x, &true()))
|
| 256 |
8 |
| return 1; |
| 257 |
|
| } |
| 258 |
5 |
▶ | if ($zero) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($zero) { } |
4 |
1 |
5 |
|
| 259 |
4 |
| $x = $x->glue(0, pdl(0))->uniq; |
| 260 |
|
| } else { |
| 261 |
1 |
| $x = $x->uniq; |
| 262 |
|
| } |
| 263 |
5 |
| return $x->qsort->diff->min; |
| 264 |
24 |
| } |
| 265 |
|
| |
| 266 |
|
| |
| 267 |
2 |
▶ | fun stat($x) { $x } |
|
Subroutine
stat: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun stat (expected 1, got ' . @_ . ')') |
0 |
2 |
2 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun stat (expected 1, got ' . @_ . ')') |
0 |
2 |
2 |
|
| 268 |
|
| |
| 269 |
24 |
▶ | use constant NO_GROUP => -1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 270 |
|
| |
| 271 |
1 |
▶ | fun has_groups ($df) { |
|
Subroutine
has_groups: called CC=4 SCAR=14.5
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for fun has_groups (expected 1, got ' . @_ . ')') |
0 |
1 |
1 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for fun has_groups (expected 1, got ' . @_ . ')') |
0 |
1 |
1 |
|
| 272 |
|
| |
| 273 |
|
| # If no group aesthetic is specified, all values of the group column |
| 274 |
|
| # equal to NO_GROUP. On the other hand, if a group aesthetic is |
| 275 |
|
| # specified, all values are different from NO_GROUP. |
| 276 |
|
| # undef is returned for 0-row data frames. |
| 277 |
1 |
▶ | return undef if ( $df->nrow == 0 ); |
Branch: 1 branch
| Branch | True | False | Total |
| if $df->nrow == 0 |
0 |
1 |
1 |
|
| 278 |
1 |
| return ( $df->at('group')->at(0) >= 0 ); |
| 279 |
24 |
| } |
| 280 |
|
| |
| 281 |
101 |
▶ | sub collect_functions_from_package { |
|
Subroutine
collect_functions_from_package: called CC=3 SCAR=11.0
Pod
undocumented
|
| 282 |
101 |
| my ($package) = @_; |
| 283 |
|
| |
| 284 |
101 |
| load $package; |
| 285 |
|
| |
| 286 |
101 |
| my ($caller_package) = caller(); |
| 287 |
101 |
| my @func_names; |
| 288 |
101 |
| my $funcs = $package->ggplot_functions(); |
| 289 |
101 |
| for (@$funcs) { |
| 290 |
111 |
| my $name = $_->{name}; |
| 291 |
|
| |
| 292 |
24 |
▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 293 |
111 |
▶ | if (defined &{$name}) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined &{$name;}) |
0 |
111 |
111 |
|
| 294 |
0 |
| warn qq{Duplicate function definitions for "$name". } . |
| 295 |
|
| "Definition from package $package would mask earlier " . |
| 296 |
|
| "definition loaded into " . __PACKAGE__ . "."; |
| 297 |
|
| } |
| 298 |
|
| |
| 299 |
111 |
| *{"${caller_package}::${name}"} = $_->{code}; |
| 300 |
111 |
| push @func_names, $name; |
| 301 |
|
| } |
| 302 |
101 |
| return @func_names; |
| 303 |
|
| } |
| 304 |
|
| |
| 305 |
|
| |
| 306 |
31 |
▶ | sub arraylike { |
|
Subroutine
arraylike: called CC=2 SCAR=8.1
Pod
documented
|
| 307 |
31 |
| my ($x) = @_; |
| 308 |
31 |
▶ | return (Piddle1D->check($x) or ArrayRef->check($x)); |
Condition33%1/3
&Piddle1D()->check($x) || &ArrayRef()->check($x)
MC/DC0%0/2
&Piddle1D()->check($x) || &ArrayRef()->check($x)
&Piddle1D()->check($x)
&ArrayRef()->check($x)
Truth table33%1/3
A || B
A= &Piddle1D()->check($x)B= &ArrayRef()->check($x)
|
| 309 |
|
| } |
| 310 |
|
| |
| 311 |
|
| |
| 312 |
1 |
▶ | sub mm_to_pt { |
|
Subroutine
mm_to_pt: called CC=2 SCAR=8.1
Pod
documented
|
| 313 |
1 |
| my $result = 72 / 25.4 * $_[0]; |
| 314 |
1 |
▶ | $result->$_call_if_can('rint') // floor($result + 0.5); |
Condition33%1/3
$result->$Chart::GGPlot::Util::_call_if_can("rint") // floor($result + "0.5")
MC/DC0%0/2
$result->$Chart::GGPlot::Util::_call_if_can("rint") // floor($result + "0.5")
$result->$Chart::GGPlot::Util::_call_if_can("rint")
floor($result + "0.5")
Truth table33%1/3
A // B
A= $result->$Chart::GGPlot::Util::_call_if_can("rint")B= floor($result + "0.5")
|
| 315 |
|
| } |
| 316 |
|
| |
| 317 |
1 |
▶ | sub mm_to_px { |
|
Subroutine
mm_to_px: called CC=3 SCAR=12.0
Pod
documented
|
| 318 |
1 |
| my ( $x, $dpi ) = @_; |
| 319 |
1 |
▶ | $dpi //= 96; |
|
|
| 320 |
1 |
| my $result = $x / 25.4 * $dpi; |
| 321 |
1 |
▶ | $result->$_call_if_can('rint') // floor($result + 0.5); |
Condition33%1/3
$result->$Chart::GGPlot::Util::_call_if_can("rint") // floor($result + "0.5")
MC/DC0%0/2
$result->$Chart::GGPlot::Util::_call_if_can("rint") // floor($result + "0.5")
$result->$Chart::GGPlot::Util::_call_if_can("rint")
floor($result + "0.5")
Truth table33%1/3
A // B
A= $result->$Chart::GGPlot::Util::_call_if_can("rint")B= floor($result + "0.5")
|
| 322 |
|
| } |
| 323 |
|
| |
| 324 |
24 |
| 1; |
| 325 |
|
| |
| 326 |
|
| __END__ |