Skip to content

Commit 53bd43a

Browse files
committed
update tests to pass w Python 3.13 and newer pandas
1 parent 2146641 commit 53bd43a

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).
88
### Fixed
99
- Removed deprecated `pkg_resources`, which was root of [this issue](https://github.com/dms-vep/dms-vep-pipeline-3/issues/212#event-22715605282)
1010

11+
- Updated tests to use Python 3.13 and so they pass with the newer versions of `pandas`.
12+
1113

1214
## 0.7.0
1315

dmslogo/logo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ def draw_logo(
367367
ylabel = letter_height_col
368368

369369
# check letters are all upper case
370-
letters = str(data[letter_col].unique())
371-
if letters.upper() != letters:
370+
letters = data[letter_col].unique()
371+
if not all(str(letter) == str(letter).upper() for letter in letters):
372372
raise ValueError("letters in `letter_col` must be uppercase")
373373

374374
# checks on input data

dmslogo/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ class AxLimSetter:
6565
6666
>>> data = [0.5, 0.6, 0.4, 0.4, 0.3, 0.5]
6767
>>> setter_default = AxLimSetter()
68-
>>> setter_default.get_lims(data)
68+
>>> tuple(float(v) for v in setter_default.get_lims(data))
6969
(-0.03, 0.63)
7070
7171
Now use the `max_from_quantile` option to set an upper limit
7272
that substantially exceeds the "noise" of the all-similar values:
7373
7474
>>> setter_max_quantile = AxLimSetter(max_from_quantile=(0.5, 0.05))
75-
>>> setter_max_quantile.get_lims(data)
75+
>>> tuple(float(v) for v in setter_max_quantile.get_lims(data))
7676
(-0.45, 9.45)
7777
7878
Demonstrate `min_upperlim`:
7979
8080
>>> setter_min_upperlim = AxLimSetter(max_from_quantile=(0.5, 0.05),
8181
... min_upperlim=10)
82-
>>> setter_min_upperlim.get_lims(data)
82+
>>> tuple(float(v) for v in setter_min_upperlim.get_lims(data))
8383
(-0.45, 10.0)
8484
8585
"""

nbval_sanitize.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,17 @@ replace: <cell_header_start>
99
[pandas_cell_header_end]
1010
regex: </t[hd]>
1111
replace: <cell_header_end>
12+
13+
# pandas 3 displays None where pandas 2 displayed NaN for missing string values
14+
[pandas_nan_none_html]
15+
regex: <cell_header_start>NaN<cell_header_end>
16+
replace: <cell_header_start>None<cell_header_end>
17+
18+
[pandas_nan_none_text]
19+
regex: \bNaN\b
20+
replace: None
21+
22+
# normalize runs of 2+ spaces to single space for text/plain DataFrame alignment
23+
[pandas_whitespace]
24+
regex: [ ][ ]+
25+
replace: SANITIZED_SPACE

0 commit comments

Comments
 (0)