{"action":"created","issue":{"url":"https://api.github.com/repos/usgs/geomag-algorithms/issues/16","labels_url":"https://api.github.com/repos/usgs/geomag-algorithms/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/usgs/geomag-algorithms/issues/16/comments","events_url":"https://api.github.com/repos/usgs/geomag-algorithms/issues/16/events","html_url":"https://github.com/usgs/geomag-algorithms/pull/16","id":60385557,"number":16,"title":"Added EdgeFactory, ObservatoryMetadata and their accompanying tests.  Ed...","user":{"login":"hasimpson-usgs","id":4752380,"avatar_url":"https://avatars.githubusercontent.com/u/4752380?v=3","gravatar_id":"","url":"https://api.github.com/users/hasimpson-usgs","html_url":"https://github.com/hasimpson-usgs","followers_url":"https://api.github.com/users/hasimpson-usgs/followers","following_url":"https://api.github.com/users/hasimpson-usgs/following{/other_user}","gists_url":"https://api.github.com/users/hasimpson-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hasimpson-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasimpson-usgs/subscriptions","organizations_url":"https://api.github.com/users/hasimpson-usgs/orgs","repos_url":"https://api.github.com/users/hasimpson-usgs/repos","events_url":"https://api.github.com/users/hasimpson-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/hasimpson-usgs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-09T18:09:15Z","updated_at":"2015-03-11T01:10:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/usgs/geomag-algorithms/pulls/16","html_url":"https://github.com/usgs/geomag-algorithms/pull/16","diff_url":"https://github.com/usgs/geomag-algorithms/pull/16.diff","patch_url":"https://github.com/usgs/geomag-algorithms/pull/16.patch"},"body":"...geFactory only has get_timeseries implemented, put_timeseries will be done later.  ObserveatoryMetadata has the Observatory information hardcoded for now, future implementations will use something more dynamic."},"comment":{"url":"https://api.github.com/repos/usgs/geomag-algorithms/issues/comments/78182237","html_url":"https://github.com/usgs/geomag-algorithms/pull/16#issuecomment-78182237","issue_url":"https://api.github.com/repos/usgs/geomag-algorithms/issues/16","id":78182237,"user":{"login":"jmfee-usgs","id":1717896,"avatar_url":"https://avatars.githubusercontent.com/u/1717896?v=3","gravatar_id":"","url":"https://api.github.com/users/jmfee-usgs","html_url":"https://github.com/jmfee-usgs","followers_url":"https://api.github.com/users/jmfee-usgs/followers","following_url":"https://api.github.com/users/jmfee-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jmfee-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jmfee-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmfee-usgs/subscriptions","organizations_url":"https://api.github.com/users/jmfee-usgs/orgs","repos_url":"https://api.github.com/users/jmfee-usgs/repos","events_url":"https://api.github.com/users/jmfee-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jmfee-usgs/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T01:10:39Z","updated_at":"2015-03-11T01:10:39Z","body":"EdgeFactory\r\n- add an optional observatory metadata parameter to __init__ to allow custom configuration (default `None`), create an instance of ObservatoryMetadata if none provided\r\n- in get_timeseries, only check for a default `channels` value once\r\n- initialize timeseries to be an empty stream and append channels (`timeseries = obspy.core.Stream()`)\r\n- call timeseries.merge before returning stream\r\n- the put_timeseries NotImplementedError should say \"put_timeseries\"\r\n- `get_edge_channel_codes` is not used\r\n- `get_interval_from_edge` is not used\r\n- is `get_channel_code_from_edge` needed? already know channel that was requested.\r\n- is `_get_edge_code_from_channel` needed? appeasr to already be implemented in `_get_edge_channel`.\r\n- is `_get_interval_from_code` needed? already know interval that was requested.\r\n- create a `_set_metadata(stream, observatory, channel, type, interval)` method in EdgeFactory that for now calls ObservatoryMetadata instance.  Update stats on all traces in stream (all for the same channel anyways, but may have gaps).  Also set `channel`, `type`, and `interval`.\r\n- update the existing stats object instead of creating a new stats object based on the existing.\r\n\r\n\r\nEdgeFactory_test\r\n- add methods to test component methods `_get_edge_network`, `_get_edge_station`, `_get_edge_channel`, `_get_edge_location`\r\n- add method to test `_set_metadata`\r\n- remove tests for removed methods from above.\r\n\r\n\r\nObservatoryMetadata\r\n- default metadata should be all caps: `DEFAULT_METADATA`\r\n- update formatting of default\r\n-- opening curly braces on same line as equals or colon\r\n-- closing curly braces on own line\r\n-- continuation lines indented twice\r\n- `channel` isn't needed\r\n- `data_interval`, `data_interval_type`, `data_type` should vary (possibly set in EdgeFactory)\r\n- should `is_intermagnet` be true?\r\n- add `__init__` that accepts optional metadata reference.  If `None`, make instance use DEFAULT_METADATA.\r\n- look up observatory based on set_metadata parameter\r\n- set all values in stats from metadata reference\r\n- `.keys()` is not needed:\r\n```\r\nfor key in metadata:\r\n  stats[key] = metadata[key]\r\n```\r\nor\r\n```\r\nfor key, value in metadata.iteritems():\r\n  stats[key] = value\r\n```\r\n- don't return stats, just update stats that were passed in\r\n\r\n\r\nObservatoryMetadata\r\n- add test using custom metadata, verify custom declination_base returned instead of default.\r\n"}}