Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remaining pep8 issues #18

Closed
chrhck opened this issue Mar 20, 2020 · 1 comment
Closed

Fix remaining pep8 issues #18

chrhck opened this issue Mar 20, 2020 · 1 comment
Labels
code style Improvements related to code style WIP Indicate that something is work in progress.

Comments

@chrhck
Copy link
Collaborator

chrhck commented Mar 20, 2020

I just realized that there are still quite a lot of flake8 error messages. However in newer python versions this does not make the github CI report a failure.
Most errors involve unused imports / symbols or invalid escape characters:

2020-03-20T16:15:31.7150303Z ./skyllh/plotting/i3/pdf.py:12:1: F401 'skyllh.core.py.range' imported but unused
2020-03-20T16:15:31.7151204Z ./skyllh/plotting/core/pdfratio.py:12:1: F401 'skyllh.core.py.range' imported but unused
2020-03-20T16:15:31.7152252Z ./skyllh/plotting/core/pdfratio.py:16:1: F401 'skyllh.core.source_hypothesis.SourceHypoGroupManager' imported but unused
2020-03-20T16:15:31.7152783Z ./skyllh/plotting/core/signalpdf.py:9:1: F401 'skyllh.core.py.range' imported but unused
2020-03-20T16:15:31.7153122Z ./skyllh/plotting/utils/trials.py:8:1: F401 'matplotlib.text as mpl_text' imported but unused
2020-03-20T16:15:31.7153443Z ./skyllh/plotting/utils/trials.py:12:1: C901 'plot_ns_fit_vs_mean_ns_inj' is too complex (12)
2020-03-20T16:15:31.7153745Z ./skyllh/plotting/utils/trials.py:62:29: W605 invalid escape sequence '\m'
2020-03-20T16:15:31.7154022Z ./skyllh/plotting/utils/trials.py:65:26: W605 invalid escape sequence '\m'
2020-03-20T16:15:31.7154315Z ./skyllh/plotting/utils/trials.py:274:29: W605 invalid escape sequence '\m'
2020-03-20T16:15:31.7154610Z ./skyllh/plotting/utils/trials.py:277:24: W605 invalid escape sequence '\g'
2020-03-20T16:15:31.7154904Z ./skyllh/plotting/utils/trials.py:277:31: W605 invalid escape sequence '\m'
2020-03-20T16:15:31.7155190Z ./skyllh/i3/pdf.py:57:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7155509Z ./skyllh/i3/pdf.py:200:9: F841 local variable 'logE_binning' is assigned to but never used
2020-03-20T16:15:31.7155842Z ./skyllh/i3/pdf.py:201:9: F841 local variable 'sinDec_binning' is assigned to but never used
2020-03-20T16:15:31.7156154Z ./skyllh/i3/pdf.py:203:9: F841 local variable 'exp_logE' is assigned to but never used
2020-03-20T16:15:31.7156470Z ./skyllh/i3/pdf.py:204:9: F841 local variable 'exp_sinDec' is assigned to but never used
2020-03-20T16:15:31.7156747Z ./skyllh/i3/pdf.py:208:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7156870Z ./skyllh/i3/pdf.py:208:128: E501 line too long (130 > 127 characters)
2020-03-20T16:15:31.7157593Z ./skyllh/i3/pdf.py:210:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7157723Z ./skyllh/i3/pdf.py:210:128: E501 line too long (138 > 127 characters)
2020-03-20T16:15:31.7158213Z ./skyllh/i3/pdfratio.py:3:1: F401 'abc' imported but unused
2020-03-20T16:15:31.7158578Z ./skyllh/i3/dataset.py:20:1: F401 'skyllh.i3.config' imported but unused
2020-03-20T16:15:31.7159052Z ./skyllh/i3/signalpdf.py:20:1: F401 'skyllh.physics.source.PointLikeSource' imported but unused
2020-03-20T16:15:31.7159382Z ./skyllh/i3/backgroundpdf.py:7:1: F401 'skyllh.core.binning.BinningDefinition' imported but unused
2020-03-20T16:15:31.7159697Z ./skyllh/i3/backgroundpdf.py:11:1: F401 'skyllh.core.pdf.EnergyPDF' imported but unused
2020-03-20T16:15:31.7159813Z ./skyllh/i3/backgroundpdf.py:68:128: E501 line too long (148 > 127 characters)
2020-03-20T16:15:31.7159930Z ./skyllh/i3/backgroundpdf.py:72:128: E501 line too long (158 > 127 characters)
2020-03-20T16:15:31.7160258Z ./skyllh/i3/config.py:8:1: F403 'from skyllh.core.config import *' used; unable to detect undefined names
2020-03-20T16:15:31.7160589Z ./skyllh/i3/config.py:12:1: F405 'CFG' may be undefined, or defined from star imports: skyllh.core.config
2020-03-20T16:15:31.7160912Z ./skyllh/i3/config.py:13:1: F405 'CFG' may be undefined, or defined from star imports: skyllh.core.config
2020-03-20T16:15:31.7161231Z ./skyllh/i3/detsigyield.py:21:1: F401 'skyllh.core.livetime.Livetime' imported but unused
2020-03-20T16:15:31.7161568Z ./skyllh/core/pdf.py:614:9: F841 local variable 'sinDec_binning' is assigned to but never used
2020-03-20T16:15:31.7161885Z ./skyllh/core/pdf.py:615:9: F841 local variable 'exp_sinDec' is assigned to but never used
2020-03-20T16:15:31.7162217Z ./skyllh/core/analysis_utils.py:89:1: C901 'estimate_mean_nsignal_for_ts_quantile' is too complex (22)
2020-03-20T16:15:31.7162518Z ./skyllh/core/analysis_utils.py:661:1: C901 'create_trial_data_file' is too complex (12)
2020-03-20T16:15:31.7162644Z ./skyllh/core/pdfratio.py:433:128: E501 line too long (140 > 127 characters)
2020-03-20T16:15:31.7162766Z ./skyllh/core/pdfratio.py:496:128: E501 line too long (140 > 127 characters)
2020-03-20T16:15:31.7162885Z ./skyllh/core/pdfratio.py:535:128: E501 line too long (140 > 127 characters)
2020-03-20T16:15:31.7163007Z ./skyllh/core/pdfratio.py:855:128: E501 line too long (129 > 127 characters)
2020-03-20T16:15:31.7163110Z ./skyllh/core/pdfratio.py:883:128: E501 line too long (128 > 127 characters)
2020-03-20T16:15:31.7163225Z ./skyllh/core/pdfratio.py:884:128: E501 line too long (171 > 127 characters)
2020-03-20T16:15:31.7163543Z ./skyllh/core/parameters.py:8:1: F401 'skyllh.physics.source.SourceModel' imported but unused
2020-03-20T16:15:31.7163866Z ./skyllh/core/parameters.py:26:1: F401 'skyllh.core.random.RandomStateService' imported but unused
2020-03-20T16:15:31.7164178Z ./skyllh/core/livetime.py:7:1: F401 'skyllh.core.random.RandomStateService' imported but unused
2020-03-20T16:15:31.7164466Z ./skyllh/core/livetime.py:340:9: E741 ambiguous variable name 'l'
2020-03-20T16:15:31.7164759Z ./skyllh/core/dataset.py:542:5: C901 'Dataset.__str__' is too complex (11)
2020-03-20T16:15:31.7164878Z ./skyllh/core/dataset.py:625:128: E501 line too long (139 > 127 characters)
2020-03-20T16:15:31.7165179Z ./skyllh/core/dataset.py:1089:12: E713 test for membership should be 'not in'
2020-03-20T16:15:31.7165478Z ./skyllh/core/signalpdf.py:10:1: F401 'skyllh.core.py.issequenceof' imported but unused
2020-03-20T16:15:31.7165829Z ./skyllh/core/signalpdf.py:23:1: F401 'skyllh.core.source_hypothesis.SourceHypoGroupManager' imported but unused
2020-03-20T16:15:31.7166153Z ./skyllh/core/signalpdf.py:24:1: F401 'skyllh.physics.source.PointLikeSource' imported but unused
2020-03-20T16:15:31.7166696Z ./skyllh/core/signalpdf.py:34:14: W605 invalid escape sequence '\p'
2020-03-20T16:15:31.7166977Z ./skyllh/core/signalpdf.py:34:18: W605 invalid escape sequence '\s'
2020-03-20T16:15:31.7167259Z ./skyllh/core/signalpdf.py:34:44: W605 invalid escape sequence '\s'
2020-03-20T16:15:31.7167540Z ./skyllh/core/signalpdf.py:36:11: W605 invalid escape sequence '\s'
2020-03-20T16:15:31.7167816Z ./skyllh/core/signalpdf.py:223:9: E741 ambiguous variable name 'I'
2020-03-20T16:15:31.7168208Z ./skyllh/core/multiproc.py:59:1: C901 'parallelize' is too complex (34)
2020-03-20T16:15:31.7168567Z ./skyllh/core/multiproc.py:331:23: E711 comparison to None should be 'if cond is None:'
2020-03-20T16:15:31.7168979Z ./skyllh/core/trialdata.py:10:1: F401 'numpy as np' imported but unused
2020-03-20T16:15:31.7169101Z ./skyllh/core/trialdata.py:175:128: E501 line too long (155 > 127 characters)
2020-03-20T16:15:31.7169411Z ./skyllh/core/llhratio.py:13:1: F401 'skyllh.core.py.issequence' imported but unused
2020-03-20T16:15:31.7169738Z ./skyllh/core/llhratio.py:28:1: F401 'skyllh.core.parameters.MultiSourceFitParameterMapper' imported but unused
2020-03-20T16:15:31.7170056Z ./skyllh/core/llhratio.py:38:1: F401 'skyllh.physics.source.SourceModel' imported but unused
2020-03-20T16:15:31.7170350Z ./skyllh/core/llhratio.py:760:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7170640Z ./skyllh/core/llhratio.py:766:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7170927Z ./skyllh/core/llhratio.py:1456:5: E265 block comment should start with '# '
2020-03-20T16:15:31.7171225Z ./skyllh/core/llhratio.py:1459:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7171524Z ./skyllh/core/llhratio.py:1467:9: E265 block comment should start with '# '
2020-03-20T16:15:31.7171848Z ./skyllh/core/signal_generator.py:12:1: F401 'skyllh.core.random.RandomStateService' imported but unused
2020-03-20T16:15:31.7172159Z ./skyllh/core/signal_generator.py:299:17: E265 block comment should start with '# '
2020-03-20T16:15:31.7172425Z ./skyllh/core/py.py:279:5: E722 do not use bare 'except'
2020-03-20T16:15:31.7172694Z ./skyllh/core/py.py:294:5: E722 do not use bare 'except'
2020-03-20T16:15:31.7172960Z ./skyllh/core/py.py:329:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7173224Z ./skyllh/core/py.py:350:5: E722 do not use bare 'except'
2020-03-20T16:15:31.7173523Z ./skyllh/core/analysis.py:36:1: F401 'skyllh.core.scrambling.DataScramblingMethod' imported but unused
2020-03-20T16:15:31.7173844Z ./skyllh/core/analysis.py:467:5: C901 'Analysis.generate_pseudo_data' is too complex (11)
2020-03-20T16:15:31.7174143Z ./skyllh/core/detsigyield.py:4:1: F401 'numpy as np' imported but unused
2020-03-20T16:15:31.7174443Z ./skyllh/core/detsigyield.py:6:1: F401 'astropy.units' imported but unused
2020-03-20T16:15:31.7174773Z ./skyllh/core/background_generator.py:6:1: F401 'skyllh.core.random.RandomStateService' imported but unused
2020-03-20T16:15:31.7175049Z ./skyllh/core/storage.py:84:9: E741 ambiguous variable name 'l'
2020-03-20T16:15:31.7175350Z ./skyllh/core/storage.py:236:5: C901 'NPYFileLoader.load_data' is too complex (13)
2020-03-20T16:15:31.7175662Z ./skyllh/core/storage.py:429:5: C901 'DataFieldRecordArray.__init__' is too complex (21)
2020-03-20T16:15:31.7175786Z ./skyllh/core/smoothing.py:100:128: E501 line too long (130 > 127 characters)
2020-03-20T16:15:31.7175891Z ./skyllh/core/smoothing.py:113:128: E501 line too long (146 > 127 characters)
2020-03-20T16:15:31.7176015Z ./skyllh/core/smoothing.py:117:128: E501 line too long (172 > 127 characters)
2020-03-20T16:15:31.7176366Z ./skyllh/core/background_generation.py:335:5: C901 'MCDataSamplingBkgGenMethod.generate_events' is too complex (12)
2020-03-20T16:15:31.7176666Z ./skyllh/core/scrambling.py:42:61: W605 invalid escape sequence '\p'
2020-03-20T16:15:31.7176952Z ./skyllh/core/scrambling.py:54:76: W605 invalid escape sequence '\p'
2020-03-20T16:15:31.7177055Z ./skyllh/core/utils/multidimgridpdf.py:50:26: W291 trailing whitespace
2020-03-20T16:15:31.7177171Z ./skyllh/core/utils/multidimgridpdf.py:51:68: W291 trailing whitespace
2020-03-20T16:15:31.7177461Z ./skyllh/physics/flux_model.py:19:1: F401 'copy.deepcopy' imported but unused
2020-03-20T16:15:31.7177772Z ./skyllh/physics/flux_model.py:24:1: F401 'skyllh.core.py.issequence' imported but unused
2020-03-20T16:15:31.7178072Z ./skyllh/physics/flux_model.py:24:1: F401 'skyllh.core.py.classname' imported but unused
2020-03-20T16:15:31.7178386Z ./skyllh/physics/flux_model.py:24:1: F401 'skyllh.core.py.issequenceof' imported but unused
2020-03-20T16:15:31.7178777Z ./skyllh/physics/flux_model.py:24:1: F401 'skyllh.core.py.isproperty' imported but unused
2020-03-20T16:15:31.7179159Z ./skyllh/physics/flux_model.py:362:21: W605 invalid escape sequence '\g'
2020-03-20T16:15:31.7179267Z ./skyllh/physics/flux.py:405:128: E501 line too long (172 > 127 characters)
2020-03-20T16:15:31.7179587Z ./skyllh/cluster/master_node.py:14:1: F401 'skyllh.cluster.srvclt.Message' imported but unused
2020-03-20T16:15:31.7179881Z ./skyllh/cluster/compute_node.py:13:1: F401 'json' imported but unused
2020-03-20T16:15:31.7181030Z ./tests/i3/test_scrambling.py:15:1: F401 'skyllh.i3.coords.azi_to_ra_transform' imported but unused
2020-03-20T16:15:31.7181413Z ./tests/i3/test_scrambling.py:15:1: F401 'skyllh.i3.coords.hor_to_equ_transform' imported but unused
2020-03-20T16:15:31.7181741Z ./tests/i3/test_scrambling.py:15:1: F401 'skyllh.i3.coords.ra_to_azi_transform' imported but unused
2020-03-20T16:15:31.7182048Z ./tests/i3/test_scrambling.py:21:1: F401 'skyllh.i3.dataset.I3Dataset' imported but unused
2020-03-20T16:15:31.7182347Z ./tests/i3/test_livetime.py:5:1: F401 'numpy as np' imported but unused
2020-03-20T16:15:31.7182662Z ./tests/i3/test_background_generation.py:4:1: F401 'numpy as np' imported but unused
2020-03-20T16:15:31.7182951Z ./tests/i3/test_coords.py:4:1: F401 'numpy as np' imported but unused
2020-03-20T16:15:31.7183059Z ./tests/i3/testdata/testdata_generator.py:36:128: E501 line too long (150 > 127 characters)
2020-03-20T16:15:31.7183186Z ./tests/i3/testdata/testdata_generator.py:41:128: E501 line too long (150 > 127 characters)
2020-03-20T16:15:31.7183494Z ./tests/core/test_dataset.py:16:1: F401 'skyllh.core.py.float_cast' imported but unused
2020-03-20T16:15:31.7183780Z ./tests/core/test_parameters.py:142:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7184061Z ./tests/core/test_parameters.py:292:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7184368Z ./tests/core/test_parameters.py:433:13: F841 local variable 'paramsetarr' is assigned to but never used
2020-03-20T16:15:31.7184662Z ./tests/core/test_parameters.py:466:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7184943Z ./tests/core/test_parameters.py:670:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7185228Z ./tests/core/test_parameters.py:717:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7185491Z ./tests/core/test_parameters.py:788:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7185835Z ./tests/core/testdata/testdata_generator.py:21:5: F841 local variable 'grl_testdata_dtype' is assigned to but never used
2020-03-20T16:15:31.7186158Z ./tests/physics/test_flux.py:14:1: F401 'skyllh.core.py.float_cast' imported but unused
2020-03-20T16:15:31.7186492Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.EnergyFluxProfile' imported but unused
2020-03-20T16:15:31.7186834Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.UnityTimeFluxProfile' imported but unused
2020-03-20T16:15:31.7187199Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.PointlikeSourceFFM' imported but unused
2020-03-20T16:15:31.7187540Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.TimeFluxProfile' imported but unused
2020-03-20T16:15:31.7187891Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.BoxTimeFluxProfile' imported but unused
2020-03-20T16:15:31.7188231Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.SteadyPointlikeSourceFFM' imported but unused
2020-03-20T16:15:31.7188583Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.UnityEnergyFluxProfile' imported but unused
2020-03-20T16:15:31.7188916Z ./tests/physics/test_flux_model.py:10:1: F401 'skyllh.physics.flux_model.PowerLawEnergyFluxProfile' imported but unused
2020-03-20T16:15:31.7189237Z ./tests/physics/test_flux_model.py:24:1: F401 'skyllh.core.py.float_cast' imported but unused
2020-03-20T16:15:31.7189674Z ./tests/physics/test_flux_model.py:33:13: F841 local variable 'math_func_str' is assigned to but never used
2020-03-20T16:15:31.7190016Z ./tests/physics/test_flux_model.py:34:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7190807Z ./tests/physics/test_flux_model.py:84:13: F841 local variable 'math_func_str' is assigned to but never used
2020-03-20T16:15:31.7191096Z ./tests/physics/test_flux_model.py:85:9: E722 do not use bare 'except'
2020-03-20T16:15:31.7191376Z 9     C901 'Analysis.generate_pseudo_data' is too complex (11)
2020-03-20T16:15:31.7191640Z 9     E265 block comment should start with '# '
2020-03-20T16:15:31.7191747Z 18    E501 line too long (139 > 127 characters)
2020-03-20T16:15:31.7191999Z 1     E711 comparison to None should be 'if cond is None:'
2020-03-20T16:15:31.7192260Z 1     E713 test for membership should be 'not in'
2020-03-20T16:15:31.7192505Z 12    E722 do not use bare 'except'
2020-03-20T16:15:31.7192750Z 3     E741 ambiguous variable name 'l'
2020-03-20T16:15:31.7193268Z 51    F401 'json' imported but unused
2020-03-20T16:15:31.7193590Z 1     F403 'from skyllh.core.config import *' used; unable to detect undefined names
2020-03-20T16:15:31.7193900Z 2     F405 'CFG' may be undefined, or defined from star imports: skyllh.core.config
2020-03-20T16:15:31.7194202Z 10    F841 local variable 'sinDec_binning' is assigned to but never used
2020-03-20T16:15:31.7194318Z 2     W291 trailing whitespace
2020-03-20T16:15:31.7194550Z 12    W605 invalid escape sequence '\p'
2020-03-20T16:15:31.7194653Z 131

Originally posted by @chrhck in #17 (comment)

@chrhck chrhck added enhancement New feature or request code style Improvements related to code style and removed enhancement New feature or request labels Mar 20, 2020
@martwo martwo added the WIP Indicate that something is work in progress. label Apr 14, 2023
@martwo martwo added this to the Fixed in SkyLLH v2 milestone Jun 28, 2023
@martwo
Copy link
Collaborator

martwo commented Jun 29, 2023

Fixed in PR #149

@martwo martwo closed this as completed Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code style Improvements related to code style WIP Indicate that something is work in progress.
Projects
None yet
Development

No branches or pull requests

2 participants