Repository: wesleybowman/UTide

Issue:
solve failing when conf_int='none'
solve is failing when `conf_int='none'`.

For example, if I try changing `conf_int='linear'` to `conf_int='none'` in cell [5] of the [utide_uv_example.ipynb notebook](https://github.com/wesleybowman/UTide/blob/master/notebooks/utide_uv_example.ipynb), I get: 

```python-traceback
solve: matrix prep ... solution ... diagnostics ... 
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-10-359a0567fa71> in <module>
      7              method='ols',
      8              conf_int='none',
----> 9              Rayleigh_min=0.95,)

~/miniconda3/envs/pangeo/lib/python3.7/site-packages/utide/_solve.py in solve(t, u, v, lat, **opts)
    198     compat_opts = _process_opts(opts, v is not None)
    199 
--> 200     coef = _solv1(t, u, v, lat, **compat_opts)
    201 
    202     return coef

~/miniconda3/envs/pangeo/lib/python3.7/site-packages/utide/_solve.py in _solv1(tin, uin, vin, lat, **opts)
    377     # Diagnostics.
    378     if not opt['nodiagn']:
--> 379         coef, indPE = ut_diagn(coef, opt)
    380 
    381     # Re-order constituents.

~/miniconda3/envs/pangeo/lib/python3.7/site-packages/utide/diagnostics.py in ut_diagn(coef, opt)
     15 
     16         SNR = (coef['Lsmaj']**2 + coef['Lsmin']**2) / (
---> 17             (coef['Lsmaj_ci']/1.96)**2 +
     18             (coef['Lsmin_ci']/1.96)**2)
     19 

KeyError: 'Lsmaj_ci'
```

Discussion:

Patch:
diff --git a/utide/_reconstruct.py b/utide/_reconstruct.py
index ebb7723..e72c862 100644
--- a/utide/_reconstruct.py
+++ b/utide/_reconstruct.py
@@ -92,7 +92,7 @@ def _reconstruct(t, goodmask, coef, verbose, constit, min_SNR, min_PE):
     # Determine constituents to include.
     if constit is not None:
         ind = [i for i, c in enumerate(coef['name']) if c in constit]
-    elif min_SNR == 0 and min_PE == 0:
+    elif (min_SNR == 0 and min_PE == 0) or coef['aux']['opt']['nodiagn']:
         ind = slice(None)
     else:
         if twodim:
diff --git a/utide/_solve.py b/utide/_solve.py
index 9ce79e5..0445c16 100644
--- a/utide/_solve.py
+++ b/utide/_solve.py
@@ -57,6 +57,7 @@ def _translate_opts(opts):
         oldopts.linci = False
     elif opts.conf_int == 'none':
         oldopts.conf_int = False
+        oldopts.nodiagn = 1
     else:
         raise ValueError("'conf_int' must be 'linear', 'MC', or 'none'")
 


Test patch:
diff --git a/tests/test_solve.py b/tests/test_solve.py
index 5295515..eaa507f 100644
--- a/tests/test_solve.py
+++ b/tests/test_solve.py
@@ -9,15 +9,18 @@ Smoke testing--just see if the system runs.
 
 from __future__ import (absolute_import, division, print_function)
 
+import pytest
+
 import numpy as np
 
 from utide import reconstruct
 from utide import solve
 from utide._ut_constants import ut_constants
 from utide.utilities import Bunch
-
-
-def test_roundtrip():
+# We omit the 'MC' case for now because with this test data, it
+# fails with 'numpy.linalg.LinAlgError: SVD did not converge'.
+@pytest.mark.parametrize('conf_int',  ['linear', 'none'])
+def test_roundtrip(conf_int):
     """Minimal conversion from simple_utide_test."""
     ts = 735604
     duration = 35
@@ -44,7 +47,7 @@ def test_roundtrip():
         'nodal': False,
         'trend': False,
         'method': 'ols',
-        'conf_int': 'linear',
+        'conf_int': conf_int,
         'Rayleigh_min': 0.95,
     }