Giter Club home page Giter Club logo

clean.jl's People

Contributors

acstarr avatar akuhnregnier avatar dan-r95 avatar kwatmdphd avatar madhavajay avatar tcopple avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

clean.jl's Issues

Speed up cleaning julia notebook

Maybe, it is supposed to be so but it takes 2 minutes to clean a notebook with 5 non-empty Julia cells (and any other except an empty one)

$ time clean_ipynb 5\ Conditionals\ and\ Recursion.ipynb
5 Conditionals and Recursion.ipynb
clean_ipynb 5\ Conditionals\ and\ Recursion.ipynb  131,02s user 1,03s system 99% cpu 2:12,97 total

Version info:

  • clean_ipynb master branch
  • python-black 19.3b0-2
  • python-isort 4.3.21.2-1
  • julia 1.2.0
  • JuliaFormatter v0.1.19

Set up `JuliaFormatter.toml`

curl https://raw.githubusercontent.com/KwatMDPhD/ComputationalEnvironment.how/main/JuliaFormatter.toml > ~/.JuliaFormatter.toml

Fix printing

When run, always prints out: "๐Ÿ—‘๏ธ Emptying /var/folders/z_/r2n_rt396917fl9qm_t5h7jm0000gn/T/BioLab"

Screenshot 2023-04-21 at 16 51 58

Screenshot 2023-04-21 at 16 51 38

FTBS on Debian/Testing

Hi,
I've just tried to run the following command to install Clean.jl and I run into this error:

julia --project --eval "using Pkg; Pkg.instantiate()"
โ”Œ Error: Could not parse entry for `deps`
โ”” @ Pkg.Types /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/manifest.jl:146
ERROR: MethodError: no method matching get(::Pair{String,Any}, ::String, ::Nothing)
Closest candidates are:
  get(::REPL.Terminals.TTYTerminal, ::Any, ::Any) at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/REPL/src/Terminals.jl:161
  get(::Base.EnvDict, ::AbstractString, ::Any) at env.jl:80
  get(::IdDict{K,V}, ::Any, ::Any) where {K, V} at iddict.jl:86
  ...
Stacktrace:
 [1] Dict{Base.UUID,Pkg.Types.PackageEntry}(::Dict{String,Any}) at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/manifest.jl:135
 [2] read_manifest(::String) at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/manifest.jl:177
 [3] Pkg.Types.EnvCache(::Nothing) at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/Types.jl:299
 [4] EnvCache at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/Types.jl:279 [inlined]
 [5] Pkg.Types.Context() at ./util.jl:438
 [6] #instantiate#169 at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:791 [inlined]
 [7] instantiate() at /build/julia-CrxBG0/julia-1.5.3+dfsg/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:791
 [8] top-level scope at none:1

I'm a real newbie as Julia is concerned.
Any help would be great
Best

Build with CI/CD to ensure prs really work

continous delivery with travis CI etc. would ensure that a merged pull request is really working (from the syntax part)
and maybe this could be combined with hosting the package on pypi.org

First try of clean_ipynb

Traceback (most recent call last):
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/termui.py", line 372, in style
    bits.append('\033[%dm' % (_ansi_colors.index(fg) + 30))
ValueError: tuple.index(x): x not in tuple

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cls/anaconda3/bin/clean_ipynb", line 11, in <module>
    sys.exit(command_line_interface())
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/clean_ipynb/command_line_interface.py", line 27, in command_line_interface
    secho(ipynb_file_path, bg="black", fg="bright_green")
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/termui.py", line 420, in secho
    return echo(style(text, **styles), file=file, nl=nl, err=err, color=color)
  File "/Users/cls/anaconda3/lib/python3.7/site-packages/click/termui.py", line 374, in style
    raise TypeError('Unknown color %r' % fg)
TypeError: Unknown color 'bright_green'

IndexError: list index out of range

Hello, I want to use clean_ipynb.
But I am getting an error.
how to fix it?

clean_ipynb/clean_ipynb.py", line 120, in clean_ipynb_cell
    rem_extra_new_line = clean_lines[-2][:-1]

Support pluggable auto formatting of code blocks

My team uses https://pre-commit.com to automatically run linters and formatters on all of our code. I'm looking for something to run this on jupyter notebooks as well which is why I ran across your project.

As part of our pre-commit process we run

isort
autoflake
black
whitespace checks

it occurs to me that others may run different combinations of these. It would be great if your project could provide a way to generically run a set of linters on each notebook block.

Change Default Clear Output to False

@KwatME Most of the people who might want to use this tool actually are interested in formatting the python code aspects. Clearing the output might not be of their interest since once they push their code to repo / share their code somewhere they want to show their results too (i.e, plots or output's like accuracy etc.). Thus I think default should be not clearing output & clearing output can be enabled through flag

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.