{"action":"created","comment":{"url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments/141417782","pull_request_review_id":65628894,"id":141417782,"diff_hunk":"@@ -0,0 +1,124 @@\n+# Copyright 2017 Databricks, Inc.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#   http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+from __future__ import absolute_import, division, print_function\n+\n+from collections import namedtuple\n+from six import with_metaclass\n+\n+from sparkdl.param.converters import SparkDLTypeConverters\n+\n+from ..tests import PythonUnitTestCase\n+\n+\n+class TestGenMeta(type):","path":"python/tests/param/params_test.py","position":null,"original_position":25,"commit_id":"77b39068a4411014908dde271257052228ec06d5","original_commit_id":"f7a7d382c5fd1b8e4aefbd7edc580ca374f106fa","user":{"login":"phi-dbq","id":28275034,"avatar_url":"https://avatars0.githubusercontent.com/u/28275034?v=4","gravatar_id":"","url":"https://api.github.com/users/phi-dbq","html_url":"https://github.com/phi-dbq","followers_url":"https://api.github.com/users/phi-dbq/followers","following_url":"https://api.github.com/users/phi-dbq/following{/other_user}","gists_url":"https://api.github.com/users/phi-dbq/gists{/gist_id}","starred_url":"https://api.github.com/users/phi-dbq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phi-dbq/subscriptions","organizations_url":"https://api.github.com/users/phi-dbq/orgs","repos_url":"https://api.github.com/users/phi-dbq/repos","events_url":"https://api.github.com/users/phi-dbq/events{/privacy}","received_events_url":"https://api.github.com/users/phi-dbq/received_events","type":"User","site_admin":false},"body":"Adding methods to a test class programmatically is a must for our use case. The unit-test framework we use does not have good support for parameterized tests, leaving us no choice but to look externally.\r\n\r\nMeta-classes are a supported feature in python [from Guido's treatise](https://www.python.org/download/releases/2.2.3/descrintro/#metaclasses).\r\nIn fact, we use it already [in this codebase](https://github.com/databricks/spark-deep-learning/blob/master/python/sparkdl/transformers/keras_applications.py#L37).\r\nIt might require some effort to parse, but they are natively supported, making the test infra easier to maintain.\r\n\r\nOn the other hand, using an external project might make code look cleaner, but it might also add considerable maintenance burden to us. Fortunately, the one we found, [parameterized](https://github.com/wolever/parameterized), is an actively maintained small project. ","created_at":"2017-09-27T17:46:27Z","updated_at":"2017-09-27T17:57:53Z","html_url":"https://github.com/databricks/spark-deep-learning/pull/49#discussion_r141417782","pull_request_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments/141417782"},"html":{"href":"https://github.com/databricks/spark-deep-learning/pull/49#discussion_r141417782"},"pull_request":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49"}},"in_reply_to_id":140906965},"pull_request":{"url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49","id":141714901,"html_url":"https://github.com/databricks/spark-deep-learning/pull/49","diff_url":"https://github.com/databricks/spark-deep-learning/pull/49.diff","patch_url":"https://github.com/databricks/spark-deep-learning/pull/49.patch","issue_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/49","number":49,"state":"open","locked":false,"title":"TensorFlow Graph Transformer Part-1: Params and Converters ","user":{"login":"phi-dbq","id":28275034,"avatar_url":"https://avatars0.githubusercontent.com/u/28275034?v=4","gravatar_id":"","url":"https://api.github.com/users/phi-dbq","html_url":"https://github.com/phi-dbq","followers_url":"https://api.github.com/users/phi-dbq/followers","following_url":"https://api.github.com/users/phi-dbq/following{/other_user}","gists_url":"https://api.github.com/users/phi-dbq/gists{/gist_id}","starred_url":"https://api.github.com/users/phi-dbq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phi-dbq/subscriptions","organizations_url":"https://api.github.com/users/phi-dbq/orgs","repos_url":"https://api.github.com/users/phi-dbq/repos","events_url":"https://api.github.com/users/phi-dbq/events{/privacy}","received_events_url":"https://api.github.com/users/phi-dbq/received_events","type":"User","site_admin":false},"body":"This is the first part of PRs from the [TF Transformer API design POC PR]( https://github.com/databricks/spark-deep-learning/pull/39).\r\n\r\nIt introduces parameters needed for the TFTransformer (minus those for `TFInputGraph`)\r\nand corresponding type converters.","created_at":"2017-09-18T22:02:43Z","updated_at":"2017-09-27T17:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d58083d8674a452837cca96df6e48a9646959b63","assignee":{"login":"sueann","id":4411489,"avatar_url":"https://avatars1.githubusercontent.com/u/4411489?v=4","gravatar_id":"","url":"https://api.github.com/users/sueann","html_url":"https://github.com/sueann","followers_url":"https://api.github.com/users/sueann/followers","following_url":"https://api.github.com/users/sueann/following{/other_user}","gists_url":"https://api.github.com/users/sueann/gists{/gist_id}","starred_url":"https://api.github.com/users/sueann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sueann/subscriptions","organizations_url":"https://api.github.com/users/sueann/orgs","repos_url":"https://api.github.com/users/sueann/repos","events_url":"https://api.github.com/users/sueann/events{/privacy}","received_events_url":"https://api.github.com/users/sueann/received_events","type":"User","site_admin":false},"assignees":[{"login":"sueann","id":4411489,"avatar_url":"https://avatars1.githubusercontent.com/u/4411489?v=4","gravatar_id":"","url":"https://api.github.com/users/sueann","html_url":"https://github.com/sueann","followers_url":"https://api.github.com/users/sueann/followers","following_url":"https://api.github.com/users/sueann/following{/other_user}","gists_url":"https://api.github.com/users/sueann/gists{/gist_id}","starred_url":"https://api.github.com/users/sueann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sueann/subscriptions","organizations_url":"https://api.github.com/users/sueann/orgs","repos_url":"https://api.github.com/users/sueann/repos","events_url":"https://api.github.com/users/sueann/events{/privacy}","received_events_url":"https://api.github.com/users/sueann/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"sueann","id":4411489,"avatar_url":"https://avatars1.githubusercontent.com/u/4411489?v=4","gravatar_id":"","url":"https://api.github.com/users/sueann","html_url":"https://github.com/sueann","followers_url":"https://api.github.com/users/sueann/followers","following_url":"https://api.github.com/users/sueann/following{/other_user}","gists_url":"https://api.github.com/users/sueann/gists{/gist_id}","starred_url":"https://api.github.com/users/sueann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sueann/subscriptions","organizations_url":"https://api.github.com/users/sueann/orgs","repos_url":"https://api.github.com/users/sueann/repos","events_url":"https://api.github.com/users/sueann/events{/privacy}","received_events_url":"https://api.github.com/users/sueann/received_events","type":"User","site_admin":false},{"login":"thunterdb","id":7594753,"avatar_url":"https://avatars0.githubusercontent.com/u/7594753?v=4","gravatar_id":"","url":"https://api.github.com/users/thunterdb","html_url":"https://github.com/thunterdb","followers_url":"https://api.github.com/users/thunterdb/followers","following_url":"https://api.github.com/users/thunterdb/following{/other_user}","gists_url":"https://api.github.com/users/thunterdb/gists{/gist_id}","starred_url":"https://api.github.com/users/thunterdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thunterdb/subscriptions","organizations_url":"https://api.github.com/users/thunterdb/orgs","repos_url":"https://api.github.com/users/thunterdb/repos","events_url":"https://api.github.com/users/thunterdb/events{/privacy}","received_events_url":"https://api.github.com/users/thunterdb/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49/commits","review_comments_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49/comments","review_comment_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/49/comments","statuses_url":"https://api.github.com/repos/databricks/spark-deep-learning/statuses/77b39068a4411014908dde271257052228ec06d5","head":{"label":"phi-dbq:tf-transformer-part1","ref":"tf-transformer-part1","sha":"77b39068a4411014908dde271257052228ec06d5","user":{"login":"phi-dbq","id":28275034,"avatar_url":"https://avatars0.githubusercontent.com/u/28275034?v=4","gravatar_id":"","url":"https://api.github.com/users/phi-dbq","html_url":"https://github.com/phi-dbq","followers_url":"https://api.github.com/users/phi-dbq/followers","following_url":"https://api.github.com/users/phi-dbq/following{/other_user}","gists_url":"https://api.github.com/users/phi-dbq/gists{/gist_id}","starred_url":"https://api.github.com/users/phi-dbq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phi-dbq/subscriptions","organizations_url":"https://api.github.com/users/phi-dbq/orgs","repos_url":"https://api.github.com/users/phi-dbq/repos","events_url":"https://api.github.com/users/phi-dbq/events{/privacy}","received_events_url":"https://api.github.com/users/phi-dbq/received_events","type":"User","site_admin":false},"repo":{"id":93467330,"name":"spark-deep-learning","full_name":"phi-dbq/spark-deep-learning","owner":{"login":"phi-dbq","id":28275034,"avatar_url":"https://avatars0.githubusercontent.com/u/28275034?v=4","gravatar_id":"","url":"https://api.github.com/users/phi-dbq","html_url":"https://github.com/phi-dbq","followers_url":"https://api.github.com/users/phi-dbq/followers","following_url":"https://api.github.com/users/phi-dbq/following{/other_user}","gists_url":"https://api.github.com/users/phi-dbq/gists{/gist_id}","starred_url":"https://api.github.com/users/phi-dbq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phi-dbq/subscriptions","organizations_url":"https://api.github.com/users/phi-dbq/orgs","repos_url":"https://api.github.com/users/phi-dbq/repos","events_url":"https://api.github.com/users/phi-dbq/events{/privacy}","received_events_url":"https://api.github.com/users/phi-dbq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phi-dbq/spark-deep-learning","description":"Deep Learning Pipelines for Apache Spark","fork":true,"url":"https://api.github.com/repos/phi-dbq/spark-deep-learning","forks_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/forks","keys_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/teams","hooks_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/hooks","issue_events_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/issues/events{/number}","events_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/events","assignees_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/assignees{/user}","branches_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/branches{/branch}","tags_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/tags","blobs_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/statuses/{sha}","languages_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/languages","stargazers_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/stargazers","contributors_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/contributors","subscribers_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/subscribers","subscription_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/subscription","commits_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/contents/{+path}","compare_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/merges","archive_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/downloads","issues_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/issues{/number}","pulls_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/pulls{/number}","milestones_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/milestones{/number}","notifications_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/labels{/name}","releases_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/releases{/id}","deployments_url":"https://api.github.com/repos/phi-dbq/spark-deep-learning/deployments","created_at":"2017-06-06T02:31:46Z","updated_at":"2017-06-06T02:31:48Z","pushed_at":"2017-09-26T18:28:37Z","git_url":"git://github.com/phi-dbq/spark-deep-learning.git","ssh_url":"git@github.com:phi-dbq/spark-deep-learning.git","clone_url":"https://github.com/phi-dbq/spark-deep-learning.git","svn_url":"https://github.com/phi-dbq/spark-deep-learning","homepage":null,"size":3286,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"databricks:master","ref":"master","sha":"3f668d9b4a0aa2ef6fe05df5bf5c1d705cd2530d","user":{"login":"databricks","id":4998052,"avatar_url":"https://avatars2.githubusercontent.com/u/4998052?v=4","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"repo":{"id":92971378,"name":"spark-deep-learning","full_name":"databricks/spark-deep-learning","owner":{"login":"databricks","id":4998052,"avatar_url":"https://avatars2.githubusercontent.com/u/4998052?v=4","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/databricks/spark-deep-learning","description":"Deep Learning Pipelines for Apache Spark","fork":false,"url":"https://api.github.com/repos/databricks/spark-deep-learning","forks_url":"https://api.github.com/repos/databricks/spark-deep-learning/forks","keys_url":"https://api.github.com/repos/databricks/spark-deep-learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/databricks/spark-deep-learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/databricks/spark-deep-learning/teams","hooks_url":"https://api.github.com/repos/databricks/spark-deep-learning/hooks","issue_events_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/events{/number}","events_url":"https://api.github.com/repos/databricks/spark-deep-learning/events","assignees_url":"https://api.github.com/repos/databricks/spark-deep-learning/assignees{/user}","branches_url":"https://api.github.com/repos/databricks/spark-deep-learning/branches{/branch}","tags_url":"https://api.github.com/repos/databricks/spark-deep-learning/tags","blobs_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/databricks/spark-deep-learning/statuses/{sha}","languages_url":"https://api.github.com/repos/databricks/spark-deep-learning/languages","stargazers_url":"https://api.github.com/repos/databricks/spark-deep-learning/stargazers","contributors_url":"https://api.github.com/repos/databricks/spark-deep-learning/contributors","subscribers_url":"https://api.github.com/repos/databricks/spark-deep-learning/subscribers","subscription_url":"https://api.github.com/repos/databricks/spark-deep-learning/subscription","commits_url":"https://api.github.com/repos/databricks/spark-deep-learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/databricks/spark-deep-learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/databricks/spark-deep-learning/contents/{+path}","compare_url":"https://api.github.com/repos/databricks/spark-deep-learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/databricks/spark-deep-learning/merges","archive_url":"https://api.github.com/repos/databricks/spark-deep-learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/databricks/spark-deep-learning/downloads","issues_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues{/number}","pulls_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls{/number}","milestones_url":"https://api.github.com/repos/databricks/spark-deep-learning/milestones{/number}","notifications_url":"https://api.github.com/repos/databricks/spark-deep-learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/databricks/spark-deep-learning/labels{/name}","releases_url":"https://api.github.com/repos/databricks/spark-deep-learning/releases{/id}","deployments_url":"https://api.github.com/repos/databricks/spark-deep-learning/deployments","created_at":"2017-05-31T17:30:28Z","updated_at":"2017-09-27T17:40:26Z","pushed_at":"2017-09-26T18:28:38Z","git_url":"git://github.com/databricks/spark-deep-learning.git","ssh_url":"git@github.com:databricks/spark-deep-learning.git","clone_url":"https://github.com/databricks/spark-deep-learning.git","svn_url":"https://github.com/databricks/spark-deep-learning","homepage":null,"size":3180,"stargazers_count":518,"watchers_count":518,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":105,"mirror_url":null,"open_issues_count":17,"forks":105,"open_issues":17,"watchers":518,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49"},"html":{"href":"https://github.com/databricks/spark-deep-learning/pull/49"},"issue":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/issues/49"},"comments":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/statuses/77b39068a4411014908dde271257052228ec06d5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"phi-dbq"}}