swiss-seismological-service / DUGseis

Software for acquisition and processing of micro-seismic data
Other
9 stars 4 forks source link

Check flake8 standards #9

Closed jessepisel closed 2 months ago

jessepisel commented 2 months ago

I am running through the JOSS review and things are looking good so far. I ran black and flake8 for formatting and linting. I can open a PR with the black formatting changes if you like (20 files updated). The flake8 linting report is as follows:

./dug_seis/event_processing/magnitudes/amplitude_based_magnitudes.py:65:5: E266 too many leading '#' for block comment
./dug_seis/event_processing/magnitudes/amplitude_based_magnitudes.py:70:5: E266 too many leading '#' for block comment
./dug_seis/event_processing/picking/dug_picker.py:274:17: F841 local variable 'snr' is assigned to but never used
./scripts/load_and_analyse_prelimAE_waveforms.py:4:1: F401 'obspy.UTCDateTime' imported but unused
./scripts/load_and_analyse_prelimAE_waveforms.py:5:1: F401 'obspy' imported but unused
./scripts/load_and_analyse_prelimAE_waveforms.py:6:1: F401 'numpy as np' imported but unused
./scripts/load_and_analyse_prelimAE_waveforms.py:10:1: F401 'dug_seis.util' imported but unused
./scripts/load_and_analyse_prelimAE_waveforms.py:12:1: F401 'dug_seis.plotting.plotting.get_time_vector' imported but unused
./scripts/load_and_analyse_prelimAE_waveforms.py:12:1: F401 'dug_seis.plotting.plotting.plot_waveform_characteristic_function_magnitude' imported but unused
./scripts/load_and_analyse_prelimAE_waveforms.py:12:1: F401 'dug_seis.plotting.plotting.plot_waveform_characteristic_function' imported but unused
./scripts/run_processing_FEAR_stations.py:5:1: F401 'obspy.UTCDateTime' imported but unused
./scripts/run_processing_FEAR_stations.py:7:1: F401 'obspy' imported but unused
./scripts/run_processing_FEAR_stations.py:14:1: F401 'aurem.pickers.AIC' imported but unused
./scripts/run_processing_FEAR_stations.py:14:1: F401 'aurem.pickers.REC' imported but unused
./scripts/run_processing_FEAR_stations.py:16:1: F401 'dug_seis.event_processing.detection.dug_trigger.dug_trigger' imported but unused
./scripts/run_processing_FEAR_stations.py:17:1: F401 'dug_seis.event_processing.picking.dug_picker.dug_picker' imported but unused
./scripts/run_processing_FEAR_stations.py:18:1: F401 'dug_seis.event_processing.location.locate_homogeneous.locate_in_homogeneous_background_medium' imported but unused
./scripts/run_processing_FEAR_stations.py:21:1: F401 'dug_seis.event_processing.magnitudes.amplitude_based_magnitudes.amplitude_based_relative_magnitude' imported but unused
./scripts/run_processing_FEAR_stations.py:27:1: F401 'dug_seis.plotting.plotting.plot_waveform_characteristic_function_magnitude' imported but unused
./scripts/run_processing_FEAR_stations.py:27:1: F401 'dug_seis.plotting.plotting.plot_waveform_characteristic_function' imported but unused
./scripts/run_processing_incl_REC_MA_determination.py:13:1: F401 'aurem.pickers.AIC' imported but unused
./scripts/simple_plotting_FEAR_stations.py:11:1: F401 'matplotlib.pyplot as plt' imported but unused
./scripts/try_spectrogram.py:24:7: F821 undefined name 'st_triggering'
./scripts/try_spectrogram.py:81:1: E402 module level import not at top of file
./scripts/try_spectrogram.py:82:1: F401 'dug_seis.plotting.plotting.plot_waveform_characteristic_function_magnitude' imported but unused
./scripts/try_spectrogram.py:82:1: F401 'dug_seis.plotting.plotting.plot_time_waveform' imported but unused
./scripts/try_spectrogram.py:82:1: F401 'dug_seis.plotting.plotting.plot_waveform_characteristic_function' imported but unused
./scripts/try_spectrogram.py:82:1: E402 module level import not at top of file
./scripts/try_spectrogram.py:89:21: F821 undefined name 'st_triggering'
./scripts/try_spectrogram.py:90:6: F821 undefined name 'st_triggering'

Please fix the issues above or update your .flake8 file to exclude the issues. 🙌

mrosskopf commented 2 months ago

Thank you for the comment! I added some of the flake8 report lines but ignored and therefore added the once from the scripts/**.py files. These files are a collection of different users and might be used by them again. So I did not want to remove any packages, etc. I also ran the black command and added almost all suggestions. Please let me know if you see anything else that needs an adjustment.

jessepisel commented 2 months ago

That's perfect, things look great on my side with the changes. I do not have any other items for you, I will go ahead and close this out as well.