1. 15 Nov, 2021 3 commits
    • Christian Clauss's avatar
    • Christian Clauss's avatar
      Undefined name import tensorflow as fr · e72c3cbd
      Christian Clauss authored
      ```
      ./openfold/utils/loss.py:1498:21: F821 undefined name 'logging'
                          logging.warning(f"{loss_name} loss is NaN. Skipping...")
                          ^
      ./openfold/utils/feats.py:180:15: F821 undefined name 'math'
              2.0 / math.pi
                    ^
      ./openfold/utils/feats.py:190:31: F821 undefined name 'tf'
              deletion_mean_value = tf.atan(batch["cluster_deletion_mean"] / 3.0) * (
                                    ^
      ./openfold/utils/feats.py:196:17: F821 undefined name 'tf'
                      tf.expand_dims(deletion_mean_value, axis=-1),
                      ^
      ./openfold/utils/feats.py:200:35: F821 undefined name 'protein'
          if "extra_deletion_matrix" in protein:
                                        ^
      ./openfold/utils/feats.py:201:39: F821 undefined name 'tf'
              batch["extra_has_deletion"] = tf.clip_by_value(
                                            ^
      ./openfold/utils/feats.py:204:41: F821 undefined name 'tf'
              batch["extra_deletion_value"] = tf.atan(
                                              ^
      ```
      e72c3cbd
    • Christian Clauss's avatar
      GitHub Action to find undefined names in Python code · f63c0947
      Christian Clauss authored
      https://flake8.pycqa.org/en/latest/user/error-codes.html
      
      On the flake8 test selection, this PR does not focus on "style violations" (the majority of flake8 error codes that psf/black can autocorrect). Instead, these tests focus on runtime safety and correctness:
      
          E9 tests are about Python syntax errors usually raised because flake8 can not build an Abstract Syntax Tree (AST). Often these issues are a sign of unused code or code that has not been ported to Python 3. These would be compile-time errors in a compiled language but in a dynamic language like Python, they result in the script halting/crashing on the user.
          F63 tests are usually about the confusion between identity and equality in Python. Use ==/!= to compare str, bytes, and int literals is the classic case. These are areas where a == b is True but a is b is False (or vice versa). Python >= 3.8 will raise SyntaxWarnings on these instances.
          F7 tests logic errors and syntax errors in type hints
          F82 tests are almost always undefined names which are usually a sign of a typo, missing imports, or code that has not been ported to Python 3. These also would be compile-time errors in a compiled language but in Python, a NameError is raised which will halt/crash the script on the user.
      f63c0947
  2. 14 Nov, 2021 1 commit
  3. 13 Nov, 2021 4 commits
  4. 12 Nov, 2021 13 commits
  5. 10 Nov, 2021 9 commits
  6. 09 Nov, 2021 3 commits
  7. 04 Nov, 2021 4 commits
  8. 03 Nov, 2021 2 commits
  9. 02 Nov, 2021 1 commit