NSLS-II / pyCHX

chx_analysis_codes
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

STY: enable `flake8` checks #84

Open mrakitin opened 6 months ago

mrakitin commented 6 months ago

This way we capture more potential issues.

Although, the number of flake8 errors is significant, many of them are repeating, such as:

...
pyCHX/XPCS_SAXS.py:240:10: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:241:12: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:242:12: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:243:12: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:244:18: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:245:17: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:246:17: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:248:28: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:250:42: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:250:76: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:252:22: F405 'roi' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:253:16: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:254:12: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:256:16: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:258:5: E741 ambiguous variable name 'l'
pyCHX/XPCS_SAXS.py:260:15: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:262:27: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:271:20: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:273:22: F405 'roi' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:274:16: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:275:12: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:276:16: F405 'np' may be undefined, or defined from star imports: pyCHX.chx_generic_functions
pyCHX/XPCS_SAXS.py:277:5: E741 ambiguous variable name 'l'
...
thomaswmorris commented 6 months ago

How much should be refactoring code to fix the linting issues, and how much should be just excluding files from flake? A lot of the scripts don't seem like they were meant to be submodules but rather just profile scripts. Should I make/add them to a /scripts directory?

yugangzhang commented 6 months ago

Guys, recently I played with ChatGPT 4.0 for coding and found that it’s amazing and could save lots of our precious time. One can copy the current code and paste to gpt and it will give what you want, at least at some degrees. Hope this helps.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Thomas Morris @.> Sent: Monday, May 6, 2024 2:32:48 PM To: NSLS-II/pyCHX @.> Cc: Subscribed @.***> Subject: Re: [NSLS-II/pyCHX] STY: enable flake8 checks (PR #84)

How much should be refactoring code to fix the linting issues, and how much should be just excluding files from flake? A lot of the scripts don't seem like they were meant to be submodules but rather just profile scripts. Should I make/add them to a /scripts directory?

— Reply to this email directly, view it on GitHubhttps://github.com/NSLS-II/pyCHX/pull/84#issuecomment-2096662190, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACR3YGNUZADVIYYLHOOLP7DZA7EFBAVCNFSM6AAAAABHCVRA66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWGY3DEMJZGA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

thomaswmorris commented 5 months ago

See #88, most of it was automated so testing is needed.