SWE for DS
- Tests
- Basic how to with pytest
- Directory and naming structure
- Run from CLI
- How to run specific tests
- Test coverage
- Gotchas around package structure and pycache
- Basic how to with pytest
- Some intro test principles
SWE for DS
| # Run like | |
| # gifify image_names_* awesome_movie.gif | |
| # where you glob the list of images as the first argument | |
| # then the last argument is the name of the output gif | |
| alias gifify='python -c "import imageio;import sys;ims=[]; *in_, out=sys.argv[1:];[ims.append(imageio.imread(i)) for i in sorted(in_)];imageio.mimsave(out,ims)"' |
| import numpy as np | |
| """Stacking as we loop""" | |
| %%timeit -n 10 | |
| res = None | |
| for i in range(100): | |
| batch = np.random.random((100, 100)) | |
| if res is None: | |
| res = batch |
| from time import time | |
| import pandas as pd | |
| import torch | |
| from torch import nn | |
| from torch.nn import functional as F | |
| from torch.autograd import Variable | |