Python Bytes
Python Bytes
Sep 15, 2021
#250 skorch your scikit-learn together with PyTorch
Play • 42 min

Watch the live stream:

Watch on YouTube

About the show

Sponsored by us:

Special guest: Prayson Daniel

Brian #1: Exciting New Ways To Be Told That Your Python Code is Bad

  • Two new pylint errors
    • consider-ternary-expression
    if condition():
        x = 4
    else:
        x = 5
    x = 4 if condition() else 5
  • while-used
    • it unconditionally flags every use of while expressions.
    • generally, while should be avoided.

Michael #2: GitHub Readme Stats

Prayson #3: Nox

  • Nox appeared as “footnotes” in Episodes 182 and 248 (Hypermodern Python …)
  • It does tox what invoke did (substituting GNU Make)

Brian #4: Two tools for dealing with text

  • python-easyfrontmatter - a small package to load and parse files (or just text) with YAML (or JSON, TOML or other) front matter.
    >>> post = frontmatter.load('tests/yaml/hello-world.txt')
    >>> print(post['title'])
    Hello, world!
  • Tried it with a helper script I’m using with Hugo, and it parses Hugo metadata in blog posts like a dream.
  • ftfy - fixes text for you
  • “Take in bad Unicode and output good Unicode”
    >>> import ftfy
    >>> ftfy.fix_text('✔ No problems')
    '✔ No problems'

Michael #5: MPIRE (MultiProcessing Is Really Easy)

  • A Python package for easy multiprocessing, but faster than multiprocessing
  • It combines the
  • convenience of map like functions of multiprocessing.Pool
  • with the benefits of using copy-on-write shared objects of multiprocessing.Process,
  • together with easy-to-use worker state, worker insights, and progress bar functionality.
  • Many features
  • Requisite shoutout to unsync too.

Prayson #6: skorch

Extras

Michael

Prayson

Joke: Adoption

More episodes
Search
Clear search
Close search
Google apps
Main menu