question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Faulty outline on method organization

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Say you have a class with many methods, and the methods can be ‘grouped’ by adding ### Marker at the beginning of a line between 2 ‘sections’ of methods, then the outline is picking up on this, however the indentation (and the distinguishing between method and function) is not correct.

What steps reproduce the problem?

copy the following code fragment in a file, and look at what ‘Outline’ is making of it

# -*- coding: utf-8 -*-

class demo(object):
    
    def __init__(self):
        pass
    
    def foo(self):
        pass
    
### bars 1
    def bar10(self):
        pass
    
    def bar11(self):
        pass
    
    def bar12(self):
        pass

### bars 2
    def bar20(self):
        pass
    
    def bar21(self):
        pass
    
    def bar22(self):
        pass

What is the expected output? What do you see instead?

# bars 1 and # bars2 should reside one level deeper, under their demo class, and recognized as methods instead of functions now.

Paste Traceback/Error Below (if applicable)


PASTE TRACEBACK HERE

Versions

  • Spyder version: 4.1.1
  • Python version: Python 3.7.5 (default, Oct 31 2019, 15:18:51) [MSC v.1916 64 bit (AMD64)]
  • IPython version: IPython 7.13.0 (but probably not related)
  • Qt version: 5.9.6
  • PyQt version: PYQT_CONFIGURATION = {‘sip_flags’: ‘-t WS_WIN -t Qt_5_9_6’}
  • Operating System name/version: WIN10 (probably the same on OSX and Linux, but not tested by me yet)

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.1 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.3 (OK)
sphinx >=0.6.6                 :  2.4.0 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  0.29.15 (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.2 (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  1.5.1 (OK)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
bcolsencommented, Mar 30, 2020

I’ll have a look at the code.

0reactions
bcolsencommented, May 5, 2020

@KardoPaska If you want to see how the fix is going. I could use some help in testing my https://github.com/spyder-ide/spyder/pull/12343

Read more comments on GitHub >

github_iconTop Results From Across the Web

Design Flaws to Avoid - Organizing Your Social Sciences ...
Your paper should outline and explicitly delimit the problem and state what you intend to investigate since it will determine what research ...
Read more >
Patterns of Organization and Methods of Development
The problem-solution pattern is commonly used in identifying something that's wrong and in contemplating what might be done to remedy the situation. There...
Read more >
Strategies for Learning from Failure - Harvard Business Review
All organizations learn from failure through three essential activities: detection, analysis, and experimentation. Detecting Failure. Spotting big, painful, ...
Read more >
8-Step Problem Solving Process | University Human Resources
Step 1: Define the Problem · What is the problem? · How did you discover the problem? · When did the problem start...
Read more >
The Six Step Problem Solving Model
Problem solving models are used to address the many challenges that arise in ... The Six-Step method provides a focused procedure for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found