nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: yegor256/cactoos
Pull request #1718 (2024-03-09 03:38:42)

Add more constructors for StartsWith class
Add all combinations for parameters


Patch:
diff --git a/src/main/java/org/cactoos/text/StartsWith.java b/src/main/java/org/cactoos/text/StartsWith.java
index 0d27d0de..35ec77ad 100644
--- a/src/main/java/org/cactoos/text/StartsWith.java
+++ b/src/main/java/org/cactoos/text/StartsWith.java
@@ -51,9 +51,8 @@ public final class StartsWith implements Scalar<Boolean> {
      * @param text The text
      * @param prefix The prefix
      */
-    public StartsWith(final Text text, final Text prefix) {
-        this.text = text;
-        this.prefix = prefix;
+    public StartsWith(final CharSequence text, final CharSequence prefix) {
+        this(new TextOf(text), new TextOf(prefix));
     }
 
     /**
@@ -62,8 +61,29 @@ public final class StartsWith implements Scalar<Boolean> {
      * @param text The text
      * @param prefix The prefix
      */
-    public StartsWith(final CharSequence text, final CharSequence prefix) {
-        this(new TextOf(text), new TextOf(prefix));
+    public StartsWith(final Text text, final CharSequence prefix) {
+        this(text, new TextOf(prefix));
+    }
+
+    /**
+     * Ctor.
+     *
+     * @param text The text
+     * @param prefix The prefix
+     */
+    public StartsWith(final CharSequence text, final Text prefix) {
+        this(new TextOf(text), prefix);
+    }
+
+    /**
+     * Ctor.
+     *
+     * @param text The text
+     * @param prefix The prefix
+     */
+    public StartsWith(final Text text, final Text prefix) {
+        this.text = text;
+        this.prefix = prefix;
     }
 
     @Override


Test patch:
diff --git a/src/test/java/org/cactoos/text/StartsWithTest.java b/src/test/java/org/cactoos/text/StartsWithTest.java
index 1face87b..b40fa636 100644
--- a/src/test/java/org/cactoos/text/StartsWithTest.java
+++ b/src/test/java/org/cactoos/text/StartsWithTest.java
@@ -42,7 +42,7 @@ final class StartsWithTest {
             "Empty is not prefix of empty",
             new StartsWith(
                 new TextOf(""),
-                new TextOf("")
+                ""
             ).value(),
             new IsTrue()
         ).affirm();
@@ -53,7 +53,7 @@ final class StartsWithTest {
         new Assertion<>(
             "Empty is not prefix of any string",
             new StartsWith(
-                new TextOf("Any string"),
+                "Any string",
                 new TextOf("")
             ).value(),
             new IsTrue()
Repository: yegor256/cactoos
Pull request #1767 (2025-02-21 19:26:03)

Fix previousIndex method in JoinedListIterator
Fixed an off by one error mentioned in #1762. Added test to ensure correct behavior.


Patch:
diff --git a/src/main/java/org/cactoos/list/JoinedListIterator.java b/src/main/java/org/cactoos/list/JoinedListIterator.java
index 756626fd..d859935e 100644
--- a/src/main/java/org/cactoos/list/JoinedListIterator.java
+++ b/src/main/java/org/cactoos/list/JoinedListIterator.java
@@ -143,7 +143,7 @@ public final class JoinedListIterator<T> implements ListIterator<T> {
     public int previousIndex() {
         int previousidx = -1;
         if (this.hasPrevious()) {
-            previousidx = this.cursor.get() - 1;
+            previousidx = this.cursor.get();
         }
         return previousidx;
     }


Test patch:
diff --git a/src/test/java/org/cactoos/list/JoinedListIteratorTest.java b/src/test/java/org/cactoos/list/JoinedListIteratorTest.java
index 216c618e..87bd8736 100644
--- a/src/test/java/org/cactoos/list/JoinedListIteratorTest.java
+++ b/src/test/java/org/cactoos/list/JoinedListIteratorTest.java
@@ -167,4 +167,25 @@ final class JoinedListIteratorTest {
             )
         ).affirm();
     }
+
+    @Test
+    void previousIndexTest() {
+        final ListIterator<Integer> joined = new JoinedListIterator<>(
+            new ListOf<>(1).listIterator(),
+            new ListOf<>(2).listIterator(),
+            new ListOf<>(3).listIterator()
+        );
+        joined.next();
+        new Assertion<>(
+            "Must return index of the previous element",
+            joined.previousIndex(),
+            new IsEqual<>(0)
+        ).affirm();
+        joined.next();
+        new Assertion<>(
+            "Must return index of the previous element",
+            joined.previousIndex(),
+            new IsEqual<>(1)
+        ).affirm();
+    }
 }
Repository: zalando/logbook
Pull request #85 (2016-05-03 07:08:02)

Release 1.0.0-RC1


Patch:
diff --git a/logbook-api/pom.xml b/logbook-api/pom.xml
index 02308504..3789fa09 100644
--- a/logbook-api/pom.xml
+++ b/logbook-api/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-api</artifactId>
diff --git a/logbook-core/pom.xml b/logbook-core/pom.xml
index 7a149ceb..e2b74ecd 100644
--- a/logbook-core/pom.xml
+++ b/logbook-core/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-core</artifactId>
diff --git a/logbook-httpclient/pom.xml b/logbook-httpclient/pom.xml
index 45a86447..531f85a1 100644
--- a/logbook-httpclient/pom.xml
+++ b/logbook-httpclient/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-httpclient</artifactId>
diff --git a/logbook-servlet/pom.xml b/logbook-servlet/pom.xml
index 19aa0c3a..f1648644 100644
--- a/logbook-servlet/pom.xml
+++ b/logbook-servlet/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-servlet</artifactId>
diff --git a/logbook-spring-boot-starter/pom.xml b/logbook-spring-boot-starter/pom.xml
index d809d9fb..bcbd1c6d 100644
--- a/logbook-spring-boot-starter/pom.xml
+++ b/logbook-spring-boot-starter/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-spring-boot-starter</artifactId>
diff --git a/pom.xml b/pom.xml
index ee5cba4f..fce2f0b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
 
     <groupId>org.zalando</groupId>
     <artifactId>logbook-parent</artifactId>
-    <version>0.15.0-SNAPSHOT</version>
+    <version>1.1.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Logbook</name>


Test patch:
diff --git a/logbook-test/pom.xml b/logbook-test/pom.xml
index 04f620b2..031ed887 100644
--- a/logbook-test/pom.xml
+++ b/logbook-test/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
+        <version>1.1.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-test</artifactId>
Repository: zalando/logbook
Pull request #105 (2016-05-25 22:38:44)

Release 1.0.0-RC2


Patch:
diff --git a/logbook-api/pom.xml b/logbook-api/pom.xml
index 888bd182..ce3fe416 100644
--- a/logbook-api/pom.xml
+++ b/logbook-api/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>1.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-api</artifactId>
diff --git a/logbook-core/pom.xml b/logbook-core/pom.xml
index e2b74ecd..bd1f0aee 100644
--- a/logbook-core/pom.xml
+++ b/logbook-core/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>1.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-core</artifactId>
diff --git a/logbook-httpclient/pom.xml b/logbook-httpclient/pom.xml
index 7dfa325e..290b9e3c 100644
--- a/logbook-httpclient/pom.xml
+++ b/logbook-httpclient/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>1.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-httpclient</artifactId>
diff --git a/logbook-servlet/pom.xml b/logbook-servlet/pom.xml
index 792c38e6..879afa50 100644
--- a/logbook-servlet/pom.xml
+++ b/logbook-servlet/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>1.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-servlet</artifactId>
diff --git a/logbook-spring-boot-starter/pom.xml b/logbook-spring-boot-starter/pom.xml
index bcbd1c6d..a10d3540 100644
--- a/logbook-spring-boot-starter/pom.xml
+++ b/logbook-spring-boot-starter/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>1.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-spring-boot-starter</artifactId>
diff --git a/pom.xml b/pom.xml
index 9933d137..9a0b9be1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
 
     <groupId>org.zalando</groupId>
     <artifactId>logbook-parent</artifactId>
-    <version>1.1.0-SNAPSHOT</version>
+    <version>1.0.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Logbook</name>


Test patch:
diff --git a/logbook-test/pom.xml b/logbook-test/pom.xml
index 031ed887..90c82399 100644
--- a/logbook-test/pom.xml
+++ b/logbook-test/pom.xml
@@ -10,7 +10,7 @@
     <parent>
         <groupId>org.zalando</groupId>
         <artifactId>logbook-parent</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>1.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>logbook-test</artifactId>
Repository: pyg-team/pytorch_geometric
Pull request #7941 (2023-08-28 05:51:00)

Fix `from_networkx` conversion from `nx.stochastic_block_model` graphs


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9e7f8fed..6f44b775b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -88,6 +88,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 
 ### Changed
 
+- Fixed `from_networkx` conversion from `nx.stochastic_block_model` graphs ([#7941](https://github.com/pyg-team/pytorch_geometric/pull/7941))
 - Fixed the usage of `bias_initializer` in `HeteroLinear` ([#7923](https://github.com/pyg-team/pytorch_geometric/pull/7923))
 - Fixed broken links in `HGBDataset` ([#7907](https://github.com/pyg-team/pytorch_geometric/pull/7907))
 - Fixed an issue where `SetTransformerAggregation` produced `NaN` values for isolates nodes ([#7902](https://github.com/pyg-team/pytorch_geometric/pull/7902))
diff --git a/torch_geometric/utils/convert.py b/torch_geometric/utils/convert.py
index e0fa499b5..dce666aa4 100644
--- a/torch_geometric/utils/convert.py
+++ b/torch_geometric/utils/convert.py
@@ -258,7 +258,7 @@ def from_networkx(
         else:
             try:
                 data[key] = torch.tensor(value)
-            except (ValueError, TypeError):
+            except (ValueError, TypeError, RuntimeError):
                 pass
 
     data['edge_index'] = edge_index.view(2, -1)


Test patch:
diff --git a/test/utils/test_convert.py b/test/utils/test_convert.py
index 8e4b8280a..5a259ee26 100644
--- a/test/utils/test_convert.py
+++ b/test/utils/test_convert.py
@@ -323,6 +323,25 @@ def test_from_networkx_subgraph_convert():
     assert sub_edge_index_1.tolist() == sub_edge_index_2.tolist()
 
 
+@withPackage('networkx')
+@pytest.mark.parametrize('n', [100])
+@pytest.mark.parametrize('p', [0.8])
+@pytest.mark.parametrize('q', [0.2])
+def test_from_networkx_sbm(n, p, q):
+    import networkx as nx
+    G = nx.stochastic_block_model(
+        sizes=[n // 2, n // 2],
+        p=[[p, q], [q, p]],
+        seed=0,
+        directed=False,
+    )
+
+    data = from_networkx(G)
+    assert data.num_nodes == 100
+    assert torch.equal(data.block[:50], data.block.new_zeros(50))
+    assert torch.equal(data.block[50:], data.block.new_ones(50))
+
+
 @withPackage('networkit')
 def test_to_networkit_vice_versa():
     edge_index = torch.tensor([[0, 1], [1, 0]])
Repository: pyfar/pyfar
Pull request #665 (2024-08-16 10:55:19)

let numpy handle the broadcasting in Coordinates
same problem as in #664, but in the coordiantes class

we could think to shift the match_shape into the utils, so that we can use it anywhere


Patch:
diff --git a/pyfar/classes/coordinates.py b/pyfar/classes/coordinates.py
index cd016a45..69199487 100644
--- a/pyfar/classes/coordinates.py
+++ b/pyfar/classes/coordinates.py
@@ -2642,22 +2642,13 @@ class Coordinates():
         y = np.atleast_1d(np.asarray(y, dtype=np.float64))
         z = np.atleast_1d(np.asarray(z, dtype=np.float64))
 
-        # shapes of non scalar entries
-        shapes = [p.shape for p in [x, y, z] if p.ndim != 1 or p.shape[0] > 1]
-
-        # repeat scalar entries if non-scalars exists
-        if len(shapes):
-            if x.size == 1:
-                x = np.tile(x, shapes[0])
-            if y.size == 1:
-                y = np.tile(y, shapes[0])
-            if z.size == 1:
-                z = np.tile(z, shapes[0])
-
-        # check for equal shape
-        assert (x.shape == y.shape) and (x.shape == z.shape), \
-            "x, y, and z must be scalar or of the \
-            same shape."
+        # determine shape
+        shapes = np.broadcast_shapes(x.shape, y.shape, z.shape)
+
+        # broadcast to same shape
+        x = np.broadcast_to(x, shapes)
+        y = np.broadcast_to(y, shapes)
+        z = np.broadcast_to(z, shapes)
 
         # set values
         self._x = x


Test patch:
diff --git a/tests/test_coordinates.py b/tests/test_coordinates.py
index 10e9c871..e8233752 100644
--- a/tests/test_coordinates.py
+++ b/tests/test_coordinates.py
@@ -177,13 +177,13 @@ def test_coordinates_init_val():
     Coordinates(c1, c1, c7)
     # input 3D data
     Coordinates(c1, c1, c8)
+    # input (3,) and (2, 3) data
+    Coordinates(c6, c6, c7)
 
     # tests that have to fail
-    with raises(AssertionError):
+    with raises(ValueError, match="shape mismatch"):
         Coordinates(c2, c2, c6)
-    with raises(AssertionError):
-        Coordinates(c6, c6, c7)
-    with raises(AssertionError):
+    with raises(ValueError, match="shape mismatch"):
         Coordinates(c2, c2, c8)
Repository: pyfar/pyfar
Pull request #668 (2024-08-21 05:31:38)

implement _return_item for complex signals
### Which issue(s) are closed by this pull request?

Closes #

### Changes proposed in this pull request:

-
-
-



Patch:
diff --git a/pyfar/classes/audio.py b/pyfar/classes/audio.py
index 70584726..87f93f8e 100644
--- a/pyfar/classes/audio.py
+++ b/pyfar/classes/audio.py
@@ -420,7 +420,8 @@ class TimeData(_Audio):
     def _return_item(self, data):
         """Return new :py:func:`TimeData` object with data."""
         item = TimeData(
-            data, times=self.times, comment=self.comment)
+            data, times=self.times, comment=self.comment,
+            is_complex=self.complex)
         return item
 
     def __repr__(self):
@@ -1021,7 +1022,8 @@ class Signal(FrequencyData, TimeData):
         """Return new Signal object with data."""
         item = Signal(data, sampling_rate=self.sampling_rate,
                       n_samples=self.n_samples, domain=self.domain,
-                      fft_norm=self.fft_norm, comment=self.comment)
+                      fft_norm=self.fft_norm, comment=self.comment,
+                      is_complex=self.complex)
         return item
 
     def _encode(self):


Test patch:
diff --git a/tests/test_audio_signal.py b/tests/test_audio_signal.py
index 8ed20864..39c7cc93 100644
--- a/tests/test_audio_signal.py
+++ b/tests/test_audio_signal.py
@@ -391,6 +391,14 @@ def test_magic_getitem():
     npt.assert_allclose(signal[0]._data, time[0])
 
 
+def test_magic_getitem_complex():
+    """Test slicing operations by the magic function __getitem__."""
+    time = np.arange(2 * 3 * 4, dtype=complex).reshape((2, 3, 4))
+    signal = Signal(time, 44100, domain='time', is_complex=True)
+    assert signal[0].complex
+    npt.assert_allclose(signal[0]._data, time[0])
+
+
 def test_magic_getitem_slice():
     """Test slicing operations by the magic function __getitem__."""
     time = np.arange(2 * 3 * 4).reshape((2, 3, 4))
diff --git a/tests/test_audio_time_data.py b/tests/test_audio_time_data.py
index 9764e59e..72bd852d 100644
--- a/tests/test_audio_time_data.py
+++ b/tests/test_audio_time_data.py
@@ -192,6 +192,16 @@ def test_magic_getitem_slice():
     npt.assert_allclose(TimeData(data[0], times)._data, time[0]._data)
 
 
+def test_magic_getitem_complex():
+    """Test slicing operations by the magic function __getitem__."""
+    data = np.array([[1, 0, -1], [2, 0, -2]], dtype=complex)
+    times = [0, .1, .3]
+    time = TimeData(data, times, is_complex=True)
+    assert time[0].complex
+    npt.assert_allclose(TimeData(data[0], times, is_complex=True)._data,
+                        time[0]._data)
+
+
 def test_magic_setitem():
     """Test the setimtem for TimeData."""
     times = [0, .1, .3]
Repository: pyfar/pyfar
Pull request #677 (2024-08-30 05:49:12)

don't allow fractional octave smoothing for complex signals
### Which issue(s) are closed by this pull request?

Closes #

### Changes proposed in this pull request:

-
-
-



Patch:
diff --git a/pyfar/dsp/interpolation.py b/pyfar/dsp/interpolation.py
index 2ad0ec95..104700c4 100644
--- a/pyfar/dsp/interpolation.py
+++ b/pyfar/dsp/interpolation.py
@@ -52,6 +52,7 @@ def smooth_fractional_octave(signal, num_fractions, mode="magnitude_zerophase",
     2. Smooth the spectrum by convolution with a smoothing window
     3. Interpolate the spectrum to the original linear frequency scale
 
+    Smoothing of complex-valued time data is not implemented.
 
     Parameters
     ----------
@@ -155,6 +156,10 @@ def smooth_fractional_octave(signal, num_fractions, mode="magnitude_zerophase",
     if not isinstance(signal, pf.Signal):
         raise TypeError("Input signal has to be of type pyfar.Signal")
 
+    if type(signal) is not pf.FrequencyData and signal.complex:
+        raise TypeError(("Fractional octave smoothing for complex-valued "
+                         "time data is not implemented."))
+
     if mode in ["magnitude_zerophase", "magnitude"]:
         data = [np.atleast_2d(np.abs(signal.freq_raw))]
     elif mode == "complex":


Test patch:
diff --git a/tests/test_dsp_interpolation.py b/tests/test_dsp_interpolation.py
index fbd3930e..8d4c412a 100644
--- a/tests/test_dsp_interpolation.py
+++ b/tests/test_dsp_interpolation.py
@@ -25,6 +25,12 @@ def test_smooth_fractional_octave_assertions():
     with raises(ValueError, match="The smoothing width"):
         smooth_fractional_octave(pf.Signal([1, 0], 1), 1)
 
+    with raises(TypeError, match=("Fractional octave smoothing for "
+                                  "complex-valued time data is not "
+                                  "implemented.")):
+
+        smooth_fractional_octave(pf.Signal([1, 0], 1, is_complex=True), 1)
+
 
 @pytest.mark.parametrize("mode", (
     "magnitude_zerophase", "magnitude_phase", "magnitude", "complex"))
@@ -78,11 +84,11 @@ def test_smooth_fractional_octave_window_parameter():
     function
     """
 
-    _, window_paraeter = smooth_fractional_octave(pf.signals.impulse(64), 1)
+    _, window_parameter = smooth_fractional_octave(pf.signals.impulse(64), 1)
 
-    assert len(window_paraeter) == 2
-    assert isinstance(window_paraeter[0], int)
-    assert isinstance(window_paraeter[1], float)
+    assert len(window_parameter) == 2
+    assert isinstance(window_parameter[0], int)
+    assert isinstance(window_parameter[1], float)
 
 
 @pytest.mark.parametrize("amplitudes", (
Repository: pyfar/pyfar
Pull request #736 (2024-12-18 13:22:48)

return exact results for octave and third octave for limits out of range
return exact results for octave and third octave for limits out of range.

bug:
```
pf.dsp.filter.fractional_octave_frequencies(
    num_fractions=3, frequency_range=[20000, 96000])
```
returns
```
(array([20000.]), array([19952.62314969]))
```
is now fixed. if frequency_range is not in the standard range, just the exact solution is returned.


Patch:
diff --git a/pyfar/dsp/filter/fractional_octaves.py b/pyfar/dsp/filter/fractional_octaves.py
index 955fbfae..08fd8d24 100644
--- a/pyfar/dsp/filter/fractional_octaves.py
+++ b/pyfar/dsp/filter/fractional_octaves.py
@@ -30,9 +30,9 @@ def fractional_octave_frequencies(
     Returns
     -------
     nominal : array, float
-        The nominal center frequencies in Hz specified in the standard.
-        Nominal frequencies are only returned for octave bands and third octave
-        bands.
+        The nominal center frequencies are only defined for octave bands and
+        third octave bands in the range between 25 Hz and 20 kHz.
+        For all other cases, ``None`` is returned.
     exact : array, float
         The exact center frequencies in Hz, resulting in a uniform distribution
         of frequency bands over the frequency range.
@@ -50,7 +50,9 @@ def fractional_octave_frequencies(
         raise ValueError(
             "The second frequency needs to be higher than the first.")
 
-    if num_fractions in [1, 3]:
+    within_iec_limits = (f_lims[0] > 25*2**(-1/3)) and (
+        f_lims[1] < 20e3*2**(1/6))
+    if num_fractions in [1, 3] and within_iec_limits:
         nominal, exact = _center_frequencies_fractional_octaves_iec(
             num_fractions)
 


Test patch:
diff --git a/tests/test_fractional_octaves.py b/tests/test_fractional_octaves.py
index 6dcf569c..a8bc496e 100644
--- a/tests/test_fractional_octaves.py
+++ b/tests/test_fractional_octaves.py
@@ -73,6 +73,13 @@ def test_fractional_coeff_oct_filter_iec():
     assert actual.shape == (1, order, 6)
 
 
+def test_fractional_frequencies_non_iec():
+    actual_nominal, actual_exact = filter.fractional_octave_frequencies(
+        num_fractions=1, frequency_range=(4e3, 64e3))
+    npt.assert_allclose(actual_exact, [4e3, 8e3, 16e3, 32e3, 64e3])
+    assert actual_nominal is None
+
+
 def test_fract_oct_filter_iec():
     # Test only Filter object related stuff here, testing of coefficients is
     # done in separate test.