Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed obsolete __future__ imports #1043

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions scripts/start_mslice.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python
from __future__ import absolute_import

from mslice.app import main
main()
2 changes: 0 additions & 2 deletions src/mslice/app/mainwindow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from qtpy.QtWidgets import QApplication, QMainWindow, QLabel, QMenu, QStackedLayout

from mslice.models.units import EnergyUnits
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mslice.app import is_gui
from mslice.plotting.pyplot import * # noqa: F401, F403
from matplotlib.axes import Axes
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/cli/_mslice_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Defines the additional mslice commands on top of the standard matplotlib plotting commands"""
from __future__ import (absolute_import, division, print_function)

import os.path as ospath

import matplotlib as mpl
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/cli/plotfunctions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

import mslice.plotting.pyplot as plt
import mslice.app as app
from mslice.models.workspacemanager.workspace_provider import get_workspace_handle
Expand Down
3 changes: 0 additions & 3 deletions src/mslice/cli/views/cli_data_loader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import (absolute_import, division, print_function)


class CLIDataLoaderWidget:
"""
A Dataloader Widget dummy class to interface with the presenter classes without doing anything in CLI mode.
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/cli/views/cli_powder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mslice.views.interfaces.powder_projection_view import PowderView


Expand Down
2 changes: 0 additions & 2 deletions src/mslice/models/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
to hex values and both #00bfbf and #00ffff will return
the string cyan
"""
from __future__ import (absolute_import, division)

import re

from matplotlib import rcParams
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/models/cut/cut_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mantid.api import WorkspaceUnitValidator

from mslice.models.workspacemanager.workspace_provider import get_workspace_handle
Expand Down
1 change: 0 additions & 1 deletion src/mslice/models/intensity_correction_algs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import numpy as np

from scipy import constants
Expand Down
1 change: 0 additions & 1 deletion src/mslice/models/labels.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Module to create axis and legend labels"""

from __future__ import (absolute_import, division, print_function)
from mslice.models.units import EnergyUnits

CUT_INTENSITY_LABEL = 'Signal/#Events'
Expand Down
1 change: 0 additions & 1 deletion src/mslice/models/projection/powder/make_projection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import uuid
from mantid.api import PythonAlgorithm, MatrixWorkspaceProperty, IMDEventWorkspaceProperty
from mantid.kernel import FloatArrayProperty, Direction, StringMandatoryValidator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mslice.models.workspacemanager.workspace_algorithms import propagate_properties
from mslice.models.workspacemanager.workspace_provider import get_workspace_handle
from mslice.models.projection.powder.projection_calculator import ProjectionCalculator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import abc


Expand Down
1 change: 0 additions & 1 deletion src/mslice/models/slice/slice_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import numpy as np

from mantid.api import WorkspaceUnitValidator
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/models/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
are defined, but they are separated into a module for possible future expansion.
"""

from __future__ import (absolute_import, division, print_function)

import numpy as np


Expand Down
1 change: 0 additions & 1 deletion src/mslice/models/workspacemanager/file_io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import os.path
from qtpy.QtWidgets import QFileDialog
from mantid.api import MDNormalization
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/models/workspacemanager/workspace_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from __future__ import (absolute_import, division, print_function)

import os.path
from os.path import splitext

Expand Down
1 change: 0 additions & 1 deletion src/mslice/plotting/backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, unicode_literals)
# system imports
import importlib

Expand Down
1 change: 0 additions & 1 deletion src/mslice/plotting/globalfiguremanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

Currently there are only two categories ('1d' and '2d') hard coded into the manager.
"""
from __future__ import (absolute_import, division, print_function)
# system imports
from functools import wraps

Expand Down
2 changes: 0 additions & 2 deletions src/mslice/plotting/plot_window/plot_options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from numpy import arange as np_arange

import qtpy.QtWidgets as QtWidgets
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/plotting/plot_window/plot_window.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from qtpy import QtCore, QtWidgets

