Giter Club home page Giter Club logo

numpy-allocation-tracking's Introduction

Numpy Allocation Tracking

The numpy git repo includes a useful allocation_tracking package in the tools directory, but numpy doesn't install it by default. This repo includes a conda recipe to install that package, along with some extra utilities and decorators.

A Tiny Note: The allocation_tracking module's setup.py would normally install alloc_hook into the global namespace, but this package installs everything into the namespace numpy_allocation_tracking.

Installation

conda install -c ilastik numpy-allocation-tracking

Build it yourself

To build this recipe yourself for say, numpy 1.9:

conda build --numpy=1.9 conda-recipe

Note: If you make any changes to this repo, you must commit them before building the recipe. Uncommitted changes are not included in the build.

Example Usage

from numpy_allocation_tracking.decorators import assert_mem_usage_factor

# If this function uses more RAM than 2x the size
# of input_array, raise an error.
# (Useful for testing purposes, not in production code.)
@assert_mem_usage_factor(2.0)
def dumb_function(input_array, x, y, z):
    return x * (input_array + y + z)

result = dumb_function( np.ones((100,100)), 10, 20, 30 )

numpy-allocation-tracking's People

Contributors

stuarteberg avatar k-dominik avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.