{"action":"created","issue":{"url":"https://api.github.com/repos/stevengj/meep/issues/319","repository_url":"https://api.github.com/repos/stevengj/meep","labels_url":"https://api.github.com/repos/stevengj/meep/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/stevengj/meep/issues/319/comments","events_url":"https://api.github.com/repos/stevengj/meep/issues/319/events","html_url":"https://github.com/stevengj/meep/issues/319","id":320127598,"number":319,"title":"validity check for the materials library","user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars3.githubusercontent.com/u/2913679?v=4","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ChristopherHogan","id":14114829,"avatar_url":"https://avatars3.githubusercontent.com/u/14114829?v=4","gravatar_id":"","url":"https://api.github.com/users/ChristopherHogan","html_url":"https://github.com/ChristopherHogan","followers_url":"https://api.github.com/users/ChristopherHogan/followers","following_url":"https://api.github.com/users/ChristopherHogan/following{/other_user}","gists_url":"https://api.github.com/users/ChristopherHogan/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopherHogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopherHogan/subscriptions","organizations_url":"https://api.github.com/users/ChristopherHogan/orgs","repos_url":"https://api.github.com/users/ChristopherHogan/repos","events_url":"https://api.github.com/users/ChristopherHogan/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopherHogan/received_events","type":"User","site_admin":false},"assignees":[{"login":"ChristopherHogan","id":14114829,"avatar_url":"https://avatars3.githubusercontent.com/u/14114829?v=4","gravatar_id":"","url":"https://api.github.com/users/ChristopherHogan","html_url":"https://github.com/ChristopherHogan","followers_url":"https://api.github.com/users/ChristopherHogan/followers","following_url":"https://api.github.com/users/ChristopherHogan/following{/other_user}","gists_url":"https://api.github.com/users/ChristopherHogan/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopherHogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopherHogan/subscriptions","organizations_url":"https://api.github.com/users/ChristopherHogan/orgs","repos_url":"https://api.github.com/users/ChristopherHogan/repos","events_url":"https://api.github.com/users/ChristopherHogan/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopherHogan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-05-04T01:06:07Z","updated_at":"2018-05-08T18:37:31Z","closed_at":null,"author_association":"OWNER","body":"Since the material fits are only valid in given range of wavelengths (and assume a particular distance unit), it would be good to print a warning if the user attempts use them outside this range.   To do this, we could:\r\n\r\n1. Add an optional field to the Python `Medium` data structure (not sent to C++) which indicates a range of valid frequencies.  By default, this would be None, but the materials library would set it.\r\n\r\n2. Before the simulation runs, the Python would call a `simulation.check_material_frequencies` function that would print a warning if any source frequency (± bandwidth) or DFT frequency in the simulation falls outside the valid frequencies for any of the materials in the geometry or extra_materials list."},"comment":{"url":"https://api.github.com/repos/stevengj/meep/issues/comments/387500662","html_url":"https://github.com/stevengj/meep/issues/319#issuecomment-387500662","issue_url":"https://api.github.com/repos/stevengj/meep/issues/319","id":387500662,"user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars3.githubusercontent.com/u/2913679?v=4","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T18:37:30Z","updated_at":"2018-05-08T18:37:30Z","author_association":"OWNER","body":"I would suggest starting with a method `valid_material_frequencies()` that returns a `(freq_min, freq_max)` that works for all of the materials.  This is just the intersection of `(0, Inf)` with that of all of the materials: `freq_min` is the *maximum* of all the frequency minimums (or 0 if no materials have a frequency range) and `freq_max` is the *minimum* of all the maximums (or Inf if none).\r\n\r\nThen, once you have this range, you can loop over the sources etcetera to check that they are within the range.   This way you only have to check each source once, not once per material.\r\n\r\nI wouldn't worry about custom sources."}}
{"actor":{"display_login":"stevengj"}}