Giter VIP home page Giter VIP logo

ndarray_ducktypes's Introduction

NDarray Ducktypes

This module provides a set of numpy ndarray ducktypes which use the new __array_function__ and __array_ufunc__ functionality in numpy. Currently, this includes a more modern MaskedArray replacement, and a structured-array-like ducktype called ArrayCollection meant to allow simple tabular data analysis.

This module also provides helper tools for defining your own new ndarray-ducktypes, including various boilerplate methods and ready-made ducktype printing functionality, in the duckprint submodule. Getting the str and repr of ndarray ducktypes to mirror that of numpy's ndarrays is not trivial, and the duckprint module's goal is to make it easy.

This project is currently in "alpha" state, and may still go through significant reorganization.

Documentation

The main documentation has an overview of this modules functionality, including installation instructions. Particular ducktypes and the ducktype-helper methods are documented at:

Contributing

PRs and issues are welcome. If you would like to help, right now a good way is to write tests for the MaskedArray numpy-api implementations in tests/test_MaskedArray.py, and fixing problems with the api implementations you find. As of writing this, over 150 api functions are implemented, but only a small fraction have a dedicated test, see Issue #1. There are already many tests ported from numpy.ma, but I want to go through each api method one-by-one and add tests for it in the TEST_API class. The easiest way to run tests, without needing to "pip install", is run "python -m pytest" from the clone root.

ndarray_ducktypes's People

Contributors

ahaldane avatar greglucas avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mhvk greglucas

ndarray_ducktypes's Issues

MaskedArray TODO list

TODO list:

  • Complete writing tests
    • tests for parsing input with X values (mixtures of ndarrays, X, scalars)
    • tests for each npy-api method
    • tests of array string representations
    • test ufuncs
    • test constructor
  • Finish npy-api functions still planned for implementation
    • np.cov, np.correlate
    • np.einsum_path
    • np.apply_along_axis, np.apply_over_axes
    • np.rot90
    • np.fliplr, np.flipud
    • np.pad (? may be too much effort to implement)
    • np.piecewise
    • np.ediff1d, np.gradient
    • np.unwrap
  • Finish writing docs about how to create composite MaskedArray ducktypes
  • Add note about new method '.count` in docs
  • Planning for future configurability: How to provide optional NA mask style? How to give optional ufunc auto-mask-invalid behavior. Should it be by MaskedArray factory? submodule? configuration method?

Possible further npy-api methods to implement: np.is_busday, np.busday_offset, np.busday_count, np.datetime_as_string, np.asfarray, np.vander, np.tril_indices_from, np.triu_indices_from, np.sort_complex, np.trim_zeros, np.i0, np.msort, np.trapz, np.ix_, np.fill_diagonal, np.diag_indices_from, np.lib.scimath.sqrt, np.lib.scimath.log, np.lib.scimath.log10, np.lib.scimath.logn, np.lib.scimath.log2, np.lib.scimath.power, np.lib.scimath.arccos, np.lib.scimath.arcsin, np.lib.scimath.arctanh, np.poly, np.roots, np.polyint, np.polyder, np.polyfit, np.polyval, np.polyadd, np.polysub, np.polymul, np.polydiv, np.intersect1d, np.setxor1d, np.in1d, np.isin, np.union1d, np.setdiff1d, np.fv, np.pmt, np.nper, np.ipmt, np.ppmt, np.pv, np.rate, np.irr, np.npv, np.mirr, np.save, np.savez, np.savez_compressed, np.savetxt,

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.