Skip to content

Commit

Permalink
ref: IndentationPreprocessor is deprecated in nanite
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Aug 16, 2021
1 parent 07f43f8 commit dc3193a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.10.1
- ref: IndentationPreprocessor is deprecated in nanite
0.10.0
- BREAKING CHANGE: The default contact point estimation method
changed. This means that your fitted contact points and any
Expand Down
10 changes: 5 additions & 5 deletions pyjibe/fd/tab_preprocess.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pkg_resources

from nanite.preproc import IndentationPreprocessor
from nanite import preproc
from PyQt5 import uic, QtCore, QtWidgets

from .widget_preprocess_item import WidgetPreprocessItem
Expand All @@ -15,7 +15,7 @@ def __init__(self, *args, **kwargs):

# Setup everything necessary for the preprocessing tab:
# Get list of preprocessing methods
premem = IndentationPreprocessor.available()
premem = preproc.available()

self._map_widgets_to_preproc_ids = {}
for pid in premem:
Expand Down Expand Up @@ -75,7 +75,7 @@ def check_selection(self):
pid = self._map_widgets_to_preproc_ids[sender]
if state:
# Enable all steps that this step here requires
req_stps = IndentationPreprocessor.get_steps_required(pid)
req_stps = preproc.get_steps_required(pid)
if req_stps:
for pwid in self._map_widgets_to_preproc_ids:
if self._map_widgets_to_preproc_ids[pwid] in req_stps:
Expand All @@ -84,7 +84,7 @@ def check_selection(self):
# Disable all steps that depend on this one
for dwid in self._map_widgets_to_preproc_ids:
did = self._map_widgets_to_preproc_ids[dwid]
req_stps = IndentationPreprocessor.get_steps_required(did)
req_stps = preproc.get_steps_required(did)
if req_stps and pid in req_stps:
dwid.setChecked(False)

Expand All @@ -102,7 +102,7 @@ def current_preprocessing(self):
if popts:
options[pid] = popts
# Make sure the order is correct
identifiers = IndentationPreprocessor.autosort(identifiers)
identifiers = preproc.autosort(identifiers)
return identifiers, options

@QtCore.pyqtSlot()
Expand Down
8 changes: 4 additions & 4 deletions pyjibe/fd/widget_preprocess_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pkg_resources

from nanite.preproc import IndentationPreprocessor
from nanite import preproc
from PyQt5 import QtCore, QtWidgets, uic


Expand All @@ -17,13 +17,13 @@ def __init__(self, identifier, *args, **kwargs):
uic.loadUi(path_ui, self)

# set label text
name = IndentationPreprocessor.get_name(identifier)
name = preproc.get_name(identifier)
self.label.setText(name)

self.identifier = identifier

# set tooltip
meth = IndentationPreprocessor.get_func(identifier)
meth = preproc.get_func(identifier)
self.setToolTip(meth.__doc__)

# set options
Expand All @@ -47,7 +47,7 @@ def get_options(self):
"""Return preprocessing options"""
popts = {}
if self.comboBox.isEnabled() and not self.comboBox.isHidden():
meth = IndentationPreprocessor.get_func(self.identifier)
meth = preproc.get_func(self.identifier)
if meth.options is not None:
for opt in meth.options:
if "choices" in opt:
Expand Down

0 comments on commit dc3193a

Please sign in to comment.