Skip to content

Commit

Permalink
Apply ruff/pycodestyle rule E402 to notebooks
Browse files Browse the repository at this point in the history
E402 Module level import not at top of cell
  • Loading branch information
DimitriPapadopoulos committed Aug 28, 2024
1 parent 72b1b24 commit cc7e1f9
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 30 deletions.
5 changes: 3 additions & 2 deletions notebooks/advanced_indexing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
}
],
"source": [
"import cProfile\n",
"import sys\n",
"\n",
"sys.path.insert(0, '..')\n",
"import numpy as np\n",
"\n",
"sys.path.insert(0, '..')\n",
"\n",
"import zarr\n",
"\n",
"np.random.seed(42)\n",
"import cProfile\n",
"\n",
"zarr.__version__"
]
Expand Down
10 changes: 7 additions & 3 deletions notebooks/dask_2d_subset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
}
],
"source": [
"import zarr; print('zarr', zarr.__version__)\n",
"import dask; print('dask', dask.__version__)\n",
"import numpy as np"
"import dask\n",
"import numpy as np\n",
"\n",
"import zarr\n",
"\n",
"print('zarr', zarr.__version__)\n",
"print('dask', dask.__version__)\n"
]
},
{
Expand Down
19 changes: 10 additions & 9 deletions notebooks/dask_copy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,26 @@
}
],
"source": [
"import multiprocessing\n",
"import sys\n",
"\n",
"import bcolz\n",
"import dask.array as da\n",
"import h5py\n",
"import numpy as np\n",
"from bokeh.io import output_notebook\n",
"from dask.diagnostics import Profiler, ResourceProfiler\n",
"from dask.diagnostics.profile_visualize import visualize\n",
"\n",
"sys.path.insert(0, '..')\n",
"\n",
"import zarr\n",
"\n",
"print('zarr', zarr.__version__)\n",
"import bcolz\n",
"import h5py\n",
"import numpy as np\n",
"\n",
"# don't let bcolz use multiple threads internally, we want to\n",
"# see whether dask can make good use of multiple CPUs\n",
"bcolz.set_nthreads(1)\n",
"import multiprocessing\n",
"\n",
"import dask.array as da\n",
"from bokeh.io import output_notebook\n",
"from dask.diagnostics import Profiler, ResourceProfiler\n",
"from dask.diagnostics.profile_visualize import visualize\n",
"\n",
"output_notebook()"
]
Expand Down
13 changes: 7 additions & 6 deletions notebooks/dask_count_alleles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,18 @@
"source": [
"import sys\n",
"\n",
"sys.path.insert(0, '..')\n",
"import zarr\n",
"\n",
"print('zarr', zarr.__version__)\n",
"import allel\n",
"import h5py\n",
"from bokeh.io import output_notebook\n",
"from dask.diagnostics import Profiler, ResourceProfiler\n",
"from dask.diagnostics.profile_visualize import visualize\n",
"\n",
"output_notebook()\n",
"import allel"
"sys.path.insert(0, '..')\n",
"\n",
"import zarr\n",
"\n",
"print('zarr', zarr.__version__)\n",
"output_notebook()"
]
},
{
Expand Down
20 changes: 10 additions & 10 deletions notebooks/genotype_benchmark_compressors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
}
],
"source": [
"import sys\n",
"\n",
"sys.path.insert(0, '..')\n",
"import functools\n",
"import sys\n",
"import timeit\n",
"\n",
"import zarr\n",
"\n",
"print('zarr', zarr.__version__)\n",
"from zarr import blosc\n",
"\n",
"print('blosc', blosc.version())\n",
"import h5py\n",
"import numpy as np\n",
"\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt"
"import matplotlib.pyplot as plt\n",
"\n",
"sys.path.insert(0, '..')\n",
"\n",
"import zarr\n",
"from zarr import blosc\n",
"\n",
"print('zarr', zarr.__version__)\n",
"print('blosc', blosc.version())"
]
},
{
Expand Down

0 comments on commit cc7e1f9

Please sign in to comment.