Metadata-Version: 2.3
Name: datamat
Version: 0.2.0a1
Summary: Matrix Operations on Data Arrays
License: CC-BY-NC-SA-4.0
Keywords: pandas,matrix,econometrics,dataframe
Author: Ethan Ligon
Author-email: ligon@berkeley.edu
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Dist: numpy (>=1.22)
Requires-Dist: pandas (>=1.4)
Requires-Dist: scipy (>=1.9)
Project-URL: BugTracker, https://github.com/ligon/DataMat/issues
Project-URL: Documentation, https://github.com/ligon/DataMat#readme
Project-URL: Homepage, https://github.com/ligon/DataMat
Project-URL: Repository, https://github.com/ligon/DataMat
Description-Content-Type: text/markdown


# Table of Contents

1.  [DataMat](#org076900d)
    1.  [Features](#org7549f33)
    2.  [Repository Layout](#org0b4f9b1)
    3.  [Getting Started](#org64621e4)
    4.  [Development Workflow](#orgdf749a9)
    5.  [Documentation](#org1fc894d)
    6.  [Online Docs](#org0ef4e9d)
    7.  [Optional Dependencies](#org1fe3571)
    8.  [License](#org6f15ef0)


<a id="org076900d"></a>

# DataMat

*Matrix Operations on Data Arrays.* A pandas-friendly toolkit that wraps rich matrix algebra primitives in DataFrame/Series-aware containers (`DataMat`, `DataVec`).


<a id="org7549f33"></a>

## Features

-   Drop-in replacements for many `numpy` matrix operations that preserve pandas metadata.
-   Helpers for aligning MultiIndex structures and constructing dummy variables from categorical sources.
-   A `DataVec~/~DataMat` API that mirrors pandas while adding linear-algebra conveniences (projection, leverage, SVD, etc.).


<a id="org0b4f9b1"></a>

## Repository Layout

    src/datamat/        Core source code (DataMat, DataVec, utilities)
    docs/               Historical literate notebooks and design notes
    tests/              Unit tests
    scripts/            Development tooling (e.g., pre-push hook)


<a id="org64621e4"></a>

## Getting Started

1.  Install Python 3.11 (e.g., via pyenv) and Poetry (<https://python-poetry.org/docs/>).
2.  Create and initialise the virtual environment:
    
        poetry env use 3.11
        poetry install --with dev
        # optional extras, e.g. lsms, can be added via `poetry add`
3.  Run the quality gates and test suite:
    
        poetry run ruff check .
        poetry run black --check .
        poetry run mypy src tests
        poetry run pytest
        # or simply
        make check


<a id="orgdf749a9"></a>

## Development Workflow

-   Contribution guidelines: [CONTRIBUTING.org](CONTRIBUTING.md)
-   Agent-specific policies: [AGENTS.org](AGENTS.md)
-   Pre-push automation: `ln -s ../../scripts/pre-push.sh .git/hooks/pre-push`


<a id="org1fc894d"></a>

## Documentation

The historical literate source from the original Metrics Miscellany project lives in `docs/metrics_miscellany.org`. It remains the best place to reference derivations and design notes. Current development happens directly in the Python modules under `src/datamat/`; augment the Org materials when adding new capabilities.


<a id="org0ef4e9d"></a>

## Online Docs

Rendered documentation generated by MkDocs is available at <https://ligon.github.io/DataMat/>.


<a id="org1fe3571"></a>

## Optional Dependencies

-   Robust Stata ingestion relies on `lsms.tools.from_dta`. Install the `lsms` package if you plan to call `datamat.read_stata`.


<a id="org6f15ef0"></a>

## License

The project continues under the original license; see `LICENSE.txt`.


