Repository: nanograv/enterprise (language: python)

Issue:
make test fails on a clean install
When I try to run `make test` on a clean install, I get an error out of `flake8`:

```
flake8 .
Traceback (most recent call last):
  File "/home/peridot/.local/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/options/parse_args.py", line 53, in parse_args
    opts = aggregator.aggregate_options(option_manager, cfg, cfg_dir, rest)
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/options/aggregator.py", line 30, in aggregate_options
    parsed_config = config.parse_config(manager, cfg, cfg_dir)
  File "/home/peridot/.local/lib/python3.10/site-packages/flake8/options/config.py", line 131, in parse_config
    raise ValueError(
ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'
make: *** [Makefile:44: lint] Error 1
```

I don't know whether this is a misconfiguration or what, but all I did was install enterprise from conda (for the dependencies), then `pip install -e .` so I could work on the code, then `make test`.


Discussion / hints:
I am using flake8 version 6.0.0.

This particular error arises because `.flake8` has comments on the same lines as `ignore` arguments; comments are only allowed on separate lines.

Once this is fixed, `flake8 .` still fails:
```
./tests/test_gp_coefficients.py:303:13: E741 ambiguous variable name 'l'
./tests/test_gp_coefficients.py:321:13: E741 ambiguous variable name 'l'
./tests/test_gp_coefficients.py:363:13: E741 ambiguous variable name 'l'
./tests/test_gp_coefficients.py:378:13: E741 ambiguous variable name 'l'
```

Fix patch:
diff --git a/.flake8 b/.flake8
index 06e7f1e7..42339f9c 100644
--- a/.flake8
+++ b/.flake8
@@ -3,9 +3,12 @@ max-line-length = 120
 max-complexity = 45
 ignore =
   E203
-  W503      # line break before binary operator; conflicts with black
-  E722      # bare except ok
-  E731      # lambda expressions ok
+  # line break before binary operator; conflicts with black
+  W503
+  # bare except ok      
+  E722
+  # lambda expressions ok      
+  E731      
 exclude =
     .git
     .tox


Test patch:
diff --git a/tests/test_gp_coefficients.py b/tests/test_gp_coefficients.py
index 06cf2434..ccd1f97d 100644
--- a/tests/test_gp_coefficients.py
+++ b/tests/test_gp_coefficients.py
@@ -300,8 +300,8 @@ def test_conditional_gp(self):
 
         # build index for the global coefficient vector
         idx, ntot = {}, 0
-        for l, v in cmean.items():
-            idx[l] = slice(ntot, ntot + len(v))
+        for c_name, v in cmean.items():
+            idx[c_name] = slice(ntot, ntot + len(v))
             ntot = ntot + len(v)
 
         # repeat the computation using the common-signal formalism
@@ -318,8 +318,8 @@ def test_conditional_gp(self):
 
         # check mean values
         msg = "Conditional GP coefficient value does not match"
-        for l, v in cmean.items():
-            assert np.allclose(mn[idx[l]], v, atol=1e-4, rtol=1e-4), msg
+        for c_name, v in cmean.items():
+            assert np.allclose(mn[idx[c_name]], v, atol=1e-4, rtol=1e-4), msg
 
         # check variances
         par = "B1937+21_linear_timing_model_coefficients"
@@ -360,8 +360,8 @@ def test_conditional_gp(self):
         cmean = c.get_mean_coefficients(p0)
 
         idx, ntot = {}, 0
-        for l, v in cmean.items():
-            idx[l] = slice(ntot, ntot + len(v))
+        for c_name, v in cmean.items():
+            idx[c_name] = slice(ntot, ntot + len(v))
             ntot = ntot + len(v)
 
         TNrs = pta.get_TNr(p0)
@@ -375,8 +375,8 @@ def test_conditional_gp(self):
         mn = ch(TNr)
 
         msg = "Conditional GP coefficient value does not match for common GP"
-        for l, v in cmean.items():
-            assert np.allclose(mn[idx[l]], v)
+        for c_name, v in cmean.items():
+            assert np.allclose(mn[idx[c_name]], v)
 
 
 class TestGPCoefficientsPint(TestGPCoefficients):