Skip to content

Commit

Permalink
Merge pull request #824 from cta-observatory/pyflakes
Browse files Browse the repository at this point in the history
Fix pyflakes check in CI and fix issues
  • Loading branch information
rlopezcoto authored Dec 17, 2021
2 parents 9030a53 + dfacdd9 commit db88aad
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
pip install .
- name: pyflakes
run:
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate ci
pyflakes lstchain
Expand Down
2 changes: 1 addition & 1 deletion lstchain/reco/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_get_obstime_real():
def test_get_geomagnetic_delta():

time_mc = Time("2020-06-29", format="iso").decimalyear
geomag_dec = -5.0674 * np.pi / 180 * u.rad
# geomag_dec = -5.0674 * np.pi / 180 * u.rad
geomag_inc = 37.4531 * np.pi / 180 * u.rad

delta_inc = -0.0698 * np.pi / 180 * u.rad / u.yr
Expand Down
1 change: 0 additions & 1 deletion lstchain/reco/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import pandas as pd
from astropy.coordinates import AltAz, SkyCoord, EarthLocation
from astropy.time import Time
from astropy.utils import deprecated
from ctapipe.coordinates import CameraFrame

from . import disp
Expand Down
1 change: 0 additions & 1 deletion lstchain/scripts/longterm_dl1_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,6 @@ def plot(filename='longterm_dl1_check.h5', batch=False, tel_id=1):
min_muon_efficiency = 0.16

# maximum camera averages:
max_average_ped_charge_stdev = 5 # pe
max_fraction_surviving_pedestals = 0.05
# ff charge & time, using some of the individual pixels' limits:
max_average_ff_charge = ff_charge * (1 + ff_charge_tolerance)
Expand Down
1 change: 0 additions & 1 deletion lstchain/scripts/lstchain_find_pedestals.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import argparse
import numpy as np
import pandas as pd
import tables

from pathlib import Path
Expand Down
8 changes: 4 additions & 4 deletions lstchain/scripts/onsite/onsite_create_calibration_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def main():
print(f"\n--> Input file: {input_file}")

# find date
input_dir, name = os.path.split(os.path.abspath(input_file))
path, date = input_dir.rsplit('/', 1)
input_dir, _ = os.path.split(os.path.abspath(input_file))
_, date = input_dir.rsplit('/', 1)

# verify output dir
output_dir = f"{calib_dir}/calibration/{date}/{prod_id}"
Expand All @@ -131,7 +131,7 @@ def main():
if os.path.exists(pro_dir):
os.remove(pro_dir)
os.symlink(prod_id, pro_dir)
print(f"\n--> Use symbolic link pro")
print("\n--> Use symbolic link pro")
else:
pro = prod_id

Expand All @@ -154,7 +154,7 @@ def main():
# search the pedestal file of the same date
if ped_run is None:
# else search the pedestal file of the same date
file_list = sorted(Path(f"{ped_dir}/{date}/{pro}/").rglob(f'drs4_pedestal*.0000.h5'))
file_list = sorted(Path(f"{ped_dir}/{date}/{pro}/").rglob('drs4_pedestal*.0000.h5'))
if len(file_list) == 0:
raise IOError(f"No pedestal file found for date {date}\n")
if len(file_list) > 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main():
if os.path.exists(pro_dir):
os.remove(pro_dir)
os.symlink(prod_id,pro_dir)
print(f"\n--> Use symbolic link pro")
print("\n--> Use symbolic link pro")
else:
pro=prod_id

Expand Down
2 changes: 1 addition & 1 deletion lstchain/scripts/onsite/onsite_create_drs4_time_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def main():
if os.path.exists(pro_dir):
os.remove(pro_dir)
os.symlink(prod_id, pro_dir)
print(f"\n--> Use symbolic link pro")
print("\n--> Use symbolic link pro")
else:
pro=prod_id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main():
if os.path.exists(pro_dir):
os.remove(pro_dir)
os.symlink(prod_id, pro_dir)
print(f"\n--> Use symbolic link pro")
print("\n--> Use symbolic link pro")
else:
pro = prod_id

Expand Down
2 changes: 0 additions & 2 deletions lstchain/scripts/tests/test_lstchain_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
dl2_params_lstcam_key,
dl1_images_lstcam_key,
get_dataset_keys,
dl1_params_src_dep_lstcam_key,
dl1_params_tel_mon_ped_key,
dl1_params_tel_mon_cal_key,
dl1_params_tel_mon_flat_key,
dl1_params_src_dep_lstcam_key,
dl2_params_src_dep_lstcam_key
)

from lstchain.io.config import get_standard_config
Expand Down
1 change: 0 additions & 1 deletion lstchain/tools/tests/test_create_drs4_pedestal_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from ctapipe.core import run_tool
from ctapipe_io_lst.constants import N_GAINS, N_PIXELS, N_CAPACITORS_PIXEL
from ctapipe.io import read_table
import tables


test_data = Path(os.getenv('LSTCHAIN_TEST_DATA', 'test_data')).absolute()
Expand Down

0 comments on commit db88aad

Please sign in to comment.