{"action":"created","comment":{"url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments/186236736","pull_request_review_id":117786007,"id":186236736,"diff_hunk":"@@ -147,34 +151,44 @@ void Millard2012EquilibriumMuscle::extendFinalizeFromProperties()\n     fpeCurve.ensureCurveUpToDate();\n     fseCurve.ensureCurveUpToDate();\n \n-    // Set properties of pennation model subcomponent. Values of\n-    // optimal_fiber_length, pennation_angle_at_optimal, and\n-    // maximum_pennation_angle are checked by\n-    // MuscleFixedWidthPennationModel::extendFinalizeFromProperties().\n+    // Propagate properties down to pennation model subcomponent. If any of the\n+    // new property values are invalid, restore the subcomponent's current\n+    // property values (to avoid throwing again when the subcomponent's\n+    // extendFinalizeFromProperties() method is called directly) and then\n+    // re-throw the exception thrown by the subcomponent.\n     auto& penMdl =\n         updMemberSubcomponent<MuscleFixedWidthPennationModel>(penMdlIdx);\n+    MuscleFixedWidthPennationModel* penMdlCopy = penMdl.clone();","path":"OpenSim/Actuators/Millard2012EquilibriumMuscle.cpp","position":46,"original_position":46,"commit_id":"79ff7d329d004aa79539a1403a48dbdcd7ae77c3","original_commit_id":"79ff7d329d004aa79539a1403a48dbdcd7ae77c3","user":{"login":"tkuchida","id":4203505,"avatar_url":"https://avatars0.githubusercontent.com/u/4203505?v=4","gravatar_id":"","url":"https://api.github.com/users/tkuchida","html_url":"https://github.com/tkuchida","followers_url":"https://api.github.com/users/tkuchida/followers","following_url":"https://api.github.com/users/tkuchida/following{/other_user}","gists_url":"https://api.github.com/users/tkuchida/gists{/gist_id}","starred_url":"https://api.github.com/users/tkuchida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkuchida/subscriptions","organizations_url":"https://api.github.com/users/tkuchida/orgs","repos_url":"https://api.github.com/users/tkuchida/repos","events_url":"https://api.github.com/users/tkuchida/events{/privacy}","received_events_url":"https://api.github.com/users/tkuchida/received_events","type":"User","site_admin":false},"body":"Thanks @chrisdembia. I guess I misinterpreted Ajay's instructions. I'll change to copy constructor.","created_at":"2018-05-04T22:38:09Z","updated_at":"2018-05-04T22:38:09Z","html_url":"https://github.com/opensim-org/opensim-core/pull/2163#discussion_r186236736","pull_request_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments/186236736"},"html":{"href":"https://github.com/opensim-org/opensim-core/pull/2163#discussion_r186236736"},"pull_request":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163"}},"in_reply_to_id":186234316},"pull_request":{"url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163","id":185324175,"html_url":"https://github.com/opensim-org/opensim-core/pull/2163","diff_url":"https://github.com/opensim-org/opensim-core/pull/2163.diff","patch_url":"https://github.com/opensim-org/opensim-core/pull/2163.patch","issue_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/2163","number":2163,"state":"open","locked":false,"title":"Prevent repeated throws from subcomponents when invalid Muscle properties are set","user":{"login":"tkuchida","id":4203505,"avatar_url":"https://avatars0.githubusercontent.com/u/4203505?v=4","gravatar_id":"","url":"https://api.github.com/users/tkuchida","html_url":"https://github.com/tkuchida","followers_url":"https://api.github.com/users/tkuchida/followers","following_url":"https://api.github.com/users/tkuchida/following{/other_user}","gists_url":"https://api.github.com/users/tkuchida/gists{/gist_id}","starred_url":"https://api.github.com/users/tkuchida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkuchida/subscriptions","organizations_url":"https://api.github.com/users/tkuchida/orgs","repos_url":"https://api.github.com/users/tkuchida/repos","events_url":"https://api.github.com/users/tkuchida/events{/privacy}","received_events_url":"https://api.github.com/users/tkuchida/received_events","type":"User","site_admin":false},"body":"Fixes #2106. Redo of PR #2161 using different design.\r\n\r\n### Brief summary of changes\r\nAffects `Thelen2003Muscle` and `Millard2012EquilibriumMuscle`, each of which has two subcomponents: `MuscleFixedWidthPennationModel` and `MuscleFirstOrderActivationDynamicModel`.\r\n- Muscles propagate their properties down to their subcomponents and call `finalizeFromProperties()` on each subcomponent; if an exception is thrown, the Muscle restores the subcomponent's properties to their previous (though now out-of-sync) values and re-throws the exception. Underlying issue noted in #2162 for post-4.0.\r\n- Replaced property checks in subcomponents with `OPENSIM_THROW_IF_FRMOBJ` macro that throws only `InvalidPropertyValue` so that the Muscles can catch this exception (rather than potentially catching and misinterpreting a SimTK exception caught with `SimTK::Exception::Base`). Updated corresponding tests.\r\n- Added informative messages when throwing `InvalidPropertyValue` exception.\r\n- Fixed inconsistency in Millard2012EquilibriumMuscle property checking.\r\n\r\n### Testing I've completed\r\nAdded tests to testMuscles. All tests pass locally.\r\n\r\n### Looking for feedback on...\r\n\r\n### CHANGELOG.md (choose one)\r\n\r\n- no need to update because... fixes MCI-related bug.\r\n- updated...\r\n\r\nThe Doxygen for this PR can be viewed at http://myosin.sourceforge.net/?C=N;O=D; click the folder whose name is this PR's number.\r\n","created_at":"2018-05-02T03:01:23Z","updated_at":"2018-05-04T22:38:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f08ecc25aef5562c0be17fd3dacb9bde03f78fde","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163/commits","review_comments_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163/comments","review_comment_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/2163/comments","statuses_url":"https://api.github.com/repos/opensim-org/opensim-core/statuses/79ff7d329d004aa79539a1403a48dbdcd7ae77c3","head":{"label":"opensim-org:tkuchida-fix2106v2","ref":"tkuchida-fix2106v2","sha":"79ff7d329d004aa79539a1403a48dbdcd7ae77c3","user":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars0.githubusercontent.com/u/4370782?v=4","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"repo":{"id":20775600,"name":"opensim-core","full_name":"opensim-org/opensim-core","owner":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars0.githubusercontent.com/u/4370782?v=4","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opensim-org/opensim-core","description":"SimTK OpenSim 4.0 C++ libraries and command-line applications, and Java/Python wrapping.","fork":false,"url":"https://api.github.com/repos/opensim-org/opensim-core","forks_url":"https://api.github.com/repos/opensim-org/opensim-core/forks","keys_url":"https://api.github.com/repos/opensim-org/opensim-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opensim-org/opensim-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opensim-org/opensim-core/teams","hooks_url":"https://api.github.com/repos/opensim-org/opensim-core/hooks","issue_events_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/events{/number}","events_url":"https://api.github.com/repos/opensim-org/opensim-core/events","assignees_url":"https://api.github.com/repos/opensim-org/opensim-core/assignees{/user}","branches_url":"https://api.github.com/repos/opensim-org/opensim-core/branches{/branch}","tags_url":"https://api.github.com/repos/opensim-org/opensim-core/tags","blobs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opensim-org/opensim-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/opensim-org/opensim-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opensim-org/opensim-core/statuses/{sha}","languages_url":"https://api.github.com/repos/opensim-org/opensim-core/languages","stargazers_url":"https://api.github.com/repos/opensim-org/opensim-core/stargazers","contributors_url":"https://api.github.com/repos/opensim-org/opensim-core/contributors","subscribers_url":"https://api.github.com/repos/opensim-org/opensim-core/subscribers","subscription_url":"https://api.github.com/repos/opensim-org/opensim-core/subscription","commits_url":"https://api.github.com/repos/opensim-org/opensim-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/opensim-org/opensim-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/opensim-org/opensim-core/contents/{+path}","compare_url":"https://api.github.com/repos/opensim-org/opensim-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opensim-org/opensim-core/merges","archive_url":"https://api.github.com/repos/opensim-org/opensim-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opensim-org/opensim-core/downloads","issues_url":"https://api.github.com/repos/opensim-org/opensim-core/issues{/number}","pulls_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls{/number}","milestones_url":"https://api.github.com/repos/opensim-org/opensim-core/milestones{/number}","notifications_url":"https://api.github.com/repos/opensim-org/opensim-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/labels{/name}","releases_url":"https://api.github.com/repos/opensim-org/opensim-core/releases{/id}","deployments_url":"https://api.github.com/repos/opensim-org/opensim-core/deployments","created_at":"2014-06-12T16:57:56Z","updated_at":"2018-05-04T21:44:44Z","pushed_at":"2018-05-04T22:06:19Z","git_url":"git://github.com/opensim-org/opensim-core.git","ssh_url":"git@github.com:opensim-org/opensim-core.git","clone_url":"https://github.com/opensim-org/opensim-core.git","svn_url":"https://github.com/opensim-org/opensim-core","homepage":"https://opensim.stanford.edu","size":149137,"stargazers_count":133,"watchers_count":133,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"archived":false,"open_issues_count":478,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":95,"open_issues":478,"watchers":133,"default_branch":"master"}},"base":{"label":"opensim-org:master","ref":"master","sha":"bca6b8b7494927acba2aede08359a0489fa62875","user":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars0.githubusercontent.com/u/4370782?v=4","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"repo":{"id":20775600,"name":"opensim-core","full_name":"opensim-org/opensim-core","owner":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars0.githubusercontent.com/u/4370782?v=4","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opensim-org/opensim-core","description":"SimTK OpenSim 4.0 C++ libraries and command-line applications, and Java/Python wrapping.","fork":false,"url":"https://api.github.com/repos/opensim-org/opensim-core","forks_url":"https://api.github.com/repos/opensim-org/opensim-core/forks","keys_url":"https://api.github.com/repos/opensim-org/opensim-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opensim-org/opensim-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opensim-org/opensim-core/teams","hooks_url":"https://api.github.com/repos/opensim-org/opensim-core/hooks","issue_events_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/events{/number}","events_url":"https://api.github.com/repos/opensim-org/opensim-core/events","assignees_url":"https://api.github.com/repos/opensim-org/opensim-core/assignees{/user}","branches_url":"https://api.github.com/repos/opensim-org/opensim-core/branches{/branch}","tags_url":"https://api.github.com/repos/opensim-org/opensim-core/tags","blobs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opensim-org/opensim-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/opensim-org/opensim-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opensim-org/opensim-core/statuses/{sha}","languages_url":"https://api.github.com/repos/opensim-org/opensim-core/languages","stargazers_url":"https://api.github.com/repos/opensim-org/opensim-core/stargazers","contributors_url":"https://api.github.com/repos/opensim-org/opensim-core/contributors","subscribers_url":"https://api.github.com/repos/opensim-org/opensim-core/subscribers","subscription_url":"https://api.github.com/repos/opensim-org/opensim-core/subscription","commits_url":"https://api.github.com/repos/opensim-org/opensim-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/opensim-org/opensim-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/opensim-org/opensim-core/contents/{+path}","compare_url":"https://api.github.com/repos/opensim-org/opensim-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opensim-org/opensim-core/merges","archive_url":"https://api.github.com/repos/opensim-org/opensim-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opensim-org/opensim-core/downloads","issues_url":"https://api.github.com/repos/opensim-org/opensim-core/issues{/number}","pulls_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls{/number}","milestones_url":"https://api.github.com/repos/opensim-org/opensim-core/milestones{/number}","notifications_url":"https://api.github.com/repos/opensim-org/opensim-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/labels{/name}","releases_url":"https://api.github.com/repos/opensim-org/opensim-core/releases{/id}","deployments_url":"https://api.github.com/repos/opensim-org/opensim-core/deployments","created_at":"2014-06-12T16:57:56Z","updated_at":"2018-05-04T21:44:44Z","pushed_at":"2018-05-04T22:06:19Z","git_url":"git://github.com/opensim-org/opensim-core.git","ssh_url":"git@github.com:opensim-org/opensim-core.git","clone_url":"https://github.com/opensim-org/opensim-core.git","svn_url":"https://github.com/opensim-org/opensim-core","homepage":"https://opensim.stanford.edu","size":149137,"stargazers_count":133,"watchers_count":133,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"archived":false,"open_issues_count":478,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":95,"open_issues":478,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163"},"html":{"href":"https://github.com/opensim-org/opensim-core/pull/2163"},"issue":{"href":"https://api.github.com/repos/opensim-org/opensim-core/issues/2163"},"comments":{"href":"https://api.github.com/repos/opensim-org/opensim-core/issues/2163/comments"},"review_comments":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163/comments"},"review_comment":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/2163/commits"},"statuses":{"href":"https://api.github.com/repos/opensim-org/opensim-core/statuses/79ff7d329d004aa79539a1403a48dbdcd7ae77c3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tkuchida"}}