Skip to content

Commit a87a315

Browse files
committed
MNT: depend on larray 0.35
and drop functionality vendored from larray 0.35
1 parent feb1d1d commit a87a315

4 files changed

Lines changed: 18 additions & 40 deletions

File tree

condarecipe/larray-editor/meta.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ requirements:
2222

2323
run:
2424
- python >=3.9
25-
# Technically, we should require larray >=0.35 because we need align_arrays
26-
# for compare(), but to make larray-editor releasable, we cannot depend on
27-
# larray X.Y when releasing larray-editor X.Y (see utils.py for more
28-
# details)
29-
# TODO: require 0.35 for next larray-editor version
30-
- larray >=0.32
25+
# We often require new functionality in larray X.Y for larray-editor X.Y
26+
# because we develop both in parallel, but currently we CANNOT require
27+
# larray >=X.Y for larray-editor X.Y because larray-editor X.Y must be
28+
# released before larray X.Y (to include its changelog) so we need to
29+
# vendor new larray features in larray-editor and only require
30+
# larray >=X.Y-1
31+
- larray >=0.35
3132
# it is indirectly pulled from larray, but let us be explicit about this
3233
- numpy >=1.22
3334
- matplotlib

larray_editor/comparator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import numpy as np
2-
import larray as la
32
import pandas as pd
3+
import larray as la
4+
from larray.core.array import align_arrays
45

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

910
from larray_editor.arrayadapter import ensure_numeric_array
10-
from larray_editor.utils import _, print_exception, align_arrays
11+
from larray_editor.utils import _, print_exception
1112
from larray_editor.arraywidget import ArrayEditorWidget
1213
from larray_editor.editor import AbstractEditorWindow
1314

larray_editor/utils.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,6 @@
3737
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
3838

3939
from larray.util.misc import Product
40-
try:
41-
from larray.core.array import align_arrays
42-
except ImportError:
43-
# TODO: remove this when we release any version of larray-editor > 0.35.0
44-
# and require larray >= 0.35
45-
# This function is necessary *only* for larray-editor version
46-
# 0.35.ZERO. Because of the incorporation of the larray-editor changelog in
47-
# the larray release, we cannot depend on larray >= 0.35 when releasing
48-
# larray-editor 0.35.0 (which is very silly because we develop both in
49-
# parallel)
50-
def align_arrays(arrays, join='outer', fill_value=np.nan):
51-
if len(arrays) > 2:
52-
raise NotImplementedError("aligning more than two arrays requires "
53-
"larray >= 0.35")
54-
first_array = arrays[0]
55-
56-
def is_raw(array):
57-
return all(axis.iswildcard and axis.name is None
58-
for axis in array.axes)
59-
60-
if all(is_raw(array) and array.shape == first_array.shape
61-
for array in arrays[1:]):
62-
return arrays
63-
return first_array.align(arrays[1], join=join, fill_value=fill_value)
6440

6541
# field is field_name + conversion if any
6642
M_SPECIFIER_PATTERN = re.compile(r'\{(?P<field>[^:}]*):(?P<format_spec>[^m}]*)m\}')

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ dependencies = [
4040
# jedi >=0.18 to workaround incompatibility between jedi <0.18 and
4141
# parso >=0.8 (see #220)
4242
"jedi >=0.18",
43-
# Technically, we should require larray >=0.35 because we need align_arrays
44-
# for compare(), but to make larray-editor releasable, we cannot depend on
45-
# larray X.Y when releasing larray-editor X.Y (see utils.py for more
46-
# details)
47-
# TODO: require 0.35 for next larray-editor version and drop shim in
48-
# utils.pyk
49-
"larray >=0.32",
43+
# We often require new functionality in larray X.Y for larray-editor X.Y
44+
# because we develop both in parallel, but currently we CANNOT require
45+
# larray >=X.Y for larray-editor X.Y because larray-editor X.Y must be
46+
# released before larray X.Y (to include its changelog) so we need to
47+
# vendor new larray features in larray-editor and only require
48+
# larray >=X.Y-1
49+
"larray >=0.35",
5050
"matplotlib",
5151
"numpy",
5252
# Pandas is required directly for a silly reason (to support converting
@@ -55,7 +55,7 @@ dependencies = [
5555
# indirectly required via larray, it does not really matter.
5656
"pandas",
5757
# we do not actually require PyQt6 but rather either PyQt5, PyQt6 or
58-
# PySide6 but I do not know how to specify this
58+
# PySide6, but I do not know how to specify this
5959
"PyQt6",
6060
"qtpy"
6161
]

0 commit comments

Comments
 (0)