Git Product home page Git Product logo

perl5-test2-tools-pdl's Introduction

Build Status

NAME

Test2::Tools::PDL - Test2 tools for verifying Perl Data Language piddles

VERSION

version 0.001

SYNOPSIS

use Test2::Tools::PDL;

# Functions are exported by default.

# Ensure something is a piddle.
pdl_ok($x);

# Compare two piddles.
pdl_is($got, $expected, 'Same piddle.');

FUNCTIONS

pdl_ok($thing, $name)

Checks that the given $thing is a PDL object.

pdl_is($got, $exp, $name)

Checks that piddle $got is same as $exp.

Now this method is internally similar as is($got->unpdl, $exp->unpdl). It's possible to work with both numeric PDLs as well as non-numeric PDLs (like PDL::Char, PDL::SV).

DESCRIPTION

This module contains tools for verifying PDL piddles.

VARIABLES

This module can be configured by some module variables.

TOLERANCE, TOLERANCE_REL

These two variables are used when comparing float piddles. For pdl_is($got, $exp, ...), the effective tolerance is $TOLERANCE + abs($TOLERANCE_REL * $exp).

Default value of $TOLERANCE is same as $Test2::Compare::Float::DEFAULT_TOLERANCE, which is 1e-8. Default value of $TOLERANCE_REL is 0.

For example, to use only relative tolerance,

{
    local $Test2::Tools::PDL::TOLERANCE = 0;
    local $Test2::Tools::PDL::TOLERANCE_REL = 1e-6;
    ...
}

SEE ALSO

PDL, Test2::Suite, Test::PDL

AUTHOR

Stephan Loyd [email protected]

CONTRIBUTOR

Mohammad S Anwar [email protected]

COPYRIGHT AND LICENSE

This software is copyright (c) 2018-2023 by Stephan Loyd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

perl5-test2-tools-pdl's People

Contributors

iynehz avatar

Watchers

 avatar

Forkers

manwar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.