from matplotlib.figure import Figure
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/presenters/cut_widget_presenter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mslice.models.cut.cut import Cut
from .busy import show_busy
from mslice.models.alg_workspace_ops import get_available_axes, get_axis_range
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/presenters/data_loader_presenter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

import os

from .busy import show_busy
Expand Down
1 change: 0 additions & 1 deletion src/mslice/presenters/main_presenter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from .interfaces.main_presenter import MainPresenterInterface
from mantid.api import IMDHistoWorkspace, IMDEventWorkspace
from collections.abc import Callable
Expand Down
1 change: 0 additions & 1 deletion src/mslice/presenters/plot_options_presenter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from functools import partial


Expand Down
2 changes: 0 additions & 2 deletions src/mslice/presenters/powder_projection_presenter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from .busy import show_busy
from mslice.models.projection.powder.projection_calculator import ProjectionCalculator
from mslice.presenters.presenter_utility import PresenterUtility
Expand Down
1 change: 0 additions & 1 deletion src/mslice/presenters/slice_widget_presenter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from .busy import show_busy
from mslice.models.alg_workspace_ops import get_available_axes, get_axis_range
from mslice.models.axis import Axis
Expand Down
1 change: 0 additions & 1 deletion src/mslice/presenters/validation_decorators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from functools import wraps


Expand Down
2 changes: 0 additions & 2 deletions src/mslice/presenters/workspace_manager_presenter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from .busy import show_busy
from mslice.widgets.workspacemanager.command import Command
from mslice.widgets.workspacemanager import TAB_2D, TAB_NONPSD
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/util/compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from matplotlib.legend import Legend


Expand Down
2 changes: 0 additions & 2 deletions src/mslice/util/mantid/algorithm_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from uuid import uuid4

from mslice.models.workspacemanager.workspace_provider import add_workspace, get_workspace_handle
Expand Down
1 change: 0 additions & 1 deletion src/mslice/util/qt/qapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#
from __future__ import (absolute_import, unicode_literals)
from functools import wraps

# make these available in this module for the rest of codebase
Expand Down
1 change: 0 additions & 1 deletion src/mslice/views/cut_plotter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import mslice.plotting.pyplot as plt
from mslice.plotting.globalfiguremanager import GlobalFigureManager

Expand Down
3 changes: 0 additions & 3 deletions src/mslice/views/interfaces/powder_projection_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import (absolute_import, division, print_function)


class PowderView(object):
error_occurred = None
busy = None
Expand Down
3 changes: 0 additions & 3 deletions src/mslice/views/interfaces/slice_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import (absolute_import, division, print_function)


class SliceView:
error_occurred = None
busy = None
Expand Down
3 changes: 0 additions & 3 deletions src/mslice/views/interfaces/workspace_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import (absolute_import, division, print_function)


class WorkspaceView(object):
error_occurred = None
busy = None
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/views/slice_plotter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

import mslice.plotting.pyplot as plt

PICKER_TOL_PTS = 5
Expand Down
9 changes: 0 additions & 9 deletions src/mslice/widgets/cut/command.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
"""Enumeration for operations allowed in this module
"""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------

from __future__ import (absolute_import, division, print_function)

# -----------------------------------------------------------------------------
# Classes and functions
# -----------------------------------------------------------------------------


class Command(object):
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/widgets/cut/cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from __future__ import (absolute_import, division, print_function)

from qtpy.QtCore import Signal
from qtpy.QtWidgets import QWidget
from mslice.util.qt import load_ui
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/widgets/dataloader/dataloader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

import os

from functools import partial
Expand Down
1 change: 0 additions & 1 deletion src/mslice/widgets/dataloader/inputdialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from qtpy.QtWidgets import QDialog, QFormLayout, QLabel, QDoubleSpinBox, QPushButton, QCheckBox


