{"action":"created","comment":{"url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/comments/64700307","id":64700307,"diff_hunk":"@@ -0,0 +1,1477 @@\n+package Quant::Framework::VolSurface;\n+\n+=head1 NAME\n+\n+Quant::Framework::VolSurface\n+\n+=head1 DESCRIPTION\n+\n+Base class for all volatility surfaces.\n+\n+=cut\n+\n+use 5.010;\n+\n+use Moose;\n+use Try::Tiny;\n+use DateTime::TimeZone;\n+use List::MoreUtils qw(notall none all);\n+use Scalar::Util qw( looks_like_number weaken );\n+use Scalar::Util::Numeric qw( isnum );\n+use List::Util qw( min max first );\n+use Number::Closest::XS qw(find_closest_numbers_around);\n+use Math::Function::Interpolator;\n+\n+use Format::Util::Numbers qw( roundnear );\n+use Quant::Framework::VolSurface::Cutoff;\n+use Quant::Framework::VolSurface::Validator;\n+use Quant::Framework::VolSurface::Utils;\n+\n+has for_date => (\n+    is      => 'ro',\n+    isa     => 'Maybe[Date::Utility]',\n+    default => undef,\n+);\n+\n+has chronicle_reader => (\n+    is      => 'ro',\n+    isa     => 'Data::Chronicle::Reader',\n+);\n+\n+has chronicle_writer => (\n+    is      => 'ro',\n+    isa     => 'Data::Chronicle::Writer',\n+);\n+\n+has underlying_config => (\n+    is      => 'ro',\n+    isa     => 'Quant::Framework::Utils::UnderlyingConfig',\n+);\n+\n+has calendar => (\n+    is          => 'ro',\n+    isa         => 'Quant::Framework::TradingCalendar',\n+    lazy_build  => 1,\n+);\n+\n+sub _build_calendar {\n+    my $self = shift;\n+\n+    return $self->builder->build_calendar;\n+}\n+\n+has builder => (\n+    is          => 'ro',\n+    isa         => 'Quant::Framework::Utils::Builder'\n+    lazy_build  => 1,\n+);\n+\n+sub _build_builder {\n+    my $self = shift;\n+\n+    return Quant::Framework::Utils::Bulder->new({\n+            for_date => $self->for_date,\n+            chronicle_reader => $self->chronicle_reader,\n+            chronicle_writer => $self->chronicle_writer,\n+            undeerlying_config => $self->underlying_config,\n+        });\n+}\n+\n+=head1 ATTRIBUTES\n+\n+=head2 symbol\n+\n+The symbol of the underlying that this surface is for.\n+\n+=cut\n+\n+has symbol => (\n+    is       => 'ro',\n+    isa      => 'Str',\n+    required => 1,\n+);\n+\n+has _market_name => (\n+    is         => 'ro',\n+    isa        => 'Str',\n+    lazy_build => 1,\n+);\n+\n+sub _build__market_name {\n+    return shift->underlying_config->market_name;\n+}\n+\n+=head2 recorded_date\n+\n+The date (and time) that the surface was recorded, as a Date::Utility.\n+\n+=cut\n+\n+has recorded_date => (\n+    is         => 'ro',\n+    isa        => 'Date::Utility',\n+    lazy_build => 1,\n+);\n+\n+sub _build_recorded_date {\n+    my $self          = shift;\n+    my $recorded_date = Date::Utility->new($self->document->{date});\n+\n+    if (scalar grep { $self->type eq $_ } (qw(flat phased))) {\n+        $recorded_date = $self->for_date // Date::Utility->new;\n+    }\n+\n+    return $recorded_date;\n+}\n+\n+=head2 type\n+\n+Type of the surface, delta, moneyness etc.","path":"lib/Quant/Framework/VolSurface.pm","position":129,"original_position":129,"commit_id":"f4bdb240d5b7ed5d644d3539cc0d9b032bea2da9","original_commit_id":"f4bdb240d5b7ed5d644d3539cc0d9b032bea2da9","user":{"login":"mm-binary","id":9294049,"avatar_url":"https://avatars.githubusercontent.com/u/9294049?v=3","gravatar_id":"","url":"https://api.github.com/users/mm-binary","html_url":"https://github.com/mm-binary","followers_url":"https://api.github.com/users/mm-binary/followers","following_url":"https://api.github.com/users/mm-binary/following{/other_user}","gists_url":"https://api.github.com/users/mm-binary/gists{/gist_id}","starred_url":"https://api.github.com/users/mm-binary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mm-binary/subscriptions","organizations_url":"https://api.github.com/users/mm-binary/orgs","repos_url":"https://api.github.com/users/mm-binary/repos","events_url":"https://api.github.com/users/mm-binary/events{/privacy}","received_events_url":"https://api.github.com/users/mm-binary/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-05-26T07:13:09Z","updated_at":"2016-05-26T07:13:09Z","html_url":"https://github.com/binary-com/perl-Quant-Framework/pull/19#discussion_r64700307","pull_request_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/comments/64700307"},"html":{"href":"https://github.com/binary-com/perl-Quant-Framework/pull/19#discussion_r64700307"},"pull_request":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19","id":69620332,"html_url":"https://github.com/binary-com/perl-Quant-Framework/pull/19","diff_url":"https://github.com/binary-com/perl-Quant-Framework/pull/19.diff","patch_url":"https://github.com/binary-com/perl-Quant-Framework/pull/19.patch","issue_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues/19","number":19,"state":"open","locked":false,"title":"modules initially moved from internal code","user":{"login":"mm-binary","id":9294049,"avatar_url":"https://avatars.githubusercontent.com/u/9294049?v=3","gravatar_id":"","url":"https://api.github.com/users/mm-binary","html_url":"https://github.com/mm-binary","followers_url":"https://api.github.com/users/mm-binary/followers","following_url":"https://api.github.com/users/mm-binary/following{/other_user}","gists_url":"https://api.github.com/users/mm-binary/gists{/gist_id}","starred_url":"https://api.github.com/users/mm-binary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mm-binary/subscriptions","organizations_url":"https://api.github.com/users/mm-binary/orgs","repos_url":"https://api.github.com/users/mm-binary/repos","events_url":"https://api.github.com/users/mm-binary/events{/privacy}","received_events_url":"https://api.github.com/users/mm-binary/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-11T06:21:24Z","updated_at":"2016-05-26T07:13:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3eda2d0fdce53f728f391c13d7c2bbc42006c369","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19/commits","review_comments_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19/comments","review_comment_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues/19/comments","statuses_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/statuses/f4bdb240d5b7ed5d644d3539cc0d9b032bea2da9","head":{"label":"mm-binary:mm/vol_surface","ref":"mm/vol_surface","sha":"f4bdb240d5b7ed5d644d3539cc0d9b032bea2da9","user":{"login":"mm-binary","id":9294049,"avatar_url":"https://avatars.githubusercontent.com/u/9294049?v=3","gravatar_id":"","url":"https://api.github.com/users/mm-binary","html_url":"https://github.com/mm-binary","followers_url":"https://api.github.com/users/mm-binary/followers","following_url":"https://api.github.com/users/mm-binary/following{/other_user}","gists_url":"https://api.github.com/users/mm-binary/gists{/gist_id}","starred_url":"https://api.github.com/users/mm-binary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mm-binary/subscriptions","organizations_url":"https://api.github.com/users/mm-binary/orgs","repos_url":"https://api.github.com/users/mm-binary/repos","events_url":"https://api.github.com/users/mm-binary/events{/privacy}","received_events_url":"https://api.github.com/users/mm-binary/received_events","type":"User","site_admin":false},"repo":{"id":50819638,"name":"perl-Quant-Framework","full_name":"mm-binary/perl-Quant-Framework","owner":{"login":"mm-binary","id":9294049,"avatar_url":"https://avatars.githubusercontent.com/u/9294049?v=3","gravatar_id":"","url":"https://api.github.com/users/mm-binary","html_url":"https://github.com/mm-binary","followers_url":"https://api.github.com/users/mm-binary/followers","following_url":"https://api.github.com/users/mm-binary/following{/other_user}","gists_url":"https://api.github.com/users/mm-binary/gists{/gist_id}","starred_url":"https://api.github.com/users/mm-binary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mm-binary/subscriptions","organizations_url":"https://api.github.com/users/mm-binary/orgs","repos_url":"https://api.github.com/users/mm-binary/repos","events_url":"https://api.github.com/users/mm-binary/events{/privacy}","received_events_url":"https://api.github.com/users/mm-binary/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mm-binary/perl-Quant-Framework","description":"A framework of objects upon which to build Financial Quantitative Analysis code","fork":true,"url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework","forks_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/forks","keys_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/teams","hooks_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/hooks","issue_events_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/issues/events{/number}","events_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/events","assignees_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/assignees{/user}","branches_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/branches{/branch}","tags_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/tags","blobs_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/statuses/{sha}","languages_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/languages","stargazers_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/stargazers","contributors_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/contributors","subscribers_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/subscribers","subscription_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/subscription","commits_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/contents/{+path}","compare_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/merges","archive_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/downloads","issues_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/issues{/number}","pulls_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/pulls{/number}","milestones_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/milestones{/number}","notifications_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/labels{/name}","releases_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/releases{/id}","deployments_url":"https://api.github.com/repos/mm-binary/perl-Quant-Framework/deployments","created_at":"2016-02-01T06:36:04Z","updated_at":"2016-02-26T08:47:59Z","pushed_at":"2016-05-19T07:48:57Z","git_url":"git://github.com/mm-binary/perl-Quant-Framework.git","ssh_url":"git@github.com:mm-binary/perl-Quant-Framework.git","clone_url":"https://github.com/mm-binary/perl-Quant-Framework.git","svn_url":"https://github.com/mm-binary/perl-Quant-Framework","homepage":null,"size":246,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"binary-com:master","ref":"master","sha":"70b4b40ab8b76c656cbc4c4acc1bc5dbb378ee4d","user":{"login":"binary-com","id":7437559,"avatar_url":"https://avatars.githubusercontent.com/u/7437559?v=3","gravatar_id":"","url":"https://api.github.com/users/binary-com","html_url":"https://github.com/binary-com","followers_url":"https://api.github.com/users/binary-com/followers","following_url":"https://api.github.com/users/binary-com/following{/other_user}","gists_url":"https://api.github.com/users/binary-com/gists{/gist_id}","starred_url":"https://api.github.com/users/binary-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary-com/subscriptions","organizations_url":"https://api.github.com/users/binary-com/orgs","repos_url":"https://api.github.com/users/binary-com/repos","events_url":"https://api.github.com/users/binary-com/events{/privacy}","received_events_url":"https://api.github.com/users/binary-com/received_events","type":"Organization","site_admin":false},"repo":{"id":50404733,"name":"perl-Quant-Framework","full_name":"binary-com/perl-Quant-Framework","owner":{"login":"binary-com","id":7437559,"avatar_url":"https://avatars.githubusercontent.com/u/7437559?v=3","gravatar_id":"","url":"https://api.github.com/users/binary-com","html_url":"https://github.com/binary-com","followers_url":"https://api.github.com/users/binary-com/followers","following_url":"https://api.github.com/users/binary-com/following{/other_user}","gists_url":"https://api.github.com/users/binary-com/gists{/gist_id}","starred_url":"https://api.github.com/users/binary-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary-com/subscriptions","organizations_url":"https://api.github.com/users/binary-com/orgs","repos_url":"https://api.github.com/users/binary-com/repos","events_url":"https://api.github.com/users/binary-com/events{/privacy}","received_events_url":"https://api.github.com/users/binary-com/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/binary-com/perl-Quant-Framework","description":"A framework of objects upon which to build Financial Quantitative Analysis code","fork":false,"url":"https://api.github.com/repos/binary-com/perl-Quant-Framework","forks_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/forks","keys_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/teams","hooks_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/hooks","issue_events_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues/events{/number}","events_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/events","assignees_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/assignees{/user}","branches_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/branches{/branch}","tags_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/tags","blobs_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/statuses/{sha}","languages_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/languages","stargazers_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/stargazers","contributors_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/contributors","subscribers_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/subscribers","subscription_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/subscription","commits_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/contents/{+path}","compare_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/merges","archive_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/downloads","issues_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues{/number}","pulls_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls{/number}","milestones_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/milestones{/number}","notifications_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/labels{/name}","releases_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/releases{/id}","deployments_url":"https://api.github.com/repos/binary-com/perl-Quant-Framework/deployments","created_at":"2016-01-26T05:05:38Z","updated_at":"2016-03-24T01:59:42Z","pushed_at":"2016-05-26T00:42:17Z","git_url":"git://github.com/binary-com/perl-Quant-Framework.git","ssh_url":"git@github.com:binary-com/perl-Quant-Framework.git","clone_url":"https://github.com/binary-com/perl-Quant-Framework.git","svn_url":"https://github.com/binary-com/perl-Quant-Framework","homepage":null,"size":274,"stargazers_count":2,"watchers_count":2,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19"},"html":{"href":"https://github.com/binary-com/perl-Quant-Framework/pull/19"},"issue":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues/19"},"comments":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/binary-com/perl-Quant-Framework/statuses/f4bdb240d5b7ed5d644d3539cc0d9b032bea2da9"}}}}
{"actor":{"display_login":"mm-binary"}}