Skip to content

Commit

Permalink
Move imports such that tensorflow is only imported if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuen committed Nov 21, 2023
1 parent e64b69d commit 739cdf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ic3_data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from ic3_data.utils.time import get_wf_quantile
from ic3_data.utils.time import get_time_of_first_light
from ic3_data.utils import detector
from ic3_data.utils.autoencoder import autoencoder


class DNNContainerHandler(icetray.I3ConditionalModule):
Expand Down Expand Up @@ -85,6 +84,8 @@ def Configure(self):
raise ValueError('Timing method must be wf_quantile!')

if self._config['data_format'] == 'autoencoder':
from ic3_data.utils.autoencoder import autoencoder

self._config['autoencoder'] = autoencoder.get_autoencoder(
self._config['autoencoder_settings'])

Expand Down
3 changes: 2 additions & 1 deletion ic3_data/data_formats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import print_function, division
import numpy as np

from ic3_data.utils.autoencoder import autoencoder as aencoder
from ic3_data.misc import weighted_quantile, weighted_std
from ic3_data.ext_pybind11 import get_summary_data
from ic3_data.ext_boost import get_time_bin_exclusions
Expand Down Expand Up @@ -347,6 +346,8 @@ def autoencoder(dom_charges, rel_dom_times, global_time_offset,
list
The list of bin indices which define bins that will be excluded.
"""
from ic3_data.utils.autoencoder import autoencoder as aencoder

# create bin exclusions list
bin_exclusions_list = []

Expand Down

0 comments on commit 739cdf4

Please sign in to comment.