{"action":"opened","issue":{"url":"https://api.github.com/repos/FilipDominec/python-meep-utils/issues/2","repository_url":"https://api.github.com/repos/FilipDominec/python-meep-utils","labels_url":"https://api.github.com/repos/FilipDominec/python-meep-utils/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/FilipDominec/python-meep-utils/issues/2/comments","events_url":"https://api.github.com/repos/FilipDominec/python-meep-utils/issues/2/events","html_url":"https://github.com/FilipDominec/python-meep-utils/issues/2","id":141230589,"number":2,"title":"passing params on command line","user":{"login":"benjamincensier","id":10221522,"avatar_url":"https://avatars.githubusercontent.com/u/10221522?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamincensier","html_url":"https://github.com/benjamincensier","followers_url":"https://api.github.com/users/benjamincensier/followers","following_url":"https://api.github.com/users/benjamincensier/following{/other_user}","gists_url":"https://api.github.com/users/benjamincensier/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamincensier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamincensier/subscriptions","organizations_url":"https://api.github.com/users/benjamincensier/orgs","repos_url":"https://api.github.com/users/benjamincensier/repos","events_url":"https://api.github.com/users/benjamincensier/events{/privacy}","received_events_url":"https://api.github.com/users/benjamincensier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-16T10:26:49Z","updated_at":"2016-03-16T10:26:49Z","closed_at":null,"body":"Hello,\r\n\r\nCongrats for your work on this!\r\n\r\nI'm trying to use `cylindrical_cavity.py` as a starting point for a simulation.\r\nI ran the corresponding example \"ringdown_cylindrical_cavity\" with the `batch.sh` script, and it seems to do fine.\r\nThere is however this error message:\r\n\r\n```\r\nFile \"../cylindrical_cavity.py\", line 14, in <module>\r\n    sim_param, model_param = meep_utils.process_param(sys.argv[1:])\r\nValueError: need more than 0 values to unpack\r\n```\r\ndue to the fact that the python script is called without argument I presume. Anyway, I get some results.\r\n\r\nNow when I take the `cylindrical_cavity.py` script, and try to run it on the command line without argument, I have the same error message, and no output data at all.\r\nIf I try to pass some argument on the command line, like `./cylindrical_cavity X=1c Y=1G` (X and Y being some string, one of my question is actually very basic: where do I find a parameter list?):\r\n\r\n- if I pass one argument, I get: \r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./cylindrical_cavity.py\", line 14, in <module>\r\n    sim_param, model_param = meep_utils.process_param(sys.argv[1:])\r\nValueError: need more than 1 value to unpack\r\n```\r\n\r\n- if I pass 2 arguments, I get:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./cylindrical_cavity.py\", line 51, in <module>\r\n    model = HollowCyl_model(**model_param)\r\nTypeError: type object argument after ** must be a mapping, not str\r\n```\r\n\r\nI don't understand those errors, neither am I sure of understanding what the parameters can be and which one are necessary.\r\n\r\nalso, the incriminated line in `cylindrical_cavity.py` is:\r\n\r\n`sim_param, model_param = meep_utils.process_param(sys.argv[1:])`\r\n\r\nand in `meep_utils.py` I see:\r\n\r\n```python\r\ndef process_param(args):#{{{                  %% TODO include this code into Abstr..Model.init()\r\n    \"\"\" Parse command-line parameters and store them as attributes of the model \"\"\"\r\n    model_param = {}\r\n    for namevalue in args:\r\n        name, value = namevalue.split(\"=\")\r\n        model_param[name] = phys_to_float(value)\r\n    return model_param\r\n```\r\n\r\nIsn't it odd that `process_param` returns only one dic, while its call in `cylindrical_cavity.py` requests two dics as outputs ? (sim_param and model_param)\r\n\r\n"}}