Giter Club home page Giter Club logo

Comments (10)

ottonemo avatar ottonemo commented on May 15, 2024 1

We linked most of the methods and decided that line breaks are not an issue important enough to leave this ticket open.

from skorch.

ottonemo avatar ottonemo commented on May 15, 2024

Is this still something we would want to do before releasing 0.2.0?

from skorch.

benjamin-work avatar benjamin-work commented on May 15, 2024

I'm fine with leaving it open for now

from skorch.

taketwo avatar taketwo commented on May 15, 2024

@benjamin-work Not clear what exactly you were referring to here. Is this perhaps fixed with #213 and #242? Or if not, please point me where the issues are and I'll send another PR.

from skorch.

benjamin-work avatar benjamin-work commented on May 15, 2024

The issue with the links on methods seems to be fixed.

Regarding the long lines: Look here at the Methods section. At the top, there is a table that lists all methods with their docstrings but without line breaks. Below, the methods are described again in a more readable fashion. I believe the table should be removed.

from skorch.

taketwo avatar taketwo commented on May 15, 2024

The table lists all the methods, including inherited. This may be useful to get a quick overview of all what a particular class has to offer. (Although the inherited methods are not hyperlinked, this makes it far less useful.)

The lack of line breaks is inconvenient, however it feels like the true issue is that the function names include arguments. This makes the first column too long, leaving very little space for the second. I think if this was corrected, then almost all docstrings would fit without scrolling. (And arguably those that don't fit should be simplified to be more concise.)

That being said, it seems like we anyway have no control over any of these with automodule directive.

One option would be to ditch automodule and compose documentation in a semi-automatic way (e.g. list classes and methods explicitly, but let automethod add docstrings). This is how PyTorch does it. I'm not sure how desirable this is given that it complicates maintenance.

from skorch.

benjamin-work avatar benjamin-work commented on May 15, 2024

Overall, these deficits in the docs are not a huge issue, if it takes too much work to mend them, then it's better to let it be.

the function names include arguments

If that could be fixed, we would already gain a lot.

those that don't fit should be simplified to be more concise

We should consider this. Are there any standards on how long the first part should be?

from skorch.

taketwo avatar taketwo commented on May 15, 2024

If that could be fixed, we would already gain a lot.

Again, no option is exposed to control that. Perhaps we can inject some javascript in the page template that would hide the arguments inside summary tables. If this is something you may consider, I can explore this possibility.

Are there any standards on how long the first part should be?

PEP 257 suggests one line:

The summary line may be used by automatic indexing tools; it is important that it fits on one line.

So does Google style guide:

A doc string should be organized as a summary line (one physical line) terminated by a period.

... and NumPy style guide:

A one-line summary that does not use variable names or the function name.

By the way, NumPy style (which skorch probably should follow being a part of scikit family) stipulates 75 characters long docstrings. From my observations, skorch docstrings seems to be formatted for 70 characters width.

from skorch.

BenjaminBossan avatar BenjaminBossan commented on May 15, 2024

The summary line may be used by automatic indexing tools; it is important that it fits on one line.

This is an ideal that is probably hard to keep up with in practice, but we should try.

skorch docstrings seems to be formatted for 70 characters width.

I believe this is something we don't enforce consciously yet.

In general, we may consider using black in the future for code formatting, once it becomes stable, especially since our code is mostly compliant anyway. However, I didn't see anything about line length in docstrings.

If this is something you may consider, I can explore this possibility.

I believe we have more urgent things to do at the moment. And I wouldn't want to be the one debugging javascript if it were to fail one day ;)

from skorch.

taketwo avatar taketwo commented on May 15, 2024

FWIW, this one-liner removes the arguments:

$('dl.class table.longtable.docutils td:first-child').contents().filter(function(){return this.nodeType === 3;}).remove()

Of course, this will break if Sphinx decides to change CSS class names, so I understand your reluctance to integrate a fix of this kind.

I suppose there are no actionable items in this issue then (besides from perhaps branching out another issue for future code formatting).

from skorch.

Related Issues (20)

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.