Skip to content
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
13 changes: 7 additions & 6 deletions condarecipe/larray-editor/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ requirements:

run:
- python >=3.9
# Technically, we should require larray >=0.35 because we need align_arrays
# for compare(), but to make larray-editor releasable, we cannot depend on
# larray X.Y when releasing larray-editor X.Y (see utils.py for more
# details)
# TODO: require 0.35 for next larray-editor version
- larray >=0.32
# We often require new functionality in larray X.Y for larray-editor X.Y
# because we develop both in parallel, but currently we CANNOT require
# larray >=X.Y for larray-editor X.Y because larray-editor X.Y must be
# released before larray X.Y (to include its changelog) so we need to
# vendor new larray features in larray-editor and only require
# larray >=X.Y-1
- larray >=0.35
# it is indirectly pulled from larray, but let us be explicit about this
- numpy >=1.22
- matplotlib
Expand Down
5 changes: 3 additions & 2 deletions larray_editor/comparator.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import numpy as np
import larray as la
import pandas as pd
import larray as la
from larray.core.array import align_arrays

from qtpy.QtCore import Qt
from qtpy.QtWidgets import (QWidget, QVBoxLayout, QListWidget, QSplitter, QHBoxLayout,
QLabel, QCheckBox, QLineEdit, QComboBox, QMessageBox)

from larray_editor.arrayadapter import ensure_numeric_array
from larray_editor.utils import _, print_exception, align_arrays
from larray_editor.utils import _, print_exception
from larray_editor.arraywidget import ArrayEditorWidget
from larray_editor.editor import AbstractEditorWindow

Expand Down
24 changes: 0 additions & 24 deletions larray_editor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,6 @@
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar

from larray.util.misc import Product
try:
from larray.core.array import align_arrays
except ImportError:
# TODO: remove this when we release any version of larray-editor > 0.35.0
# and require larray >= 0.35
# This function is necessary *only* for larray-editor version
# 0.35.ZERO. Because of the incorporation of the larray-editor changelog in
# the larray release, we cannot depend on larray >= 0.35 when releasing
# larray-editor 0.35.0 (which is very silly because we develop both in
# parallel)
def align_arrays(arrays, join='outer', fill_value=np.nan):
if len(arrays) > 2:
raise NotImplementedError("aligning more than two arrays requires "
"larray >= 0.35")
first_array = arrays[0]

def is_raw(array):
return all(axis.iswildcard and axis.name is None
for axis in array.axes)

if all(is_raw(array) and array.shape == first_array.shape
for array in arrays[1:]):
return arrays
return first_array.align(arrays[1], join=join, fill_value=fill_value)

# field is field_name + conversion if any
M_SPECIFIER_PATTERN = re.compile(r'\{(?P<field>[^:}]*):(?P<format_spec>[^m}]*)m\}')
Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ dependencies = [
# jedi >=0.18 to workaround incompatibility between jedi <0.18 and
# parso >=0.8 (see #220)
"jedi >=0.18",
# Technically, we should require larray >=0.35 because we need align_arrays
# for compare(), but to make larray-editor releasable, we cannot depend on
# larray X.Y when releasing larray-editor X.Y (see utils.py for more
# details)
# TODO: require 0.35 for next larray-editor version and drop shim in
# utils.pyk
"larray >=0.32",
# We often require new functionality in larray X.Y for larray-editor X.Y
# because we develop both in parallel, but currently we CANNOT require
# larray >=X.Y for larray-editor X.Y because larray-editor X.Y must be
# released before larray X.Y (to include its changelog) so we need to
# vendor new larray features in larray-editor and only require
# larray >=X.Y-1
"larray >=0.35",
"matplotlib",
"numpy",
# Pandas is required directly for a silly reason (to support converting
Expand All @@ -55,7 +55,7 @@ dependencies = [
# indirectly required via larray, it does not really matter.
"pandas",
# we do not actually require PyQt6 but rather either PyQt5, PyQt6 or
# PySide6 but I do not know how to specify this
# PySide6, but I do not know how to specify this
"PyQt6",
"qtpy"
]
Expand Down
Loading