Repository: pvlib/pvlib-python (python)

Issue:
change PVSystem default module_parameters and inverter_parameters to empty dict
``PVSystem`` currently sets the default ``module_parameters`` and ``inverter_parameters`` to ``None``. I think we should change the default values to be empty dicts. Since we want unique dicts for each object, the ``__init__`` method signature would remain the same but we'd add the code below to the method.

```python
if module_parameters is None:
    self.module_parameters = {}
else:
    self.module_parameters = module_parameters
```

...and similar for ``inverter_parameters``.

This has two benefits:

1. It allows a couple of ``PVSystem`` methods to fall back to default values when module_parameters has not been specified. (this problem could also be resolved by making the ``tools._build_kwargs`` function yield ``{}`` from ``None`` input.)
2. It allows users to set new properties without needing to create a new dict to start with. e.g.

 ```python
mypvsystem = PVSystem()
mypvsystem.module_parameters['pdc0'] = 0.05
``` 

I think this is a small enough api change that it could go in the 0.4.4 release.

Pull request description:
set default module and inverter_parameters to empty dict
closes #294. This is a very minor API change, but let me know if you think it should be delayed until 0.5.

Patch:
diff --git a/.gitattributes b/.gitattributes
index 4488f4c..81490a9 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,1 +1,4 @@
 pvlib/version.py export-subst
+
+# reduce the number of merge conflicts
+docs/sphinx/source/whatsnew/v*.txt merge=union
diff --git a/docs/sphinx/source/whatsnew/v0.4.4.txt b/docs/sphinx/source/whatsnew/v0.4.4.txt
index 4356814..b0aff39 100644
--- a/docs/sphinx/source/whatsnew/v0.4.4.txt
+++ b/docs/sphinx/source/whatsnew/v0.4.4.txt
@@ -10,6 +10,14 @@ Enhancements
   improvements by Ineichen and Perez to extend range of air mass (:issue:`278`)
 
 
+API Changes
+~~~~~~~~~~~
+
+* Change PVSystem default module_parameters and inverter_parameters to
+  empty dict. Code that relied on these attributes being None or raising
+  a TypeError will need to be updated. (issue:`294`)
+
+
 Documentation
 ~~~~~~~~~~~~~
 
diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py
index ba64fc2..ce5947e 100644
--- a/pvlib/pvsystem.py
+++ b/pvlib/pvsystem.py
@@ -133,13 +133,19 @@ class PVSystem(object):
 
         # could tie these together with @property
         self.module = module
-        self.module_parameters = module_parameters
+        if module_parameters is None:
+            self.module_parameters = {}
+        else:
+            self.module_parameters = module_parameters
 
         self.modules_per_string = modules_per_string
         self.strings_per_inverter = strings_per_inverter
 
         self.inverter = inverter
-        self.inverter_parameters = inverter_parameters
+        if inverter_parameters is None:
+            self.inverter_parameters = {}
+        else:
+            self.inverter_parameters = inverter_parameters
 
         self.racking_model = racking_model
 


Test patch:
diff --git a/pvlib/test/test_pvsystem.py b/pvlib/test/test_pvsystem.py
index ba9372f..4fbc9b1 100644
--- a/pvlib/test/test_pvsystem.py
+++ b/pvlib/test/test_pvsystem.py
@@ -615,6 +615,9 @@ def test_snlinverter_Pnt_micro(sam_data):
 
 def test_PVSystem_creation():
     pv_system = pvsystem.PVSystem(module='blah', inverter='blarg')
+    # ensure that parameter attributes are dict-like. GH 294
+    pv_system.module_parameters['pdc0'] = 1
+    pv_system.inverter_parameters['Paco'] = 1
 
 
 def test_PVSystem_get_aoi():