internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: kymatio/kymatio

Issue:
RELEASE requirements?
Hi,

When doing:

```
conda install pytorch torchvision -c pytorch
pip install -i https://test.pypi.org/simple/ kymatio
```

then cloning the corresponding release, and doing `pytest`, I have tons of errors that are evidences that none of the requirements.txt packages are installed. Actually, this makes me think we should have a pip for the GPU version(like `pip install kymatio-gpu`)?

https://github.com/kymatio/kymatio/blob/master/requirements.txt


Discussion:
Solved:

The good command was:

 pip install --extra-index-url https://test.pypi.org/pypi/ kymatio

I believe we should also add a kymatio-gpu repo to pypi.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@
 # Constants
 DISTNAME = 'kymatio'
 DESCRIPTION = 'Wavelet scattering transforms in Python with GPU acceleration'
-URL = 'https://kymatio.github.io'
+URL = 'https://www.kymat.io'
 LICENSE = 'BSD-3-Clause'
 
 
@@ -47,15 +47,18 @@
                   'tomas.angles@ens.fr, gabriel.huang@umontreal.ca, roberto.leonarduzzi@ens.fr'),
     url=URL,
     download_url='https://github.com/kymatio/kymatio/releases',
+    project_urls={
+        'Documentation': 'https://www.kymat.io/codereference.html',
+        'Source': 'https://github.com/kymatio/kymatio/',
+        'Tracker': 'https://github.com/kymatio/kymatio/issues',
+        'Authors': 'https://github.com/kymatio/kymatio/blob/master/AUTHORS.md'
+    },
     classifiers=['Intended Audience :: Education',
                  'Intended Audience :: Science/Research',
                  'License :: OSI Approved :: BSD License',
                  'Natural Language :: English',
                  'Operating System :: MacOS',
-                 'Operating System :: Microsoft :: Windows',
                  'Operating System :: POSIX :: Linux',
-                 'Programming Language :: Python :: 3.4',
-                 'Programming Language :: Python :: 3.5',
                  'Programming Language :: Python :: 3.6',
                  'Programming Language :: Python :: 3.7',
                  'Programming Language :: Python :: 3.8',
@@ -72,6 +75,7 @@
     description=DESCRIPTION,
     long_description=LONG_DESCRIPTION,
     long_description_content_type='text/markdown',
+    python_requires='>=3.6',
     license=LICENSE,
     packages=find_packages(exclude=('test',)),
     install_requires=REQUIREMENTS,


Test patch:
Repository: kymatio/kymatio

Issue:
BUG 3D benchmark fails on GPU
It doesn't call the `cuda()` function (now required) when giving a CUDA tensor input, so the scattering transform errors.


Discussion:

Resolving patch:
diff --git a/examples/3d/compute_speed.py b/examples/3d/compute_speed.py
--- a/examples/3d/compute_speed.py
+++ b/examples/3d/compute_speed.py
@@ -97,8 +97,10 @@
     print(fmt_str.format(backend.NAME, device.upper()))
 
     if device == 'gpu':
+        scattering.cuda()
         x = x.cuda()
     else:
+        scattering.cpu()
         x = x.cpu()
 
     scattering.method = 'integral'


Test patch:
Repository: kymatio/kymatio

Issue:
DOC 3D benchmarks
Currently none are listed in the user's guide. We should probably include something here.


Discussion:

Resolving patch:
diff --git a/kymatio/scattering2d/scattering2d.py b/kymatio/scattering2d/scattering2d.py
--- a/kymatio/scattering2d/scattering2d.py
+++ b/kymatio/scattering2d/scattering2d.py
@@ -34,9 +34,9 @@ class Scattering2D(object):
     Example
     -------
         # 1) Define a Scattering object as:
-        s = Scattering2D(J, M, N)
+        s = Scattering2D(J, shape=(M, N))
         #    where (M, N) are the image sizes and 2**J the scale of the scattering
-        # 2) Forward on an input Variable x of shape B x 1 x M x N,
+        # 2) Forward on an input Tensor x of shape B x M x N,
         #     where B is the batch size.
         result_s = s(x)
 


Test patch:
Repository: kymatio/kymatio

Issue:
BUG 1D scattering does not respect `max_order`
Specifically, if we set `max_order = 1`, it creates the same size output as for `max_order = 2`, but fills the remaining elements with zero.


Discussion:

Resolving patch:
diff --git a/kymatio/scattering1d/scattering1d.py b/kymatio/scattering1d/scattering1d.py
--- a/kymatio/scattering1d/scattering1d.py
+++ b/kymatio/scattering1d/scattering1d.py
@@ -511,7 +511,10 @@ def precompute_size_scattering(J, Q, max_order=2, detail=False):
                 if j2[n2] > j1[n1]:
                     size_order2 += 1
         if detail:
-            return size_order0, size_order1, size_order2
+            if max_order == 2:
+                return size_order0, size_order1, size_order2
+            else:
+                return size_order0, size_order1
         else:
             if max_order == 2:
                 return size_order0 + size_order1 + size_order2
@@ -654,7 +657,8 @@ def scattering(x, psi1, psi2, phi, J, pad_left=0, pad_right=0,
         # initialize the cursor
         cc = [0] + list(size_scattering[:-1])  # current coordinate
         cc[1] = cc[0] + cc[1]
-        cc[2] = cc[1] + cc[2]
+        if max_order == 2:
+            cc[2] = cc[1] + cc[2]
     # Get S0
     k0 = max(J - oversampling, 0)
     if average:


Test patch:
Repository: kymatio/kymatio

Issue:
ENH torch backend does not error for non-complex inputs
This is what the skcuda backend does, so we should be consistent.


Discussion:

Resolving patch:
diff --git a/kymatio/scattering1d/backend/backend_skcuda.py b/kymatio/scattering1d/backend/backend_skcuda.py
--- a/kymatio/scattering1d/backend/backend_skcuda.py
+++ b/kymatio/scattering1d/backend/backend_skcuda.py
@@ -151,11 +151,11 @@ def __call__(self, input, k):
         if not input.is_cuda and self.backend == 'skcuda':
             raise RuntimeError('Use the torch backend for cpu tensors!')
 
-        out = input.new(input.size(0), input.size(1), input.size(2) // k, 2)
-
         if not is_complex(input):
             raise (TypeError('The input and outputs should be complex'))
 
+        out = input.new(input.size(0), input.size(1), input.size(2) // k, 2)
+
         input = input.contiguous()
 
         kernel = '''
diff --git a/kymatio/scattering1d/backend/backend_torch.py b/kymatio/scattering1d/backend/backend_torch.py
--- a/kymatio/scattering1d/backend/backend_torch.py
+++ b/kymatio/scattering1d/backend/backend_torch.py
@@ -7,6 +7,9 @@
 
 NAME = 'torch'
 
+def is_complex(input):
+    return input.size(-1) == 2
+
 class ModulusStable(Function):
     """Stable complex modulus
 
@@ -125,6 +128,9 @@ def modulus_complex(x):
         A tensor with the same dimensions as x, such that res[..., 0] contains
         the complex modulus of x, while res[..., 1] = 0.
     """
+    if not is_complex(x):
+        raise TypeError('The input should be complex.')
+
     norm = modulus(x)
 
     res = torch.zeros_like(x)
@@ -155,6 +161,9 @@ def subsample_fourier(x, k):
         The input tensor periodized along the next to last axis to yield a
         tensor of size x.shape[-2] // k along that dimension.
     """
+    if not is_complex(x):
+        raise TypeError('The input should be complex.')
+
     N = x.shape[-2]
     res = x.view(x.shape[:-2] + (k, N // k, 2)).mean(dim=-3)
     return res


Test patch:
Repository: kymatio/kymatio

Issue:
BUG `scattering3d_qm7.py` crashes on GPU
The input is on the GPU, but the scattering object has not been put in GPU mode, see https://github.com/kymatio/kymatio/blob/master/examples/3d/scattering3d_qm7.py#L212.


Discussion:

Resolving patch:
diff --git a/examples/3d/scattering3d_qm7.py b/examples/3d/scattering3d_qm7.py
--- a/examples/3d/scattering3d_qm7.py
+++ b/examples/3d/scattering3d_qm7.py
@@ -166,16 +166,17 @@ def compute_qm7_solid_harmonic_scattering_coefficients(
             axes=(1, 2, 3)))
     pos, full_charges, valence_charges = get_qm7_positions_and_charges(sigma)
 
+    n_molecules = pos.size(0)
+    n_batches = np.ceil(n_molecules / batch_size).astype(int)
+
+    scattering = HarmonicScattering3D(J=J, shape=(M, N, O), L=L, sigma_0=sigma)
+
     if cuda:
         grid = grid.cuda()
         pos = pos.cuda()
         full_charges = full_charges.cuda()
         valence_charges = valence_charges.cuda()
-
-    n_molecules = pos.size(0)
-    n_batches = np.ceil(n_molecules / batch_size).astype(int)
-
-    scattering = HarmonicScattering3D(J=J, shape=(M, N, O), L=L, sigma_0=sigma)
+        scattering.cuda()
 
     order_0, order_1, order_2 = [], [], []
     print('Computing solid harmonic scattering coefficients of {} molecules '


Test patch:
Repository: kymatio/kymatio

Issue:
BUG Encoding issues
I'm getting encoding issues when trying to build the docs (on my laptop [Ubuntu], but not on my desktop [CentOS]). Looks like the reason is that someone has accents in their name...

One solution would be to explicitly define the source files to be UTF-8 (which they are, from what I understand). Another would be to remove the accents.


Discussion:
Right, I think that the necessary header is


 ```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
```
Yes, but for one (two?) stinking accents in two files (`scattering1d.py` and `setup.py`)? For `setup.py`, sure, since that exports to PyPI, but for the rest, it seems overkill.

I suggest removing accents in `scattering1d.py` and adding the encoding to `setup.py`.
To clarify, "overkill" because if we do it to `scattering1d.py`, we should be consistent and have it in all source files. `setup.py` is "different" enough that we can have a different format for it.

Resolving patch:
diff --git a/kymatio/scattering1d/scattering1d.py b/kymatio/scattering1d/scattering1d.py
--- a/kymatio/scattering1d/scattering1d.py
+++ b/kymatio/scattering1d/scattering1d.py
@@ -1,5 +1,5 @@
-# Authors: Mathieu Andreux, Joakim Andén, Edouard Oyallon
-# Scientific Ancestry: Joakim Andén, Mathieu Andreux, Vincent Lostanlen
+# Authors: Mathieu Andreux, Joakim Anden, Edouard Oyallon
+# Scientific Ancestry: Joakim Anden, Mathieu Andreux, Vincent Lostanlen
 
 import math
 import numbers
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
 import csv
 import importlib
 import os


Test patch:
Repository: kymatio/kymatio

Issue:
BUG scattering3d_qm7.py
It seems that line 180 should be modified as follows:
Current:
order_0, order_1, order_2 = [], [], []
Should be:
order_0, orders_1_and_2 = [], []


Discussion:
Upon checking, you are right:
https://github.com/kymatio/kymatio/blob/master/examples/3d/scattering3d_qm7.py#L180

Could you please open a PR?

Resolving patch:
diff --git a/examples/3d/scattering3d_qm7.py b/examples/3d/scattering3d_qm7.py
--- a/examples/3d/scattering3d_qm7.py
+++ b/examples/3d/scattering3d_qm7.py
@@ -88,7 +88,7 @@ def get_qm7_positions_and_charges(sigma, overlapping_precision=1e-1):
     """
         Loads the positions and charges of the molecules of the QM7 dataset.
         QM7 is a dataset of 7165 organic molecules with up to 7 non-hydrogen
-        atoms, whose energies were computed with a quantun chemistry
+        atoms, whose energies were computed with a quantum chemistry
         computational method named Density Functional Theory.
         This dataset has been made available to train machine learning models
         to predict these energies.
@@ -178,7 +178,7 @@ def compute_qm7_solid_harmonic_scattering_coefficients(
         valence_charges = valence_charges.cuda()
         scattering.cuda()
 
-    order_0, order_1, order_2 = [], [], []
+    order_0, orders_1_and_2 = [], []
     print('Computing solid harmonic scattering coefficients of {} molecules '
         'of QM7 database on {}'.format(pos.size(0), 'GPU' if cuda else 'CPU'))
     print('sigma: {}, L: {}, J: {}, integral powers: {}'.format(sigma, L, J, integral_powers))


Test patch:
Repository: kymatio/kymatio

Issue:
Unused 2D Psi filters
The generated 2D filterbank includes filters that are not used in the computation.

Let's create a scattering transform:
```
>>> import kymatio
>>> s = kymatio.Scattering2D(J=2, shape=(32, 32))
```

Let's look at the shapes of the generated filters:
```
>>> print("\n".join('{' + ', '.join('%s: %s' % (k, getattr(v, 'shape', v)) for k, v in psi.items()) + '}' for psi in s.Psi))
{j: 0, theta: 0, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 1, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 2, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 3, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 4, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 5, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 6, 0: torch.Size([40, 40, 2])}
{j: 0, theta: 7, 0: torch.Size([40, 40, 2])}
{j: 1, theta: 0, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 1, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 2, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 3, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 4, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 5, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 6, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
{j: 1, theta: 7, 0: torch.Size([40, 40, 2]), 1: torch.Size([20, 20, 2])}
```

The 20x20 filters are all unused. Demonstration:
```
>>> for p in s.Psi:
...     if 1 in p:
...        p[1] = 'foo'
...
>>> import torch
>>> x = torch.rand((1, 1, 32, 32)).cuda()
>>> s = s.cuda()
>>> y = s(x)
```

They should probably not be part of the filterbank in the first place?


Discussion:
Can you please try the same with `J=3` or `J=4`?
@f0k Thank you for bringing this up. You're right, those filters should not have been created.

@lostanlen, I think the issue here is that the lowest-resolution filters are never used. So for `J=3`, it creates the `2`-resolution filters which are never used. It's an off-by-one.
Yes, I was thinking the same thing. It looks more like an off-by-one overestimation than a missed conditional branch.

Resolving patch:
diff --git a/kymatio/scattering2d/filter_bank.py b/kymatio/scattering2d/filter_bank.py
--- a/kymatio/scattering2d/filter_bank.py
+++ b/kymatio/scattering2d/filter_bank.py
@@ -46,7 +46,7 @@ def filter_bank(M, N, J, L=8):
                 (int(L-L/2-1)-theta) * np.pi / L,
                 3.0 / 4.0 * np.pi /2**j, 4.0/L, offset=offset_unpad)
             psi_signal_fourier = fft2(psi_signal)
-            for res in range(j + 1):
+            for res in range(min(j + 1, J - 1)):
                 psi_signal_fourier_res = periodize_filter_fft(
                     psi_signal_fourier, res)
                 psi[res] = torch.FloatTensor(


Test patch:
Repository: kymatio/kymatio

Issue:
Unused `fftshift` option
In the `gabor_2d` function, we have an [`fftshift` argument](https://github.com/kymatio/kymatio/blob/02f31a7824011ef7c7c1145342473d32a1133b51/kymatio/scattering2d/filter_bank.py#L196) that is never used. Is there a reason for keeping this?


Discussion:

Resolving patch:
diff --git a/kymatio/scattering2d/filter_bank.py b/kymatio/scattering2d/filter_bank.py
--- a/kymatio/scattering2d/filter_bank.py
+++ b/kymatio/scattering2d/filter_bank.py
@@ -108,7 +108,7 @@ def periodize_filter_fft(x, res):
     return crop
 
 
-def morlet_2d(M, N, sigma, theta, xi, slant=0.5, offset=0, fft_shift=False):
+def morlet_2d(M, N, sigma, theta, xi, slant=0.5, offset=0):
     """
         Computes a 2D Morlet filter.
         A Morlet filter is the sum of a Gabor filter and a low-pass filter
@@ -132,23 +132,21 @@ def morlet_2d(M, N, sigma, theta, xi, slant=0.5, offset=0, fft_shift=False):
             parameter which guides the elipsoidal shape of the morlet
         offset : int, optional
             offset by which the signal starts
-        fft_shift : boolean
-            if true, shift the signal in a numpy style
 
         Returns
         -------
         morlet_fft : ndarray
             numpy array of size (M, N)
     """
-    wv = gabor_2d(M, N, sigma, theta, xi, slant, offset, fft_shift)
-    wv_modulus = gabor_2d(M, N, sigma, theta, 0, slant, offset, fft_shift)
+    wv = gabor_2d(M, N, sigma, theta, xi, slant, offset)
+    wv_modulus = gabor_2d(M, N, sigma, theta, 0, slant, offset)
     K = np.sum(wv) / np.sum(wv_modulus)
 
     mor = wv - K * wv_modulus
     return mor
 
 
-def gabor_2d(M, N, sigma, theta, xi, slant=1.0, offset=0, fft_shift=False):
+def gabor_2d(M, N, sigma, theta, xi, slant=1.0, offset=0):
     """
         Computes a 2D Gabor filter.
         A Gabor filter is defined by the following formula in space:
@@ -169,8 +167,6 @@ def gabor_2d(M, N, sigma, theta, xi, slant=1.0, offset=0, fft_shift=False):
             parameter which guides the elipsoidal shape of the morlet
         offset : int, optional
             offset by which the signal starts
-        fft_shift : boolean
-            if true, shift the signal in a numpy style
 
         Returns
         -------
@@ -192,7 +188,4 @@ def gabor_2d(M, N, sigma, theta, xi, slant=1.0, offset=0, fft_shift=False):
 
     norm_factor = (2 * 3.1415 * sigma * sigma / slant)
     gab = gab / norm_factor
-
-    if (fft_shift):
-        gab = np.fft.fftshift(gab, axes=(0, 1))
     return gab


Test patch:
Repository: kymatio/kymatio

Issue:
ENH+TST find a way of testing GPU code
With not too much investment in 💲 💰  it should be possible to set up a `jenkins` testing suite on amazon aws: The idea is to have a micro machine that costs 1c/h run the jenkins server. When tests should be run, this should somehow spawn a couple of GPU machines with different GPUs, ideally as spot instances, run the tests and then shut them down again.
I looked into this at the very beginning of `kymatio`, but I don't really know how to set this up yet. If anybody has experience with this, feel free to try! :)


Discussion:
Is there not some way to do this locally? We all have access to GPUs. It would be infinitely cheaper!
Definitely -- `jenkins` can be set up anywhere
Ok. I know people have used that here. Will ask.
Do we have some fundings for this? @janden @eugenium @eickenberg @louity 
Haven't had time to look into this yet.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@
 
 
 # Parse description
-with open('README.md') as f:
+with open('README.md', encoding='utf8') as f:
     README = f.read().split('\n')
     LONG_DESCRIPTION = '\n'.join([x for x in README if not x[:3]=='[!['])
 


Test patch:
Repository: kymatio/kymatio

Issue:
`cdgmm` doesn't check that both inputs are on the same device
This is at least true for the 2D torch `cdgmm`. It only complains when you try to multiply tensors. We should throw an error instead.


Discussion:
This seems to be the case for all the other `cdgmm`s as well.
For this specific case, as this routine is common between 1-2-3D, this could be done jointly with #261?
I think we should do #261 first, then this one. Will be easier that way. Might make sense to do them in the same PR, though.

Resolving patch:
diff --git a/kymatio/scattering2d/backend/backend_skcuda.py b/kymatio/scattering2d/backend/backend_skcuda.py
--- a/kymatio/scattering2d/backend/backend_skcuda.py
+++ b/kymatio/scattering2d/backend/backend_skcuda.py
@@ -302,8 +302,12 @@ def cdgmm(A, B, inplace=False):
     if A.dtype is not B.dtype:
         raise RuntimeError('A and B must be of the same dtype')
 
-    if A.device != B.device:
-        raise RuntimeError('A and B must be on the same device')
+    if A.device.type != B.device.type:
+        raise RuntimeError('A and B must be of the same device type')
+
+    if A.device.type == 'cuda':
+        if A.device.index != B.device.index:
+            raise RuntimeError('A and B must be on the same GPU!')
 
     if isreal(B):
         if inplace:
diff --git a/kymatio/scattering2d/backend/backend_torch.py b/kymatio/scattering2d/backend/backend_torch.py
--- a/kymatio/scattering2d/backend/backend_torch.py
+++ b/kymatio/scattering2d/backend/backend_torch.py
@@ -211,8 +211,12 @@ def cdgmm(A, B, inplace=False):
     if A.dtype is not B.dtype:
         raise RuntimeError('A and B must be of the same dtype')
 
-    if A.device != B.device:
-        raise RuntimeError('A and B must be on the same device')
+    if A.device.type != B.device.type:
+        raise RuntimeError('A and B must be of the same device type')
+
+    if A.device.type == 'cuda':
+        if A.device.index != B.device.index:
+            raise RuntimeError('A and B must be on the same GPU!')
 
     if isreal(B):
         if inplace:


Test patch:
Repository: kymatio/kymatio

Issue:
DOC circle.ci is failing
```
ModuleNotFoundError: No module named 'tensorflow'
ModuleNotFoundError: No module named 'kymatio.scattering3d.core'
WARNING: autodoc: failed to import module 'numpy' from module 'kymatio'; the following exception was raised:
```

https://circleci.com/gh/kymatio/kymatio/147#tests/containers/0


Discussion:

Resolving patch:
diff --git a/examples/1d/plot_real_signal.py b/examples/1d/plot_real_signal.py
--- a/examples/1d/plot_real_signal.py
+++ b/examples/1d/plot_real_signal.py
@@ -12,6 +12,7 @@
 #
 ###############################################################################
 # To handle audio file I/O, we import `os` and `scipy.io.wavfile`.
+
 import numpy as np
 import os
 import scipy.io.wavfile
diff --git a/kymatio/scattering3d/core/__init__.py b/kymatio/scattering3d/core/__init__.py
new file mode 100644


Test patch:
Repository: kymatio/kymatio

Issue:
sphinx inverses colors...
no clue why, but it can wait v3.

cf here:
https://www.kymat.io/gallery_2d/plot_scattering_disk.html#sphx-glr-gallery-2d-plot-scattering-disk-py
https://www.kymat.io/gallery_2d/plot_invert_scattering_torch.html#sphx-glr-gallery-2d-plot-invert-scattering-torch-py


Discussion:
@MuawizChaudhary would be nice to fix.
@edouardoyallon can you paste an image and explain which part exactly is inverted?
For the racoon, part of the issue is that the optimization hasn't converged. Should I increase max_iter, the maximum number of iterations?

Resolving patch:
diff --git a/examples/2d/plot_invert_scattering_torch.py b/examples/2d/plot_invert_scattering_torch.py
--- a/examples/2d/plot_invert_scattering_torch.py
+++ b/examples/2d/plot_invert_scattering_torch.py
@@ -32,7 +32,7 @@
 plt.title("Original image")
 
 src_img = np.moveaxis(src_img, -1, 0)  # HWC to CHW
-max_iter = 5 # number of steps for the GD
+max_iter = 15 # number of steps for the GD
 print("Image shape: ", src_img.shape)
 channels, height, width = src_img.shape
 
diff --git a/examples/2d/plot_scattering_disk.py b/examples/2d/plot_scattering_disk.py
--- a/examples/2d/plot_scattering_disk.py
+++ b/examples/2d/plot_scattering_disk.py
@@ -74,7 +74,7 @@
 
 fig,ax = plt.subplots()
 
-plt.imshow(1-src_img,cmap='gray',interpolation='nearest', aspect='auto')
+plt.imshow(src_img,cmap='gray',interpolation='nearest', aspect='auto')
 ax.axis('off')
 offset = 0.1
 for row in range(window_rows):


Test patch:
Repository: kymatio/kymatio

Issue:
Looks good but we're now missing docstring for `N`, `J` in `scattering_filter_factory`.
Looks good but we're now missing docstring for `N`, `J` in `scattering_filter_factory`.

_Originally posted by @janden in https://github.com/kymatio/kymatio/pull/863#pullrequestreview-1012149453_

So these docstrings need to be added.


Discussion:

Resolving patch:
diff --git a/kymatio/scattering1d/filter_bank.py b/kymatio/scattering1d/filter_bank.py
--- a/kymatio/scattering1d/filter_bank.py
+++ b/kymatio/scattering1d/filter_bank.py
@@ -354,6 +354,12 @@ def scattering_filter_factory(N, J, Q, T, r_psi=math.sqrt(0.5),
 
     Parameters
     ----------
+    N : int
+        padded length of the input signal. Corresponds to self._N_padded for the
+        scattering object.
+    J : int
+        log-scale of the scattering transform, such that wavelets of both
+        filterbanks have a maximal support that is proportional to 2**J.
     Q : tuple
         number of wavelets per octave at the first and second order 
         Q = (Q1, Q2). Q1 and Q2 are both int >= 1.


Test patch: