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

[pre-commit.ci] pre-commit autoupdate #354

Merged
merged 2 commits into from
May 16, 2023
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
language_version: python3
Expand All @@ -14,14 +14,14 @@ repos:
- id: isort
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear, mccabe]
args: [--max-complexity, "10"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -30,12 +30,12 @@ repos:
# conda-recipes use jinja templating which isn't valid YAML syntax
exclude: conda-recipe\/
- repo: https://github.com/PyCQA/bandit
rev: '1.7.4'
rev: '1.7.5'
hooks:
- id: bandit
args: [--ini, .bandit]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.991' # Use the sha / tag you want to point at
rev: 'v1.3.0' # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies:
Expand Down
3 changes: 0 additions & 3 deletions uwsift/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ def update_full_data_selection():
self.ui.regionSelectButton.setMenu(menu)

def _init_layer_model(self):

self.layer_model = LayerModel(self.document)

self.document.didAddDataset.connect(self.layer_model.add_dataset)
Expand Down Expand Up @@ -1091,7 +1090,6 @@ def _purge_content_for_names(uuids):
self._open_cache_dialog.activate(ordered_uuid_to_name)

def _open_wizard(self, *args, **kwargs):

if not self._wizard_dialog:
self._wizard_dialog = OpenFileWizard(
base_dir=self._last_open_dir, base_reader=self._last_reader, parent=self
Expand Down Expand Up @@ -1458,7 +1456,6 @@ def main() -> int:
window.raise_()

if AUTO_UPDATE_MODE__ACTIVE:

# FIXME: let the AutoUpdateManager be in control...
from uwsift import config
from uwsift.control.auto_update import AutoUpdateManager
Expand Down
1 change: 0 additions & 1 deletion uwsift/control/auto_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def update(self, current_constraints: Dict) -> Optional[Tuple]:

class AutoUpdateManager:
def __init__(self, window, minimum_interval, search_path=None):

# "Static"
self.search_path = search_path
self.reader = None
Expand Down
1 change: 0 additions & 1 deletion uwsift/control/time_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class TimeTransformer:
"""

def __init__(self, translation_policy: WrappingDrivingPolicy):

self._translation_policy = translation_policy

self.curr_tick_time: float = -1.0
Expand Down
1 change: 0 additions & 1 deletion uwsift/model/area_definitions_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class AreaDefinitionsManager:

@classmethod
def init_available_area_defs(cls) -> None:

cls._available_area_defs_by_id = {}
cls._available_area_defs_id_by_name = {}

Expand Down
1 change: 0 additions & 1 deletion uwsift/model/layer_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def __init__(

@staticmethod
def extract_layer_info(info: frozendict) -> frozendict:

layer_info: dict = {}
unit_conversion = units_conversion(info)
layer_info[Info.UNIT_CONVERSION] = unit_conversion
Expand Down
2 changes: 0 additions & 2 deletions uwsift/model/layer_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def supportedDropActions(self):
return Qt.MoveAction

def headerData(self, section: int, orientation, role=None):

if (orientation == Qt.Horizontal) and (role == Qt.DisplayRole):
return self._headers[section]
return None
Expand Down Expand Up @@ -962,7 +961,6 @@ def remove_layers(self, indices: List[QModelIndex]):
self.didUpdateLayers.emit()

def _clear_layer(self, layer: LayerItem):

self.removeLayerAsRecipeInput.emit(layer.uuid)

datasets_sched_times = list(layer.timeline.keys())
Expand Down
1 change: 0 additions & 1 deletion uwsift/model/product_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def get_rgb_multichannel_product_dataset(
scheduled_time,
input_datasets_infos: List[Optional[frozendict]],
) -> Optional["ProductDataset"]:

if not any(input_datasets_uuids):
LOG.debug("Could not create a multichannel ProductDataset, when no input ProductDatasets exist.")
return None
Expand Down
1 change: 0 additions & 1 deletion uwsift/util/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def _format_unit(val, numeric=True, include_units=True):


def _unit_format_func_for_flags(info):

# flag values don't have units
if "flag_meanings" in info:
flag_masks = info["flag_masks"] if "flag_masks" in info else [-1] * len(info["flag_values"])
Expand Down
1 change: 0 additions & 1 deletion uwsift/view/layer_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ def _update_displayed_info(self):

def _update_displayed_instrument(self):
if self._current_selected_layer.info.get(Info.INSTRUMENT):

if self._current_selected_layer.info.get(Info.KIND) == Kind.RGB:
instrument_str = self._get_multichannel_instrument_str()
else:
Expand Down
2 changes: 0 additions & 2 deletions uwsift/view/layer_tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def resizeColumnsToContents(self) -> None: # noqa
self.resizeColumnToContents(column)

def rowsInserted(self, parent: QModelIndex, start: int, end: int) -> None:

super(LayerTreeView, self).rowsInserted(parent, start, end)
for idx in range(start, end + 1):
model_idx = self.model().index(idx, 0, parent)
Expand All @@ -85,7 +84,6 @@ def rowsInserted(self, parent: QModelIndex, start: int, end: int) -> None:
self.setCurrentIndex(model_idx)

def _open_layer_context_menu(self, position):

menu = QMenu()
selection_model_idx = self.selectionModel().currentIndex()

Expand Down
2 changes: 0 additions & 2 deletions uwsift/view/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ def rebuildPlot(self):
def _rebuild_plot_task( # noqa: C901
self, x_layer_uuid, y_layer_uuid, polygon, point_xy, plot_versus=False, plot_full_data=True
):

data_source_description = "full data" if plot_full_data else "polygon data"

x_layer = self.layer_model.get_layer_by_uuid(x_layer_uuid)
Expand Down Expand Up @@ -833,7 +832,6 @@ def clearPlot(self):
self.figure.clf()

def _draw_xy_line(self, axes):

# get the bounds for our calculations and so we can reset the viewing window later
x_bounds = axes.get_xbound()
y_bounds = axes.get_ybound()
Expand Down
2 changes: 0 additions & 2 deletions uwsift/view/scene_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class AnimationController(object):
"""Basic bookkeeping object for each layer set (A, B, C, D) from the UI."""

def __init__(self):

self._animation_speed = DEFAULT_ANIMATION_DELAY # milliseconds
self._animating = False

Expand Down Expand Up @@ -1382,7 +1381,6 @@ def _set_retiled(self, uuid, preferred_stride, tile_box, tiles_info, vertices, t


def get_configured_latlon_grid_resolution() -> float:

resolution: float = config.get("latlon_grid.resolution", LATLON_GRID_RESOLUTION_DEFAULT)

if not isinstance(resolution, Number):
Expand Down
1 change: 0 additions & 1 deletion uwsift/workspace/caching_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ def get_content(self, info_or_uuid, lod=None, kind: Kind = Kind.IMAGE) -> Option
# TODO: this causes a locking exception when run in a secondary thread.
# Keeping background operations lightweight makes sense however, so just review this
with self._inventory as s:

if kind == Kind.IMAGE:
content = (
s.query(ContentImage)
Expand Down
2 changes: 0 additions & 2 deletions uwsift/workspace/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,6 @@ def begin_import_products(self, *product_ids) -> Generator[import_progress, None

num_stages = len(products)
for idx, (prod, ds_id) in enumerate(zip(products, dataset_ids)):

dataset = (
self.scn[ds_id] if prod.info[Info.KIND] != Kind.MC_IMAGE else get_enhanced_image(self.scn[ds_id]).data
)
Expand Down Expand Up @@ -1295,7 +1294,6 @@ def get_segment_height_calculator() -> Callable:
return segment_heights.astype(int)

def _determine_segments_to_image_mapping(self, segments_data, segments_indices) -> Tuple[List, List]:

segment_heights = self._calc_segment_heights(segments_data, segments_indices)

segment_starts_stops = []
Expand Down