Giter Site home page Giter Site logo

Comments (8)

jshwi avatar jshwi commented on May 30, 2024 1

Hi @JenniferHem, thank you for opening this issue, appears to be a problem with the way indents are handled with numpy style docs, I'll look into this as soon as I can

from docsig.

jshwi avatar jshwi commented on May 30, 2024 1

Hi @JenniferHem

The result is quite confusing, I understand
As the param was not even parsed due to the indentation it resulted in a missing parameter
The None value was parsed after iterating through the longest so it also resulted in an incorrect error for ordering
A new error has been added

E115: syntax error in description

Which gives you more control over this result
If you don't care about syntax errors in the description you can disable the check
This is available with ^0.26.0

Thanks again πŸ˜„

from docsig.

jshwi avatar jshwi commented on May 30, 2024

Hi @JenniferHem

The numpy parser was too strict with indents and whitespace

Those examples now pass and you can clone or pip install docsig==0.23.2

If you find anything else please keep opening issues or PRs so long as you find use for this! I don't use numpy style, so issues like this help a lot

from docsig.

jshwi avatar jshwi commented on May 30, 2024

@JenniferHem.
numpy was pretty buggy and not very usable, you should see some positive results with the latest version (v0.24.0), It's at least as usable as RST, which works well for me

from docsig.

JenniferHem avatar JenniferHem commented on May 30, 2024

I can confirm that your fixes solved the mentioned errors and I see it working as expected. Thank you very much for the quick fix(es)!

from docsig.

JenniferHem avatar JenniferHem commented on May 30, 2024

Okay not sure if it is intended so not re-opening I just saw an issue with:

def check_stuff(str_lin: str, a: str) -> bool:
    """Check if "A" or "B".

    The function checks wether the string is "A" or "B".

    Parameters
    ----------
    str_lin: str
        special string produced by function_of_y ["a"]
            a second wrong indent line
    a: str
        string stuff

    Returns
    -------
    bool
        Returns True, else false
    """
    if any(s in str_lin for s in ["A", "B"]):
        return True
    return False

Here I get the error:

def check_stuff(βœ–str_lin, βœ–a) -> βœ“bool:
    """...

    :param a: βœ–
    :param None: βœ–
    :return: βœ“
    """

E103: parameters missing
hint: there appears to be a syntax error that could be causing this
E101: parameters out of order

which definitely helped me to spot the wrong indent.

I am just not 100% sure if the indent should cause this (might be specific functionalities of docs related that I am not aware?) or if this should not fail when parsing?

This is definitely a style problem which should not occur, just thought I'd run it by you to get your opinion how you want to handle this!

from docsig.

JenniferHem avatar JenniferHem commented on May 30, 2024

Amazing thanks!

from docsig.

jshwi avatar jshwi commented on May 30, 2024

No worries @JenniferHem, happy you have found this useful πŸ˜„

from docsig.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.