Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@santisoler
Copy link
Member

Fix some flake8 A00* warnings that warn the usage of variables and
arguments names that shadow some builtins variables, functions and
modules.

Fix some `flake8` `A00*` warnings that warn the usage of variables and
arguments names that shadow some builtins variables, functions and
modules.
@santisoler
Copy link
Member Author

There are some A003 warnings left related to the eval methods of some classes. I didn't want to rename those in case we could create a backward compatibility issue. You can check them by running:

make flake | grep -E "A[0-9]+"

@jcapriot what's your take on those?

@codecov
Copy link

codecov bot commented Nov 30, 2022

Codecov Report

Merging #1137 (7a9b9a8) into main (f900a47) will decrease coverage by 39.01%.
The diff coverage is 96.96%.

❗ Current head 7a9b9a8 differs from pull request most recent head ddd80fb. Consider uploading reports for the commit ddd80fb to get more accurate results

@@             Coverage Diff             @@
##             main    #1137       +/-   ##
===========================================
- Coverage   80.23%   41.22%   -39.02%     
===========================================
  Files         158      158               
  Lines       23010    23010               
===========================================
- Hits        18463     9485     -8978     
- Misses       4547    13525     +8978     
Impacted Files Coverage Δ
SimPEG/potential_fields/base.py 40.42% <50.00%> (-16.32%) ⬇️
SimPEG/electromagnetics/base.py 85.71% <100.00%> (-7.15%) ⬇️
...PEG/electromagnetics/frequency_domain/receivers.py 85.26% <100.00%> (-11.58%) ⬇️
...imPEG/electromagnetics/natural_source/receivers.py 34.83% <100.00%> (-61.43%) ⬇️
...G/electromagnetics/static/resistivity/receivers.py 23.33% <100.00%> (-65.84%) ⬇️
...PEG/electromagnetics/static/resistivity/sources.py 34.78% <100.00%> (-46.38%) ⬇️
.../static/spectral_induced_polarization/receivers.py 25.49% <100.00%> (-51.97%) ⬇️
...cs/static/spectral_induced_polarization/sources.py 32.87% <100.00%> (-42.47%) ⬇️
SimPEG/electromagnetics/time_domain/receivers.py 78.65% <100.00%> (-12.36%) ⬇️
SimPEG/electromagnetics/time_domain/sources.py 43.18% <100.00%> (-48.09%) ⬇️
... and 111 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jcapriot
Copy link
Member

jcapriot commented Dec 1, 2022

renaming eval straight up might cause a few too many issues. However, what I would like to see done eventually is replace all of the eval with __call__. I don't think too many people use it outside the codebase, as it is mostly an internal calling convention though.

@santisoler
Copy link
Member Author

You're right, that's why I didn't want to touch them. I think we could add a deprecation warning for the eval methods in another PR and ultimately deprecate them in v0.20.

@jcapriot
Copy link
Member

jcapriot commented Dec 1, 2022

We can probably tackle it when we finish up all the pep8 renaming

Remove the A00* flake8 errors from the list of ignored warnings in the
Makefile used by the `flake-permissive` target.
Flake8 complains after defining functions or methods named `eval`
because they overwrite the builtin `eval` function. Renaming these
functions and methods might break backward compatibility and it should
be done with proper deprecation warnings. This is outside of the scope
of this PullRequest.
@santisoler
Copy link
Member Author

@jcapriot I think this is ready to be merged.

@jcapriot jcapriot merged commit bd7555c into simpeg:main Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants