Skip to content

Commit

Permalink
Use relative imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
aleberti committed Sep 6, 2023
1 parent 27f61f5 commit bc6eef3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
11 changes: 6 additions & 5 deletions magicctapipe/io/gadf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
from astropy.io import fits
from astropy.table import QTable
from astropy.time import Time
from magicctapipe import __version__
from magicctapipe.io.io import TEL_COMBINATIONS
from magicctapipe.utils.functions import HEIGHT_ORM, LAT_ORM, LON_ORM
from pyirf.binning import split_bin_lo_hi

from .. import __version__ as MCP_VERSION
from ..utils.functions import HEIGHT_ORM, LAT_ORM, LON_ORM
from .io import TEL_COMBINATIONS


__all__ = [
"create_gh_cuts_hdu",
"create_event_hdu",
Expand Down Expand Up @@ -71,7 +73,7 @@ def create_gh_cuts_hdu(
# Create a header
header = fits.Header(
cards=[
("CREATOR", f"magicctapipe v{__version__}"),
("CREATOR", f"magicctapipe v{MCP_VERSION}"),
("HDUCLAS1", "RESPONSE"),
("HDUCLAS2", "GH_CUTS"),
("HDUCLAS3", "POINT-LIKE"),
Expand Down Expand Up @@ -322,4 +324,3 @@ def create_pointing_hdu(event_table):
pointing_hdu = fits.BinTableHDU(qtable, header=header, name="POINTING")

return pointing_hdu

3 changes: 2 additions & 1 deletion magicctapipe/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
from ctapipe.coordinates import CameraFrame
from ctapipe.instrument import SubarrayDescription
from lstchain.reco.utils import add_delta_t_key
from magicctapipe.utils import calculate_mean_direction, transform_altaz_to_radec
from pyirf.binning import join_bin_lo_hi
from pyirf.simulations import SimulatedEventsInfo
from pyirf.utils import calculate_source_fov_offset, calculate_theta

from ..utils import calculate_mean_direction, transform_altaz_to_radec

__all__ = [
"format_object",
"get_stereo_events",
Expand Down
11 changes: 4 additions & 7 deletions magicctapipe/irfs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@

import numpy as np
import pandas as pd
from astropy import table
import matplotlib.pylab as plt
import astropy.units as u

from astropy import table
from astropy.io import fits
from astropy.table import QTable

from pyirf.simulations import SimulatedEventsInfo

from magicctapipe.utils.filedir import read_mc_header
from magicctapipe.utils.plot import save_plt, load_default_plot_settings
from magicctapipe.utils.utils import print_title

import matplotlib.pylab as plt
from ..utils import read_mc_header, save_plt, load_default_plot_settings, print_title

__all__ = [
"read_simu_info_mcp_sum_num_showers",
Expand Down
7 changes: 3 additions & 4 deletions magicctapipe/reco/classifier_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import os
import sklearn.metrics


from magicctapipe.utils.utils import info_message
from magicctapipe.utils.filedir import (
from ..utils import (
info_message,
load_dl1_data_stereo_list,
load_dl1_data_stereo_list_selected,
)
from magicctapipe.reco.global_utils import check_train_test_intersections
from .global_utils import check_train_test_intersections

__all__ = [
"GetHist_classifier",
Expand Down
2 changes: 1 addition & 1 deletion magicctapipe/reco/direction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from astropy import units as u
from astropy.coordinates import SkyCoord, AltAz

from magicctapipe.utils.tels import get_tel_ids_dl1
from ..utils import get_tel_ids_dl1

__all__ = ["compute_separation_angle_direction"]

Expand Down
2 changes: 1 addition & 1 deletion magicctapipe/reco/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd
import sklearn.ensemble
from magicctapipe.io.io import TEL_NAMES
from ..io.io import TEL_NAMES

__all__ = ["EnergyRegressor", "DispRegressor", "EventClassifier"]

Expand Down
2 changes: 1 addition & 1 deletion magicctapipe/reco/stereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from ctapipe.core.container import Container, Field

from magicctapipe.utils.tels import tel_ids_2_num
from ..utils import tel_ids_2_num

__all__ = ["write_hillas", "check_write_stereo", "check_stereo", "write_stereo"]

Expand Down

0 comments on commit bc6eef3

Please sign in to comment.