Skip to content

Undefined variables #14

@max-models

Description

@max-models

There are a few undefined variables remaining which are not caught by the testing. You can find them like this with pylint (but not by ruff, see here):

❯ pylint src/**/*.py | grep undefined-variable
src/struphy/eigenvalue_solvers/legacy/control_variates/kernels_control_variate.py:171:32: E0602: Undefined variable 'eta2' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/inner_products_3d.py:58:9: E0602: Undefined variable 'tensor_space' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/inner_products_3d.py:330:9: E0602: Undefined variable 'tensor_space' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/massless_operators/fB_arrays.py:813:36: E0602: Undefined variable 'Jeqx' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/massless_operators/fB_arrays.py:813:70: E0602: Undefined variable 'equ_PIC' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/massless_operators/fB_arrays.py:814:36: E0602: Undefined variable 'Jeqy' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/massless_operators/fB_arrays.py:814:70: E0602: Undefined variable 'equ_PIC' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/massless_operators/fB_arrays.py:815:36: E0602: Undefined variable 'Jeqz' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/massless_operators/fB_arrays.py:815:70: E0602: Undefined variable 'equ_PIC' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/mhd_operators_3d_local.py:4071:21: E0602: Undefined variable 'kind_map' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/mhd_operators_3d_local.py:4072:23: E0602: Undefined variable 'params_map' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/mhd_operators_3d_local.py:4119:21: E0602: Undefined variable 'kind_map' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/mhd_operators_3d_local.py:4120:23: E0602: Undefined variable 'params_map' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/mhd_operators_3d_local.py:4167:21: E0602: Undefined variable 'kind_map' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/mhd_operators_3d_local.py:4168:23: E0602: Undefined variable 'params_map' (undefined-variable)
src/struphy/eigenvalue_solvers/legacy/projectors_local/pro_local/projectors_local.py:1326:36: E0602: Undefined variable 'xint2' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1002:39: E0602: Undefined variable 'EF_11' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1002:46: E0602: Undefined variable 'EF_12' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1002:55: E0602: Undefined variable 'EF_21' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1004:20: E0602: Undefined variable 'EF_11' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1004:27: E0602: Undefined variable 'EF_12' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1004:34: E0602: Undefined variable 'EF_21' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1026:24: E0602: Undefined variable 'Mn' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1030:16: E0602: Undefined variable 'Mn' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1091:39: E0602: Undefined variable 'PF_11' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1091:60: E0602: Undefined variable 'PF_22' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1093:20: E0602: Undefined variable 'PF_11' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1093:27: E0602: Undefined variable 'PF_22' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1146:28: E0602: Undefined variable 'Mn' (undefined-variable)
src/struphy/eigenvalue_solvers/mhd_operators.py:1148:20: E0602: Undefined variable 'Mn' (undefined-variable)
src/struphy/feec/mass.py:2930:53: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2930:90: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2930:104: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2942:36: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2942:77: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2942:91: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2964:44: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2964:86: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2964:100: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2976:44: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2976:86: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2976:100: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2980:44: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2980:86: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2980:100: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2986:44: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2986:86: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/mass.py:2986:100: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/utilities.py:466:63: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/utilities.py:473:67: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/utilities.py:474:68: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/feec/utilities.py:480:63: E0602: Undefined variable 'self' (undefined-variable)
src/struphy/fields_background/equils.py:2002:8: E0602: Undefined variable 'out' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/accumulation.py:57:24: E0602: Undefined variable 'TermsControlVariate' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/accumulation.py:251:12: E0602: Undefined variable 'pic_ker_2d' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/accumulation.py:330:12: E0602: Undefined variable 'pic_ker_2d' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/pusher_pos.py:417:17: E0602: Undefined variable 'df_inv' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/pusher_pos.py:417:37: E0602: Undefined variable 'df_inv' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/pusher_pos.py:417:57: E0602: Undefined variable 'df_inv' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/pusher_pos.py:422:18: E0602: Undefined variable 'df_inv' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/pusher_pos.py:429:36: E0602: Undefined variable 'v' (undefined-variable)
src/struphy/pic/tests/test_pic_legacy_files/pusher_pos.py:433:36: E0602: Undefined variable 'v' (undefined-variable)
src/struphy/propagators/propagators_fields.py:1360:26: E0602: Undefined variable 'pcg' (undefined-variable)

This is of course a problem for using these parts of the code, but also in the formatting/linting, since ssort requires these errors to be resolved to format a file (see !762).

Steps

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions