Skip to content

Commit

Permalink
WIP: update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
massich committed Aug 22, 2019
1 parent 811da18 commit 30066de
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion mne/bem.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from scipy import linalg

from .io.constants import FIFF, FWD
from .digitization.base import _dig_kind_dict, _dig_kind_rev, _dig_kind_ints
from ._digitization.base import _dig_kind_dict, _dig_kind_rev, _dig_kind_ints
from .io.write import (start_file, start_block, write_float, write_int,
write_float_matrix, write_int_matrix, end_block,
end_file)
Expand Down
2 changes: 1 addition & 1 deletion mne/channels/_dig_montage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from ..io.constants import FIFF
from ..io.open import fiff_open
from ..digitization._utils import _read_dig_fif
from .._digitization._utils import _read_dig_fif
from ..utils import _check_fname, Bunch, warn


Expand Down
7 changes: 4 additions & 3 deletions mne/channels/montage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from .channels import _contains_ch_type
from ..transforms import (apply_trans, get_ras_to_neuromag_trans, _sph_to_cart,
_topo_to_sph, _str_to_frame, _frame_to_str)
from ..digitization import Digitization
from ..digitization._utils import (_make_dig_points, _read_dig_points,
write_dig)
from .._digitization import Digitization
from .._digitization._utils import (_make_dig_points, _read_dig_points,
write_dig)
from ..io.pick import pick_types
from ..io.constants import FIFF
from ..utils import (warn, copy_function_doc_to_method_doc,
Expand Down Expand Up @@ -710,6 +710,7 @@ def save(self, fname):
raise RuntimeError('Can only write out digitization points in '
'head coordinates.')
write_dig(fname, self.dig)
# XXX: This is broken, as it only saves dig and not ch_names

@property
def dig_ch_pos(self):
Expand Down
4 changes: 2 additions & 2 deletions mne/channels/tests/test_montage.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from mne.bem import _fit_sphere
from mne.transforms import apply_trans, get_ras_to_neuromag_trans
from mne.io.constants import FIFF
from mne.digitization import Digitization
from mne.digitization._utils import _read_dig_points
from mne._digitization import Digitization
from mne._digitization._utils import _read_dig_points
from mne.viz._3d import _fiducial_coords

from mne.io.kit import read_mrk
Expand Down
2 changes: 1 addition & 1 deletion mne/gui/_kit2fiff_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from scipy.linalg import inv
from threading import Thread

from ..digitization._utils import _read_dig_points, _make_dig_points
from .._digitization._utils import _read_dig_points, _make_dig_points
from ..utils import get_config, set_config, logger, warn

from mayavi.core.ui.mayavi_scene import MayaviScene
Expand Down
2 changes: 1 addition & 1 deletion mne/gui/_marker_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ..transforms import apply_trans, rotation, translation
from ..coreg import fit_matched_points
from ..io.kit import read_mrk
from ..digitization._utils import _write_dig_points
from .._digitization._utils import _write_dig_points
from ._viewer import PointObject
from ._backend import _check_pyface_backend

Expand Down
2 changes: 1 addition & 1 deletion mne/io/artemis123/artemis123.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ..utils import _read_segments_file
from ..base import BaseRaw
from ..meas_info import _empty_info
from ...digitization._utils import _make_dig_points
from ..._digitization._utils import _make_dig_points
from ..constants import FIFF
from ...chpi import _fit_device_hpi_positions, _fit_coil_order_dev_head_trans
from ...transforms import get_ras_to_neuromag_trans, apply_trans, Transform
Expand Down
2 changes: 1 addition & 1 deletion mne/io/artemis123/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os.path as op
from ...utils import logger
from ...transforms import rotation3d_align_z_axis
from ...digitization._utils import _artemis123_read_pos
from ..._digitization._utils import _artemis123_read_pos


def _load_mne_locs(fname=None):
Expand Down
2 changes: 1 addition & 1 deletion mne/io/bti/bti.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def _read_segment_file(self, data, idx, fi, start, stop, cals, mult):
def _make_bti_digitization(
info, head_shape_fname, convert, use_hpi, bti_dev_t, dev_ctf_t):

from ...digitization._utils import _make_bti_dig_points
from ..._digitization._utils import _make_bti_dig_points

if head_shape_fname:
logger.info('... Reading digitization points from %s' %
Expand Down
2 changes: 1 addition & 1 deletion mne/io/bti/tests/test_bti.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from mne.datasets import testing
from mne.io import read_raw_fif, read_raw_bti
from mne.digitization._utils import _make_bti_dig_points
from mne._digitization._utils import _make_bti_dig_points
from mne.io.bti.bti import (_read_config,
_read_bti_header, _get_bti_dev_t,
_correct_trans, _get_bti_info,
Expand Down
2 changes: 1 addition & 1 deletion mne/io/ctf/ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .constants import CTF
from .markers import _read_annotations_ctf_call

from ...digitization.base import _format_dig_points
from ..._digitization.base import _format_dig_points


@fill_doc
Expand Down
2 changes: 1 addition & 1 deletion mne/io/kit/coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import numpy as np

from .constants import KIT
from ...digitization._utils import _read_dig_points
from ..._digitization._utils import _read_dig_points


def read_mrk(fname):
Expand Down
2 changes: 1 addition & 1 deletion mne/io/kit/kit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .coreg import read_mrk
from ...event import read_events

from ...digitization._utils import _set_dig_kit
from ..._digitization._utils import _set_dig_kit


def _call_digitization(info, mrk, elp, hsp):
Expand Down
2 changes: 1 addition & 1 deletion mne/io/kit/tests/test_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from numpy.testing import assert_array_equal

from mne.io.kit import read_mrk
from mne.digitization._utils import _write_dig_points
from mne._digitization._utils import _write_dig_points
from mne.utils import _TempDir


Expand Down
11 changes: 6 additions & 5 deletions mne/io/meas_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
from .proc_history import _read_proc_history, _write_proc_history
from ..transforms import invert_transform
from ..utils import logger, verbose, warn, object_diff, _validate_type
from ..digitization.base import _format_dig_points
from .._digitization.base import _format_dig_points
from .compensator import get_current_comp

# XXX: most probably the functions needing this, should go somewhere else
from ..digitization.base import _dig_kind_proper, _dig_kind_rev, _dig_kind_ints
from ..digitization._utils import _read_dig_fif
from .._digitization.base import _dig_kind_proper, _dig_kind_rev
from .._digitization.base import _dig_kind_ints
from .._digitization._utils import _read_dig_fif

b = bytes # alias

Expand Down Expand Up @@ -667,7 +668,7 @@ def write_fiducials(fname, pts, coord_frame=FIFF.FIFFV_COORD_UNKNOWN,
mne.io.constants.FIFF.FIFFV_COORD_...).
%(verbose)s
"""
from ..digitization._utils import write_dig as ff
from .._digitization._utils import write_dig as ff
ff(fname, pts, coord_frame)


Expand All @@ -686,7 +687,7 @@ def write_dig(fname, pts, coord_frame=None):
here. Can be None (default) if the points could have varying
coordinate frames.
"""
from ..digitization._utils import write_dig as ff
from .._digitization._utils import write_dig as ff
return ff(fname, pts, coord_frame=None)


Expand Down
4 changes: 2 additions & 2 deletions mne/io/tests/test_meas_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
from mne.io.meas_info import (Info, create_info, _merge_info,
_force_update_info, RAW_INFO_FIELDS,
_bad_chans_comp, _get_valid_units)
from mne.digitization._utils import (_write_dig_points, _read_dig_points,
_make_dig_points,)
from mne._digitization._utils import (_write_dig_points, _read_dig_points,
_make_dig_points,)
from mne.io import read_raw_ctf
from mne.utils import _TempDir, run_tests_if_main, catch_logging
from mne.channels.montage import read_montage, read_dig_montage
Expand Down
2 changes: 1 addition & 1 deletion mne/io/tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from mne.utils import _TempDir, catch_logging, _raw_annot
from mne.io.meas_info import _get_valid_units

from mne.digitization import Digitization
from mne._digitization import Digitization


def test_orig_units():
Expand Down
4 changes: 2 additions & 2 deletions mne/tests/test_digitization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# License: BSD (3-clause)
import pytest
import numpy as np
from mne.digitization import Digitization
from mne.digitization.base import _format_dig_points
from mne._digitization import Digitization
from mne._digitization.base import _format_dig_points

dig_dict_list = [
dict(kind=_, ident=_, r=np.empty((3,)), coord_frame=_)
Expand Down
2 changes: 1 addition & 1 deletion mne/viz/tests/test_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
setup_volume_source_space, read_forward_solution,
VolVectorSourceEstimate, convert_forward_solution)
from mne.io import read_raw_ctf, read_raw_bti, read_raw_kit, read_info
from mne.digitization._utils import write_dig
from mne._digitization._utils import write_dig
from mne.io.pick import pick_info
from mne.io.constants import FIFF
from mne.viz import (plot_sparse_source_estimates, plot_source_estimates,
Expand Down

0 comments on commit 30066de

Please sign in to comment.