Expand Down
3 changes: 0 additions & 3 deletions src/mslice/widgets/ipythonconsole/ipython_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import (absolute_import, division,
print_function)

import warnings
from mslice.util.mantid import in_mantid

Expand Down
2 changes: 0 additions & 2 deletions src/mslice/widgets/projection/powder/powder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from __future__ import (absolute_import, division, print_function)

from qtpy.QtCore import Signal
from qtpy.QtWidgets import QWidget, QMessageBox

Expand Down
2 changes: 0 additions & 2 deletions src/mslice/widgets/slice/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from __future__ import (absolute_import, division, print_function)

from qtpy.QtCore import Signal
from qtpy.QtWidgets import QWidget
from mslice.util.qt import load_ui
Expand Down
2 changes: 0 additions & 2 deletions src/mslice/widgets/status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from __future__ import (absolute_import, division, print_function)

from qtpy.QtWidgets import QWidget

from mslice.util.qt import load_ui
Expand Down
1 change: 0 additions & 1 deletion src/mslice/workspace/histo_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import numpy as np
import operator as op
from mslice.util.numpy_helper import apply_with_corrected_shape, transform_array_to_workspace
Expand Down
1 change: 0 additions & 1 deletion src/mslice/workspace/histogram_workspace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from .base import WorkspaceBase
from .histo_mixin import HistoMixin
from .workspace_mixin import WorkspaceOperatorMixin, WorkspaceMixin
Expand Down
1 change: 0 additions & 1 deletion src/mslice/workspace/pixel_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from .histogram_workspace import HistogramWorkspace
from mantid.simpleapi import BinMD

Expand Down
1 change: 0 additions & 1 deletion src/mslice/workspace/pixel_workspace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from .base import WorkspaceBase
from .histogram_workspace import HistogramWorkspace
from .pixel_mixin import PixelMixin
Expand Down
1 change: 0 additions & 1 deletion src/mslice/workspace/workspace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from .base import WorkspaceBase
from .workspace_mixin import WorkspaceOperatorMixin, WorkspaceMixin
from .helperfunctions import attribute_from_log, attribute_to_log, delete_workspace, rename_workspace
Expand Down
1 change: 0 additions & 1 deletion src/mslice/workspace/workspace_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import numpy as np
import operator as op

Expand Down
1 change: 0 additions & 1 deletion tests/cut_widget_presenter_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import mock
from mock import call, patch
import unittest
Expand Down
1 change: 0 additions & 1 deletion tests/data_loader_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from tempfile import gettempdir
from os.path import join
import unittest
Expand Down
1 change: 0 additions & 1 deletion tests/figure_manager_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import unittest
from unittest import mock
from unittest.mock import call
Expand Down
2 changes: 0 additions & 2 deletions tests/file_io_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mock import patch, Mock, MagicMock
import numpy as np
from os.path import join
Expand Down
1 change: 0 additions & 1 deletion tests/histogram_workspace_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import numpy as np

from mantid.simpleapi import CreateMDHistoWorkspace
Expand Down
2 changes: 0 additions & 2 deletions tests/intensity_correction_algs_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mock import patch, MagicMock, call
import numpy as np
import unittest
Expand Down
2 changes: 0 additions & 2 deletions tests/intensity_correction_util_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function)

from mock import patch, MagicMock
import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/main_presenter_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import mock
import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/pixel_workspace_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import numpy as np
import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/plot_figure_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import unittest
from unittest import mock
from unittest.mock import patch
Expand Down
1 change: 0 additions & 1 deletion tests/plot_options_presenter_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
from mock import MagicMock, PropertyMock, Mock, ANY
import unittest
from mslice.presenters.plot_options_presenter import CutPlotOptionsPresenter, SlicePlotOptionsPresenter
Expand Down
1 change: 0 additions & 1 deletion tests/powder_projection_presenter_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function)
import mock
import unittest

Expand Down
Loading
Loading