Personal Python Toolbox
Project description
Jacinle
Jacinle is a personal python toolbox. It contains a range of utility functions for python development, including project configuration, file IO, image processing, inter-process communication, etc.
[Website] [Examples] [Jacinle References] [JacLearn References] [JacTorch References]
Installation
Clone the Jacinle package (be sure to clone all submodules), and add the bin path to your PATH environment.
git clone https://github.com/vacancy/Jacinle --recursive
export PATH=<path_to_jacinle>/bin:$PATH
Optionally, you may need to install third-party packages specified in requirements.txt
Command Line
-
jac-run xxx.py
Jacinle comes with a command line to replace the
python
command:jac-run
. In short, this command will automatically add the Jacinle packages intoPYTHONPATH
, as well as adding a few vendor Python packages intoPYTHONPATH
(for example, JacMLDash). Using this command to replacepython xxx.py
is the best practice to manage dependencies.Furthremore, this command also supports a configuration file specific to projects. The command will search for a configuration file named
jacinle.yml
in the current working directory and its parent directories. This file specifies additional environmental variables to add, for example.project_root: true # tell the script that the folder containing this file is the root of a project. The directory will be added to PYTHONPATH. system: envs: CUDA_HOME: /usr/local/cuda-10.0 # set needed environment variables here. path: bin: # will be prepended to $PATH /usr/local/bin python: # will be prepended to $PYTHONPATH /Users/jiayuanm/opt/my_python_lib vendors: # load additional Python packages (root paths will be added to PYTHONPATH) pybullet_tools: root: /Users/jiayuanm/opt/pybullet/utils alfred: root: /Users/jiayuanm/opt/alfred
-
jac-crun <gpu_ids> xxx.py
The same as
jac-run
, but takes an additional argument, which is a comma-separated list of gpu ids, following the convension ofCUDA_VISIBLE_DEVICES
. -
jac-debug xxx.py
The same as
jac-run
, but sets the environment variableJAC_DEBUG=1
before running the command. By default, in the debug mode, anipdb
interface will be started when an exception is raised. -
jac-cdebug <gpu_ids> xxx.py
The combined
jac-debug
andjac-crun
. -
jac-update
Update the Jacinle package (and all dependencies inside
vendors/
). -
jac-inspect-file xxx.json yyy.pkl
Start an IPython interface and loads all files in the argument list. The content of the files can be accessed via
f1
,f2
, ...
Python Libraries
Jacinle contains a collection of useful packages. Here is a list of commonly used packages, with links to the documentation.
jacinle.*
: frequently used utility functions, such asjacinle.JacArgumentParser
,jacinle.TQDMPool
,jacinle.get_logger
,jacinle.cond_with
, etc.jacinle.io.*
: IO functions. Two of the mostly used ones are:jacinle.io.load(filename)
andjacinle.io.dump(filename, obj)
jacinle.random.*
: almost the same asnumpy.random.*
, but with a few additional utility functions and RNG state management functions.jacinle.web.*
: the oldjacweb
package, which is a customized wrapper around the tornado web server.jaclearn.*
: machine learning modules.jactorch.*
: a collection of PyTorch functions in addition to thetorch.*
functions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jacinle-1.0.2.tar.gz
.
File metadata
- Download URL: jacinle-1.0.2.tar.gz
- Upload date:
- Size: 211.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.19.9 importlib-metadata/4.11.2 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8327d87a6220e698b0d459fbe9be37e3b82387dbd8bfac1e84f8666b1d08275c |
|
MD5 | 161db0b8aae0f7c763ca449024b159c1 |
|
BLAKE2b-256 | 57c433cde899f1aaeab68e2f35a8fa299a9c7a2e4b46f9cfbd69462842747bf8 |
File details
Details for the file jacinle-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: jacinle-1.0.2-py3-none-any.whl
- Upload date:
- Size: 334.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.19.9 importlib-metadata/4.11.2 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edd2c1b3097aa658413262ff6e441157de060dd2f2816c0bfb9a7a5fde48d25c |
|
MD5 | e530f07a42568b9a079f40ba890f79c2 |
|
BLAKE2b-256 | 7018d3fcb8ea2e560d03401d1900cf8bd704f62db413b8fe1fe570da04bdcc3e |