Box-X is a Tool-box for Efficient Build and Debug in Python.
Especially for Scientific Computing and Computer Vision.
So, all Tools are divided into 2 parts by wether the tool is general used:
General Python Tool: Tools could be used anywhere in Python
Scientific Computing and Computer Vision Tool: Those tools are useful in Scientific Computing and Computer Vision field
boxx supports both
Python 2/3 on
Linux | macOS | Windows with
CPython | IPython | Spyder | Notebook environment.
pip install boxx
Box-X's Tutorial is a Jupyter Notebook file
There are 3 methods to run or view this Notebook file
We use Binder to run Tutorial Notebook in an executable interactive online jupyer environment.
That's mean you can run code in notebook rightnow in your browser without download or install anything.
git clone https://github.com/DIYer22/boxx cd boxx/ python setup.py install jupyter notebook
./tutorial_for_boxx.ipynb in notebook.
Just view the Tutorial Notebook.
Examples are divided into 2 parts too.
General Python Tool on left, Scientific Computing and Computer Vision Tool on right.
### General Python Tool
#### ▶ `p/x` is better way to `print(x)` `p/x` will `print(x)` and return `x` [![click to restart GIF and see more clearer GIF](./other/img/p.png)](./other/img/p.png) 💡 **Note:** `p/x` is easy to print value in expression.
#### ▶ Use `g.name = x` or `g.name/x` to transport variable to Python interactive console [![click to restart GIF and see more clearer GIF](./other/gif/g.gif) ](./other/gif/g.gif) 💡 **Note:** * `gg` is the meaning of "to Global and log", has same usage as `g`, but `gg` will print the transported variable. * if variable name exists in console before, the variable's value will be covered by new value.
#### ▶ `g()` to transport all vars that in the function to Python interactive console [![click to restart GIF and see more clearer GIF](./other/gif/g_call.gif) ](./other/gif/g_call.gif) 💡 **Note:** `g()` is a useful tool for debug. `import boxx.g` is convenient way to use `g()` instead of `from boxx import g;g()`(`import boxx.gg` is avaliable too)
#### ▶ `with p`, `with g`, `with gg` are mulit variables version of `p`, `g`, `gg` that work under "with statement" Only act on interested variables which is under "with statement" [![click to restart GIF and see more clearer GIF](./other/gif/w.gif) ](./other/gif/w.gif) 💡 **Note:** * `with p`, `with g`, `with gg` only act on assignment variables under "with statement". * If variable's name exists in `locals()` before and `id(variable)` not change ,variable may not be detected
### Scientific Computing and Computer Vision
Useful tools in Scientific Computing and Computer Vision field. All tools support array-like types, include
💡 Note: If you are using
#### ▶ `boxx` debug tool matrix
| How many vars \ Operation | print | transport | print & transport |
| :---- | :---- | :---- | :---- |
| Single variable | `p/x` | `g.name/x` | `gg.name/x`|
|Multi variables | `with p:` | `with g:` | `with gg:` |
|All `locals()`| `p()` | `g()` | `gg()` |
|All `locals()`\_2 | `import boxx.p` | `import boxx.g` | `import boxx.gg` |
boxxin Spyder IDE, Spyder is a awesome Scientific Python Development Environment with Powerful Qt-IPython
performanceis supported by SnakeViz
heatmapis supported by csurfer/pyheat
boox.x_is supported by Fn.py: enjoy FP in Python