{"action":"created","issue":{"url":"https://api.github.com/repos/iminuit/iminuit/issues/253","repository_url":"https://api.github.com/repos/iminuit/iminuit","labels_url":"https://api.github.com/repos/iminuit/iminuit/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/iminuit/iminuit/issues/253/comments","events_url":"https://api.github.com/repos/iminuit/iminuit/issues/253/events","html_url":"https://github.com/iminuit/iminuit/issues/253","id":336565073,"node_id":"MDU6SXNzdWUzMzY1NjUwNzM=","number":253,"title":"Add option to store parameter trace?","user":{"login":"cdeil","id":852409,"node_id":"MDQ6VXNlcjg1MjQwOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/852409?v=4","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"labels":[{"id":22543727,"node_id":"MDU6TGFiZWwyMjU0MzcyNw==","url":"https://api.github.com/repos/iminuit/iminuit/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/iminuit/iminuit/milestones/1","html_url":"https://github.com/iminuit/iminuit/milestone/1","labels_url":"https://api.github.com/repos/iminuit/iminuit/milestones/1/labels","id":232773,"node_id":"MDk6TWlsZXN0b25lMjMyNzcz","number":1,"title":"wish list","description":"","creator":{"login":"piti118","id":591316,"node_id":"MDQ6VXNlcjU5MTMxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/591316?v=4","gravatar_id":"","url":"https://api.github.com/users/piti118","html_url":"https://github.com/piti118","followers_url":"https://api.github.com/users/piti118/followers","following_url":"https://api.github.com/users/piti118/following{/other_user}","gists_url":"https://api.github.com/users/piti118/gists{/gist_id}","starred_url":"https://api.github.com/users/piti118/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piti118/subscriptions","organizations_url":"https://api.github.com/users/piti118/orgs","repos_url":"https://api.github.com/users/piti118/repos","events_url":"https://api.github.com/users/piti118/events{/privacy}","received_events_url":"https://api.github.com/users/piti118/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":11,"state":"open","created_at":"2012-12-19T20:48:39Z","updated_at":"2018-06-28T10:32:12Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-06-28T10:32:12Z","updated_at":"2018-06-28T10:40:07Z","closed_at":null,"author_association":"MEMBER","body":"Should we add an option in Minuit to store a trace with the parameters that were made in the function calls?\r\n\r\nI think it could be useful, especially when the minimisation fails for debugging. Given that it's cheap and simple to store, it could even be on by default?\r\n\r\nNote that e.g. samplers store this, although of course there it's the key result, whereas here it's mostly useful for debugging non-converging fits, or performance issues with a given function:\r\nhttp://dfm.io/emcee/current/api/#emcee.EnsembleSampler.flatchain\r\n\r\nOne question is whether it should be per Minuit instance or per migrad etc function call, i.e. when to clear the trace.\r\n\r\nI'm not sure if we should add this, especially because different users want to clear the trace at different times and we don't want a complex API for this. An alternative could be to give a docs example showing users how to store this themselves. This is done by @HDembinski in #252 , although the current example is non-optimal, because it contains an unused class-level `trace=[]`, then really using instance-level `trace` attribute below. IMO either instance-level, or global variables should be used, created directly before the Minuit creation or migrad / minos / ... call one wants to trace.\r\n"},"comment":{"url":"https://api.github.com/repos/iminuit/iminuit/issues/comments/400992376","html_url":"https://github.com/iminuit/iminuit/issues/253#issuecomment-400992376","issue_url":"https://api.github.com/repos/iminuit/iminuit/issues/253","id":400992376,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDk5MjM3Ng==","user":{"login":"HDembinski","id":2631586,"node_id":"MDQ6VXNlcjI2MzE1ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2631586?v=4","gravatar_id":"","url":"https://api.github.com/users/HDembinski","html_url":"https://github.com/HDembinski","followers_url":"https://api.github.com/users/HDembinski/followers","following_url":"https://api.github.com/users/HDembinski/following{/other_user}","gists_url":"https://api.github.com/users/HDembinski/gists{/gist_id}","starred_url":"https://api.github.com/users/HDembinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HDembinski/subscriptions","organizations_url":"https://api.github.com/users/HDembinski/orgs","repos_url":"https://api.github.com/users/HDembinski/repos","events_url":"https://api.github.com/users/HDembinski/events{/privacy}","received_events_url":"https://api.github.com/users/HDembinski/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T10:40:07Z","updated_at":"2018-06-28T10:40:07Z","author_association":"MEMBER","body":"@cdeil I am against adding support for this in iminuit. Writing a wrapper to trace the calls is super trivial in Python.\r\n\r\n>This is done by @HDembinski in #252 , although the current example is non-optimal, because it contains an unused class-level trace=[], then really using instance-level trace attribute below. IMO either instance-level, or global variables should be used, created directly before the Minuit creation or migrad / minos / ... call one wants to trace.\r\n\r\nWhy do you say the class-level trace is unused? Sure it is used.\r\n\r\n```\r\nclass A:\r\n    trace = []\r\n    def __call__(self, x):\r\n          self.trace.append(x)\r\n\r\nassert A.trace == []\r\na = A()\r\na(1)\r\nassert a.trace == [1]\r\nassert A.trace == [1]\r\n```\r\nThis is, in fact, a common bug for new Python users, because people think `A.trace` is instance-level."}}
{"actor":{"display_login":"HDembinski"}}