Skip to content

Commit 041321b

Browse files
committed
Fix catalogue filter with compiled regex
This started failing again with newer versions of pandas
1 parent 1a7966b commit 041321b

File tree

3 files changed

+774
-619
lines changed

3 files changed

+774
-619
lines changed

doc/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ og:description: See what's new in the latest release of Roseau Load Flow !
2323

2424
- {gh-pr}`413` Restore bus and layers to the layer control in the interactive map plot. This was broken in version
2525
0.13.0.
26+
- {gh-pr}`404` Fix filtering catalogues using compiled regular expressions with newer versions of pandas.
2627

2728
## Version 0.13.1
2829

roseau/load_flow/utils/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def _filter_catalogue_str(
305305
"""
306306
vector = pd.Series(strings)
307307
if isinstance(value, re.Pattern):
308-
result = vector.str.fullmatch(value, case=False)
308+
result = vector.str.fullmatch(value.pattern, case=False, flags=value.flags)
309309
else:
310310
try:
311311
result = vector.str.fullmatch(value, case=False) | (vector.str.casefold() == value.casefold())

0 commit comments

Comments
 (0)