Repository: NeurodataWithoutBorders/pynwb

Issue:
`nwbfile.create_ogen_site` device argument expects string
the `device` argument of `nwbfile.create_ogen_site` takes a string that is the name of the device. I think it should also take the device object. This will make usage more consistent with `nwbfile.create_electrode_group` and `nwbfile.add_electrode` (with `electrode_group`) where the object is given, not the name of the object. Is there a reason the name of the device is used here?

Discussion:

Patch:
diff --git a/src/pynwb/ogen.py b/src/pynwb/ogen.py
index d05832fd..a4a21f9c 100644
--- a/src/pynwb/ogen.py
+++ b/src/pynwb/ogen.py
@@ -5,6 +5,7 @@ from .form.utils import docval, popargs, fmt_docval_args
 from . import register_class, CORE_NAMESPACE
 from .base import TimeSeries, _default_resolution, _default_conversion
 from .core import NWBContainer
+from .ecephys import Device
 
 
 @register_class('OptogeneticStimulusSite', CORE_NAMESPACE)
@@ -19,7 +20,7 @@ class OptogeneticStimulusSite(NWBContainer):
 
     @docval({'name': 'name', 'type': str, 'doc': 'The name of this stimulus site'},
             {'name': 'source', 'type': str, 'doc': 'the source of the data'},
-            {'name': 'device', 'type': str, 'doc': 'Name of device in /general/devices'},
+            {'name': 'device', 'type': Device, 'doc': 'the device that was used'},
             {'name': 'description', 'type': str, 'doc': 'Description of site.'},
             {'name': 'excitation_lambda', 'type': str, 'doc': 'Excitation wavelength.'},
             {'name': 'location', 'type': str, 'doc': 'Location of stimulation site.'})


Test patch:
diff --git a/tests/unit/pynwb_tests/test_ogen.py b/tests/unit/pynwb_tests/test_ogen.py
index bee99992..b80243d4 100644
--- a/tests/unit/pynwb_tests/test_ogen.py
+++ b/tests/unit/pynwb_tests/test_ogen.py
@@ -1,14 +1,16 @@
 import unittest
 
 from pynwb.ogen import OptogeneticSeries, OptogeneticStimulusSite
+from pynwb.ecephys import Device
 
 
 class OptogeneticSeriesConstructor(unittest.TestCase):
 
     def test_init(self):
-        oS = OptogeneticStimulusSite('site1', 'a test source', 'device', 'description', 'excitation_lambda', 'location')
+        device = Device('name', 'source')
+        oS = OptogeneticStimulusSite('site1', 'a test source', device, 'description', 'excitation_lambda', 'location')
         self.assertEqual(oS.name, 'site1')
-        self.assertEqual(oS.device, 'device')
+        self.assertEqual(oS.device, device)
         self.assertEqual(oS.description, 'description')
         self.assertEqual(oS.excitation_lambda, 'excitation_lambda')
         self.assertEqual(oS.location, 'location')