{"action":"created","comment":{"url":"https://api.github.com/repos/suavecode/SUAVE/pulls/comments/24025036","id":24025036,"diff_hunk":"@@ -0,0 +1,123 @@\n+# Tim Momose, December 2014\n+\n+# ----------------------------------------------------------------------\n+#  Imports\n+# ----------------------------------------------------------------------\n+\n+#from SUAVE.Structure import Data, Data_Exception, Data_Warning\n+from purge_files import purge_files\n+\n+def write_run_cases(avl_object):\n+\t\n+\t# unpack avl_inputs\n+\tfiles_path = avl_object.settings.filenames.run_folder\n+\tcases_path = files_path + avl_object.settings.filenames.cases\n+\taircraft   = avl_object.features\n+\tkases      = avl_object.settings.run_cases\n+\t\n+\tbase_case_text = \\\n+'''\n+\n+ ---------------------------------------------\n+ Run case  {0}:   {1}\n+\n+ alpha        ->  alpha       =   {2}\n+ beta         ->  beta        =   {3}\n+ pb/2V        ->  pb/2V       =   0.00000\n+ qc/2V        ->  qc/2V       =   0.00000\n+ rb/2V        ->  rb/2V       =   0.00000\n+{4}\n+\n+ alpha     =   0.00000     deg\n+ beta      =   0.00000     deg\n+ pb/2V     =   0.00000\n+ qc/2V     =   0.00000\n+ rb/2V     =   0.00000\n+ CL        =  0.000000\n+ CDo       =  {5}\n+ bank      =   0.00000     deg\n+ elevation =   0.00000     deg\n+ heading   =   0.00000     deg\n+ Mach      =   {6}\n+ velocity  =   {7}     m/s\n+ density   =   {8}     kg/m^3\n+ grav.acc. =   {9}     m/s^2\n+ turn_rad. =   0.00000     m\n+ load_fac. =   0.00000\n+ X_cg      =   {10}     m\n+ Y_cg      =   {11}     m\n+ Z_cg      =   {12}     m\n+ mass      =   {13}     kg\n+ Ixx       =   {14}     kg-m^2\n+ Iyy       =   {15}     kg-m^2\n+ Izz       =   {16}     kg-m^2\n+ Ixy       =   {17}     kg-m^2\n+ Iyz       =   {18}     kg-m^2\n+ Izx       =   {19}     kg-m^2\n+ visc CL_a =   0.00000\n+ visc CL_u =   0.00000\n+ visc CM_a =   0.00000\n+ visc CM_u =   0.00000\n+\n+'''#{4} is a set of control surface inputs that will vary depending on the control surface configuration\n+\n+\t\n+\t# Open the geometry file after purging if it already exists\n+\tpurge_files([cases_path])\n+\truncases = open(cases_path,'w')\n+\t\n+\ttry:\n+\t\tx_cg = avl_object.features.mass_properties.center_of_gravity[0]\n+\t\ty_cg = avl_object.features.mass_properties.center_of_gravity[1]\n+\t\tz_cg = avl_object.features.mass_properties.center_of_gravity[2]\n+\t\tmass = avl_object.default_case.mass\n+\t\tmoments_of_inertia = aircraft.mass_properties.moments_of_inertia.tensor\n+\t\tIxx  = moments_of_inertia[0][0]\n+\t\tIyy  = moments_of_inertia[1][1]\n+\t\tIzz  = moments_of_inertia[2][2]\n+\t\tIxy  = moments_of_inertia[0][1]\n+\t\tIyz  = moments_of_inertia[1][2]\n+\t\tIzx  = moments_of_inertia[2][0]\n+\t\t\n+\t\tfor case in kases.cases:\n+\t\t\tindex = case.index","path":"trunk/SUAVE/Methods/Aerodynamics/AVL/write_run_cases.py","position":83,"original_position":83,"commit_id":"c520b91ad59380b855acdda70c9d36b8b660994c","original_commit_id":"c520b91ad59380b855acdda70c9d36b8b660994c","user":{"login":"aerialhedgehog","id":4797553,"avatar_url":"https://avatars.githubusercontent.com/u/4797553?v=3","gravatar_id":"","url":"https://api.github.com/users/aerialhedgehog","html_url":"https://github.com/aerialhedgehog","followers_url":"https://api.github.com/users/aerialhedgehog/followers","following_url":"https://api.github.com/users/aerialhedgehog/following{/other_user}","gists_url":"https://api.github.com/users/aerialhedgehog/gists{/gist_id}","starred_url":"https://api.github.com/users/aerialhedgehog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerialhedgehog/subscriptions","organizations_url":"https://api.github.com/users/aerialhedgehog/orgs","repos_url":"https://api.github.com/users/aerialhedgehog/repos","events_url":"https://api.github.com/users/aerialhedgehog/events{/privacy}","received_events_url":"https://api.github.com/users/aerialhedgehog/received_events","type":"User","site_admin":false},"body":"can you use enumerate here?","created_at":"2015-02-03T18:15:33Z","updated_at":"2015-02-03T18:15:33Z","html_url":"https://github.com/suavecode/SUAVE/pull/78#discussion_r24025036","pull_request_url":"https://api.github.com/repos/suavecode/SUAVE/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/suavecode/SUAVE/pulls/comments/24025036"},"html":{"href":"https://github.com/suavecode/SUAVE/pull/78#discussion_r24025036"},"pull_request":{"href":"https://api.github.com/repos/suavecode/SUAVE/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/suavecode/SUAVE/pulls/78","id":28053670,"html_url":"https://github.com/suavecode/SUAVE/pull/78","diff_url":"https://github.com/suavecode/SUAVE/pull/78.diff","patch_url":"https://github.com/suavecode/SUAVE/pull/78.patch","issue_url":"https://api.github.com/repos/suavecode/SUAVE/issues/78","number":78,"state":"open","locked":false,"title":"Feature avl","user":{"login":"tmomose","id":7093436,"avatar_url":"https://avatars.githubusercontent.com/u/7093436?v=3","gravatar_id":"","url":"https://api.github.com/users/tmomose","html_url":"https://github.com/tmomose","followers_url":"https://api.github.com/users/tmomose/followers","following_url":"https://api.github.com/users/tmomose/following{/other_user}","gists_url":"https://api.github.com/users/tmomose/gists{/gist_id}","starred_url":"https://api.github.com/users/tmomose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmomose/subscriptions","organizations_url":"https://api.github.com/users/tmomose/orgs","repos_url":"https://api.github.com/users/tmomose/repos","events_url":"https://api.github.com/users/tmomose/events{/privacy}","received_events_url":"https://api.github.com/users/tmomose/received_events","type":"User","site_admin":false},"body":"New code:\r\n-AVL analysis code (SUAVE.Methods.Aerodynamics.AVL)\r\n-Modified wing geometry code for control surface definition\r\n-Test script (scripts/experimental/test_callable_avl.py)","created_at":"2015-01-26T19:37:52Z","updated_at":"2015-02-03T18:15:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c121a00ef9e1d562eaee0decd91652fd75655cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/suavecode/SUAVE/pulls/78/commits","review_comments_url":"https://api.github.com/repos/suavecode/SUAVE/pulls/78/comments","review_comment_url":"https://api.github.com/repos/suavecode/SUAVE/pulls/comments/{number}","comments_url":"https://api.github.com/repos/suavecode/SUAVE/issues/78/comments","statuses_url":"https://api.github.com/repos/suavecode/SUAVE/statuses/c520b91ad59380b855acdda70c9d36b8b660994c","head":{"label":"suavecode:feature-avl","ref":"feature-avl","sha":"c520b91ad59380b855acdda70c9d36b8b660994c","user":{"login":"suavecode","id":7026233,"avatar_url":"https://avatars.githubusercontent.com/u/7026233?v=3","gravatar_id":"","url":"https://api.github.com/users/suavecode","html_url":"https://github.com/suavecode","followers_url":"https://api.github.com/users/suavecode/followers","following_url":"https://api.github.com/users/suavecode/following{/other_user}","gists_url":"https://api.github.com/users/suavecode/gists{/gist_id}","starred_url":"https://api.github.com/users/suavecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suavecode/subscriptions","organizations_url":"https://api.github.com/users/suavecode/orgs","repos_url":"https://api.github.com/users/suavecode/repos","events_url":"https://api.github.com/users/suavecode/events{/privacy}","received_events_url":"https://api.github.com/users/suavecode/received_events","type":"Organization","site_admin":false},"repo":{"id":17993614,"name":"SUAVE","full_name":"suavecode/SUAVE","owner":{"login":"suavecode","id":7026233,"avatar_url":"https://avatars.githubusercontent.com/u/7026233?v=3","gravatar_id":"","url":"https://api.github.com/users/suavecode","html_url":"https://github.com/suavecode","followers_url":"https://api.github.com/users/suavecode/followers","following_url":"https://api.github.com/users/suavecode/following{/other_user}","gists_url":"https://api.github.com/users/suavecode/gists{/gist_id}","starred_url":"https://api.github.com/users/suavecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suavecode/subscriptions","organizations_url":"https://api.github.com/users/suavecode/orgs","repos_url":"https://api.github.com/users/suavecode/repos","events_url":"https://api.github.com/users/suavecode/events{/privacy}","received_events_url":"https://api.github.com/users/suavecode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/suavecode/SUAVE","description":"An Aircraft Design Toolbox","fork":false,"url":"https://api.github.com/repos/suavecode/SUAVE","forks_url":"https://api.github.com/repos/suavecode/SUAVE/forks","keys_url":"https://api.github.com/repos/suavecode/SUAVE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suavecode/SUAVE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suavecode/SUAVE/teams","hooks_url":"https://api.github.com/repos/suavecode/SUAVE/hooks","issue_events_url":"https://api.github.com/repos/suavecode/SUAVE/issues/events{/number}","events_url":"https://api.github.com/repos/suavecode/SUAVE/events","assignees_url":"https://api.github.com/repos/suavecode/SUAVE/assignees{/user}","branches_url":"https://api.github.com/repos/suavecode/SUAVE/branches{/branch}","tags_url":"https://api.github.com/repos/suavecode/SUAVE/tags","blobs_url":"https://api.github.com/repos/suavecode/SUAVE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suavecode/SUAVE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suavecode/SUAVE/git/refs{/sha}","trees_url":"https://api.github.com/repos/suavecode/SUAVE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suavecode/SUAVE/statuses/{sha}","languages_url":"https://api.github.com/repos/suavecode/SUAVE/languages","stargazers_url":"https://api.github.com/repos/suavecode/SUAVE/stargazers","contributors_url":"https://api.github.com/repos/suavecode/SUAVE/contributors","subscribers_url":"https://api.github.com/repos/suavecode/SUAVE/subscribers","subscription_url":"https://api.github.com/repos/suavecode/SUAVE/subscription","commits_url":"https://api.github.com/repos/suavecode/SUAVE/commits{/sha}","git_commits_url":"https://api.github.com/repos/suavecode/SUAVE/git/commits{/sha}","comments_url":"https://api.github.com/repos/suavecode/SUAVE/comments{/number}","issue_comment_url":"https://api.github.com/repos/suavecode/SUAVE/issues/comments/{number}","contents_url":"https://api.github.com/repos/suavecode/SUAVE/contents/{+path}","compare_url":"https://api.github.com/repos/suavecode/SUAVE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suavecode/SUAVE/merges","archive_url":"https://api.github.com/repos/suavecode/SUAVE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suavecode/SUAVE/downloads","issues_url":"https://api.github.com/repos/suavecode/SUAVE/issues{/number}","pulls_url":"https://api.github.com/repos/suavecode/SUAVE/pulls{/number}","milestones_url":"https://api.github.com/repos/suavecode/SUAVE/milestones{/number}","notifications_url":"https://api.github.com/repos/suavecode/SUAVE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suavecode/SUAVE/labels{/name}","releases_url":"https://api.github.com/repos/suavecode/SUAVE/releases{/id}","created_at":"2014-03-21T20:37:01Z","updated_at":"2015-02-03T08:13:45Z","pushed_at":"2015-02-03T08:13:45Z","git_url":"git://github.com/suavecode/SUAVE.git","ssh_url":"git@github.com:suavecode/SUAVE.git","clone_url":"https://github.com/suavecode/SUAVE.git","svn_url":"https://github.com/suavecode/SUAVE","homepage":null,"size":11009,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":54,"forks":9,"open_issues":54,"watchers":9,"default_branch":"master"}},"base":{"label":"suavecode:master","ref":"master","sha":"1d0c059ea3fd200cd698ae278f9b96e88482d3e2","user":{"login":"suavecode","id":7026233,"avatar_url":"https://avatars.githubusercontent.com/u/7026233?v=3","gravatar_id":"","url":"https://api.github.com/users/suavecode","html_url":"https://github.com/suavecode","followers_url":"https://api.github.com/users/suavecode/followers","following_url":"https://api.github.com/users/suavecode/following{/other_user}","gists_url":"https://api.github.com/users/suavecode/gists{/gist_id}","starred_url":"https://api.github.com/users/suavecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suavecode/subscriptions","organizations_url":"https://api.github.com/users/suavecode/orgs","repos_url":"https://api.github.com/users/suavecode/repos","events_url":"https://api.github.com/users/suavecode/events{/privacy}","received_events_url":"https://api.github.com/users/suavecode/received_events","type":"Organization","site_admin":false},"repo":{"id":17993614,"name":"SUAVE","full_name":"suavecode/SUAVE","owner":{"login":"suavecode","id":7026233,"avatar_url":"https://avatars.githubusercontent.com/u/7026233?v=3","gravatar_id":"","url":"https://api.github.com/users/suavecode","html_url":"https://github.com/suavecode","followers_url":"https://api.github.com/users/suavecode/followers","following_url":"https://api.github.com/users/suavecode/following{/other_user}","gists_url":"https://api.github.com/users/suavecode/gists{/gist_id}","starred_url":"https://api.github.com/users/suavecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suavecode/subscriptions","organizations_url":"https://api.github.com/users/suavecode/orgs","repos_url":"https://api.github.com/users/suavecode/repos","events_url":"https://api.github.com/users/suavecode/events{/privacy}","received_events_url":"https://api.github.com/users/suavecode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/suavecode/SUAVE","description":"An Aircraft Design Toolbox","fork":false,"url":"https://api.github.com/repos/suavecode/SUAVE","forks_url":"https://api.github.com/repos/suavecode/SUAVE/forks","keys_url":"https://api.github.com/repos/suavecode/SUAVE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suavecode/SUAVE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suavecode/SUAVE/teams","hooks_url":"https://api.github.com/repos/suavecode/SUAVE/hooks","issue_events_url":"https://api.github.com/repos/suavecode/SUAVE/issues/events{/number}","events_url":"https://api.github.com/repos/suavecode/SUAVE/events","assignees_url":"https://api.github.com/repos/suavecode/SUAVE/assignees{/user}","branches_url":"https://api.github.com/repos/suavecode/SUAVE/branches{/branch}","tags_url":"https://api.github.com/repos/suavecode/SUAVE/tags","blobs_url":"https://api.github.com/repos/suavecode/SUAVE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suavecode/SUAVE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suavecode/SUAVE/git/refs{/sha}","trees_url":"https://api.github.com/repos/suavecode/SUAVE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suavecode/SUAVE/statuses/{sha}","languages_url":"https://api.github.com/repos/suavecode/SUAVE/languages","stargazers_url":"https://api.github.com/repos/suavecode/SUAVE/stargazers","contributors_url":"https://api.github.com/repos/suavecode/SUAVE/contributors","subscribers_url":"https://api.github.com/repos/suavecode/SUAVE/subscribers","subscription_url":"https://api.github.com/repos/suavecode/SUAVE/subscription","commits_url":"https://api.github.com/repos/suavecode/SUAVE/commits{/sha}","git_commits_url":"https://api.github.com/repos/suavecode/SUAVE/git/commits{/sha}","comments_url":"https://api.github.com/repos/suavecode/SUAVE/comments{/number}","issue_comment_url":"https://api.github.com/repos/suavecode/SUAVE/issues/comments/{number}","contents_url":"https://api.github.com/repos/suavecode/SUAVE/contents/{+path}","compare_url":"https://api.github.com/repos/suavecode/SUAVE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suavecode/SUAVE/merges","archive_url":"https://api.github.com/repos/suavecode/SUAVE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suavecode/SUAVE/downloads","issues_url":"https://api.github.com/repos/suavecode/SUAVE/issues{/number}","pulls_url":"https://api.github.com/repos/suavecode/SUAVE/pulls{/number}","milestones_url":"https://api.github.com/repos/suavecode/SUAVE/milestones{/number}","notifications_url":"https://api.github.com/repos/suavecode/SUAVE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suavecode/SUAVE/labels{/name}","releases_url":"https://api.github.com/repos/suavecode/SUAVE/releases{/id}","created_at":"2014-03-21T20:37:01Z","updated_at":"2015-02-03T08:13:45Z","pushed_at":"2015-02-03T08:13:45Z","git_url":"git://github.com/suavecode/SUAVE.git","ssh_url":"git@github.com:suavecode/SUAVE.git","clone_url":"https://github.com/suavecode/SUAVE.git","svn_url":"https://github.com/suavecode/SUAVE","homepage":null,"size":11009,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":54,"forks":9,"open_issues":54,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/suavecode/SUAVE/pulls/78"},"html":{"href":"https://github.com/suavecode/SUAVE/pull/78"},"issue":{"href":"https://api.github.com/repos/suavecode/SUAVE/issues/78"},"comments":{"href":"https://api.github.com/repos/suavecode/SUAVE/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/suavecode/SUAVE/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/suavecode/SUAVE/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/suavecode/SUAVE/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/suavecode/SUAVE/statuses/c520b91ad59380b855acdda70c9d36b8b660994c"}}}}