Skip to main content

Jacinle

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

  1. 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 into PYTHONPATH, as well as adding a few vendor Python packages into PYTHONPATH (for example, JacMLDash). Using this command to replace python 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
    
  2. 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 of CUDA_VISIBLE_DEVICES.

  3. jac-debug xxx.py

    The same as jac-run, but sets the environment variable JAC_DEBUG=1 before running the command. By default, in the debug mode, an ipdb interface will be started when an exception is raised.

  4. jac-cdebug <gpu_ids> xxx.py

    The combined jac-debug and jac-crun.

  5. jac-update

    Update the Jacinle package (and all dependencies inside vendors/).

  6. 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 as jacinle.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) and jacinle.io.dump(filename, obj)
  • jacinle.random.*: almost the same as numpy.random.*, but with a few additional utility functions and RNG state management functions.
  • jacinle.web.*: the old jacweb package, which is a customized wrapper around the tornado web server.
  • jaclearn.*: machine learning modules.
  • jactorch.*: a collection of PyTorch functions in addition to the torch.* functions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jacinle-1.0.4.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jacinle-1.0.4-py3-none-any.whl (136.8 kB view details)

Uploaded Python 3

File details

Details for the file jacinle-1.0.4.tar.gz.

File metadata

  • Download URL: jacinle-1.0.4.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for jacinle-1.0.4.tar.gz
Algorithm Hash digest
SHA256 00ab022f65ad0515d07f01960efcac4b6e10aafbb7f768e7d948198bd1d1b2af
MD5 47ab0ec1996f83d48b570e378dc9d349
BLAKE2b-256 fddafff7949ef3c6a96ae239df6118bf192921489681b00a9ce1c80e9a78e9ff

See more details on using hashes here.

File details

Details for the file jacinle-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: jacinle-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 136.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for jacinle-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1fd0a23d78ac04e668c9237cf92160fb336edaa336121168bfe2408d0abd04
MD5 06ae2e15feeaff77d22805f5a4c36456
BLAKE2b-256 8c6d98b4dc9dc3db0de37c795eb55dda86b4e2d568fa690f836a5f5386185020

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page