Skip to content

Commit cbd017d

Browse files
dmdunlabrian-kelleyntjohnson1DunlavyDeepBlockDeepak
authored
Merge latest updates (#124)
* Update nvecs to use tenmat. * Full implementation of collapse. Required implementation of tensor.from_tensor_type for tenmat objects. Updated tensor tests. (#32) * Update __init__.py Bump version. * Create CHANGELOG.md Changelog update * Update CHANGELOG.md Consistent formatting * Update CHANGELOG.md Correction * Create ci-tests.yml * Update README.md Adding coverage statistics from coveralls.io * Create requirements.txt * 33 use standard license (#34) * Use standard, correctly formatted LICENSE * Delete LICENSE * Create LICENSE * Update and rename ci-tests.yml to regression-tests.yml * Update README.md * Fix bug in tensor.mttkrp that only showed up when ndims > 3. (#36) * Update __init__.py Bump version * Bump version * Adding files to support pypi dist creation and uploading * Fix PyPi installs. Bump version. * Fixing np.reshape usage. Adding more tests for tensor.ttv. (#38) * Fixing issues with np.reshape; requires order='F' to align with Matlab functionality. (#39) Closes #30 . * Bump version. * Adding tensor.ttm. Adding use case in tenmat to support ttm testing. (#40) Closes #27 * Bump version * Format CHANGELOG * Update CHANGELOG.md * pypi puslishing action on release * Allowing rdims or cdims to be empty array. (#43) Closes #42 * Adding tensor.ttt implementation. (#44) Closes 28 * Bump version * Implement ktensor.score and associated tests. * Changes to supporting pyttb data classes and associated tests to enable ktensor.score. * Bump version. * Compatibility with numpy 1.24.x (#49) Close #48 * Replace "numpy.float" with equivalent "float" numpy.float was deprecated in 1.20 and removed in 1.24 * sptensor.ttv: support 'vector' being a plain list (rather than just numpy.ndarray). Backwards compatible - an ndarray argument still works. This is because in newer numpy, it's not allowed to do np.array(list) where the elements of list are ndarrays of different shapes. * Make ktensor.innerprod call ttv with 'vector' as plain list (instead of numpy.ndarray, because newer versions don't allow ragged arrays) * tensor.ttv: avoid ragged numpy arrays * Fix two unit test failures due to numpy related changes * More numpy updates - numpy.int is removed - use int instead - don't try to construct ragged/inhomogeneous numpy arrays in tests. Use plain lists of vectors instead * Fix typo in assert message * Let ttb.tt_dimscheck catch empty input error In the three ttv methods, ttb.tt_dimscheck checks that 'vector' argument is not an empty list/ndarray. Revert previous changes that checked for this before calling tt_dimscheck. * Bump version * TENSOR: Fix slices ref shen return value isn't scalar or vector. #41 (#50) Closes #41 * Ttensor implementation (#51) * TENSOR: Fix slices ref shen return value isn't scalar or vector. #41 * TTENSOR: Add tensor creation (partial support of core tensor types) and display * SPTENSOR: Add numpy scalar type for multiplication filter. * TTENSOR: Double, full, isequal, mtimes, ndims, size, uminus, uplus, and partial innerprod. * TTENSOR: TTV (finishes innerprod), mttkrp, and norm * TTENSOR: TTM, permute and minor cleanup. * TTENSOR: Reconstruct * TTENSOR: Nvecs * SPTENSOR: * Fix argument mismatch for ttm (modes s.b. dims) * Fix ttm for rectangular matrices * Make error message consitent with tensor TENSOR: * Fix error message * TTENSOR: Improve test coverage and corresponding bug fixes discovered. * Test coverage (#52) * SPTENSOR: * Fix argument mismatch for ttm (modes s.b. dims) * Fix ttm for rectangular matrices * Make error message consitent with tensor TENSOR: * Fix error message * SPTENSOR: Improve test coverage, replace prints, and some doc string fixes. * PYTTUB_UTILS: Improve test coverage * TENMAT: Remove impossible condition. Shape is a property, the property handles the (0,) shape condition. So ndims should never see it. * TENSOR: Improve test coverage. One line left, but logic of setitem is unclear without MATLAB validation of behavior. * CP_APR: Add tests fpr sptensor, and corresponding bug fixes to improve test coverage. --------- Co-authored-by: Danny Dunlavy <[email protected]> * Bump version * TUCKER_ALS: Add tucker_als to validate ttucker implementation. (#53) * Bump version of actions (#55) actions/setup-python@v4 to avoid deprecation warnings * Tensor docs plus Linting and Typing and Black oh my (#54) * TENSOR: Apply black and enforce it * TENSOR: Add isort and pylint. Fix to pass then enforce * TENSOR: Variety of linked fixes: * Add mypy type checking * Update infrastructure for validating package * Fix doc tests and add more examples * DOCTEST: Add doctest automatically to regression * Fix existing failures * DOCTEST: Fix non-uniform array * DOCTEST: Fix precision errors in example * AUTOMATION: Add test directory otherwise only doctests run * TENSOR: Fix bad rebase from numpy fix * Auto formatting (#60) * COVERAGE: Fix some coverage regressions from pylint PR * ISORT: Run isort on source and tests * BLACK: Run black on source and tests * BLACK: Run black on source and tests * FORMATTING: Add tests and verification for autoformatting * FORMATTING: Add black/isort to root to simplify * Add preliminary contributor guide instructions Closes #59 * TUCKER_ALS: TTM with negative values is broken in ttensor (#62) (#66) * Replace usage in tucker_als * Update test for tucker_als to ensure result matches expectation * Add early error handling in ttensor ttm for negative dims * Hosvd (#67) * HOSVD: Preliminary outline of core functionality * HOSVD: Fix numeric bug * Was slicing incorrectly * Update test to check convergence * HOSVD: Finish output and test coverage * TENSOR: Prune numbers real * Real and mypy don't play nice python/mypy#3186 * This allows partial typing support of HOSVD * Add test that matches TTB for MATLAB output of HOSVD (#79) This closes #78 * Bump version (#81) Closes #80 * Lint pyttb_utils and lint/type sptensor (#77) * PYTTB_UTILS: Fix and enforce pylint * PYTTB_UTILS: Pull out utility only used internally in sptensor * SPTENSOR: Fix and enforce pylint * SPTENSOR: Initial pass a typing support * SPTENSOR: Complete initial typing coverage * SPTENSOR: Fix test coverage from typing changes. * PYLINT: Update test to lint files in parallel to improve dev experience. * HOSVD: Negative signs can be permuted for equivalent decomposition (#82) * Pre commit (#83) * Setup and pyproject are redundant. Remove and resolve install issue * Try adding pre-commit hooks * Update Makefile for simplicity and add notes to contributor guide. * Make pre-commit optional opt-in * Make regression tests use simplified dependencies so we track fewer places. * Using dynamic version in pyproject.toml to reduce places where version is set. (#86) * Adding shell=True to subprocess.run() calls (#87) * Adding Nick to authors (#89) * Release prep (#90) * Fix author for PyPI. Bump to dev version. * Exclude dims (#91) * Explicit Exclude_dims: * Updated tt_dimscheck * Update all uses of tt_dimscheck and propagate interface * Add test coverage for exclude dims changes * Tucker_als: Fix workaround that motivated exclude_dims * Bump version * Spelling * Tensor generator helpers (#93) * TENONES: Add initial tenones support * TENZEROS: Add initial tenzeros support * TENDIAG: Add initial tendiag support * SPTENDIAG: Add initial sptendiag support * Link in autodocumentation for recently added code: (#98) * TTENSOR, HOSVD, TUCKER_ALS, Tensor generators * Remove warning for nvecs: (#99) * Make debug level log for now * Remove test enforcement * Rand generators (#100) * Non-functional change: * Fix numpy deprecation warning, logic should be equivalent * Tenrand initial implementation * Sptenrand initial implementation * Complete pass on ktensor docs. (#101) * Bump version * Bump version * Trying to fix coveralls * Trying coveralls github action * Fixing arrange and normalize. (#103) * Fixing arrange and normalize. * Merge main (#104) * Trying to fix coveralls * Trying coveralls github action * Rename contributor guide for github magic (#106) * Rename contributor guide for github magic * Update reference to contributor guide from README * Fixed the mean and stdev typo for cp_als (#117) * Changed cp_als() param 'tensor' to 'input_tensor' to avoid ambiguity (#118) * Changed cp_als() param 'tensor' to 'input_tensor' to avoid ambiguity * Formatted changes with isort and black. * Updated all `tensor`-named paramteres to `input_tensor`, including in docs (#120) * Tensor growth (#109) * Tensor.__setitem__: Break into methods * Non-functional change to make logic flow clearer * Tensor.__setitem__: Fix some types to resolve edge cases * Sptensor.__setitem__: Break into methods * Non-functional change to make flow clearer * Sptensor.__setitem__: Catch additional edge cases in sptensor indexing * Tensor.__setitem__: Catch subtensor additional dim growth * Tensor indexing (#116) * Tensor.__setitem__/__getitem__: Fix linear index * Before required numpy array now works on value/slice/Iterable * Tensor.__getitem__: Fix subscripts usage * Consistent with setitem now * Update usages (primarily in sptensor) * Sptensor.__setitem__/__getitem__: Fix subscripts usage * Consistent with tensor and MATLAB now * Update test usage * sptensor: Add coverage for improved indexing capability * tensor: Add coverage for improved indexing capability --------- Co-authored-by: brian-kelley <[email protected]> Co-authored-by: ntjohnson1 <[email protected]> Co-authored-by: Dunlavy <[email protected]> Co-authored-by: DeepBlockDeepak <[email protected]>
1 parent 6fa42c2 commit cbd017d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+9098
-3769
lines changed

.github/workflows/python-publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Regression tests
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.8", "3.9", "3.10"]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install coverage coveralls sphinx_rtd_theme
31+
pip install ".[dev]"
32+
- name: Check auto-formatters
33+
run: |
34+
isort --check .
35+
black --check .
36+
# - name: Lint with flake8
37+
# run: |
38+
# # stop the build if there are Python syntax errors or undefined names
39+
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41+
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+
- name: Run tests
43+
run: |
44+
coverage run --source pyttb -m pytest tests/
45+
coverage report
46+
- name: Upload coverage to Coveralls
47+
uses: coverallsapp/github-action@v2

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 5.11.5
4+
hooks:
5+
- id: isort
6+
name: isort (python)
7+
- repo: https://github.com/psf/black
8+
rev: 23.3.0
9+
hooks:
10+
- id: black
11+
language_version: python

CHANGELOG.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# v1.6.1 (2023-04-27)
2+
- New:
3+
- Tensor generator helpers:
4+
- `tenones`, `tenzeros`, `tendiag`, `sptendiag` (PR https://github.com/sandialabs/pyttb/pull/93)
5+
- `tenrand`, `sptenrand` (PR https://github.com/sandialabs/pyttb/pull/100)
6+
- Moved to using `logging` instead of `warnings` (PR https://github.com/sandialabs/pyttb/pull/99)
7+
- Documentation:
8+
- Completed: `ktensor` (PR https://github.com/sandialabs/pyttb/pull/101)
9+
- Fixed linking for new classes (PR https://github.com/sandialabs/pyttb/pull/98)
10+
# v1.6.0 (2023-04-16)
11+
- API Change (PR https://github.com/sandialabs/pyttb/pull/91)
12+
- *Not backwards compatible*
13+
- `pyttb_utils.tt_dimscheck`
14+
- Addresses ambiguity of -0 by using `exclude_dims` (`numpy.ndarray`) parameter
15+
- `ktensor.ttv`, `sptensor.ttv`, `tensor.ttv`, `ttensor.ttv`
16+
- Use `exlude_dims` parameter instead of `-dims`
17+
- Explicit nameing of dimensions to exclude
18+
- `tensor.ttsv`
19+
- Use `skip_dim` (`int`) parameter instead of `-dims`
20+
- Exclude all dimensions up to and including `skip_dim`
21+
- Fixes/Completed:
22+
- Code cleaning: minor changes associated with replacing `-dims` with `exclude_dims`/`skip_dim`
23+
- Authorship: PyPI only allows one author, changing to current POC
24+
25+
# v1.5.1 (2023-04-14)
26+
- New:
27+
- Dev Support:
28+
- Linting: support for `pyttb_utils` and `sptensor` (PR https://github.com/sandialabs/pyttb/pull/77)
29+
- Pre-commit: support @ntjohnson1 in (PR https://github.com/sandialabs/pyttb/pull/83)
30+
- Fixed/Completed:
31+
- `hosvd`: Negative signs can be permuted for equivalent decomposition (PR https://github.com/sandialabs/pyttb/pull/82)
32+
- Versioning: using dynamic version in pyproject.toml (PR https://github.com/sandialabs/pyttb/pull/86)
33+
- Package Testing: fixed problem with subprocesses (PR https://github.com/sandialabs/pyttb/pull/87)
34+
35+
# v1.5.0 (2023-03-19)
36+
- New:
37+
- Added `hosvd` Tuecker decomposition (Issue #56, PR #67)
38+
- Added `tucker_als` Tuecker decomposition (PR #66)
39+
- Autoformatting using `black` and `isort` (Issue #59, PR #60)
40+
- Updated/Ongoing:
41+
- Included more testing for improved coverage (Issue #78, PR #79)
42+
43+
# v1.4.0 (2023-02-21)
44+
- New:
45+
- Added `ttensor` class and associated tests (Issue #10, PR #51)
46+
- Fixed/Completed:
47+
- Tensor slicing now passes through to `numpy` array slicing (Issue #41, PR #50)
48+
- Updated/Ongoing:
49+
- Included more testing for improved coverage (Issue #14, PR #52)
50+
51+
# v1.3.9 (2023-02-20)
52+
- Remove deprecated `numpy` code associated with aliases to built-in types and ragged arrays (Issue #48, PR #49)
53+
54+
# v1.3.8 (2022-10-12)
55+
- Fixed `pyttb_utils.tt_ind2sub` (Issue #45, PR #47)
56+
- Implemented `ktensor.score` (Issue #46, PR #47)
57+
58+
# v1.3.7 (2022-07-17)
59+
- Fixed `tenmat` to accept empty arrays for `rdims` or `cdims` (Issue #42, PR #43)
60+
- Implemented `tensor.ttt` (Issue #28, PR #44)
61+
- Adding GitHub action to publish releases to PyPi
62+
63+
# v1.3.6 (2022-07-15)
64+
- Implemented `tensor.ttm` (Issue #27, PR #40)
65+
66+
# v1.3.5 (2022-07-12)
67+
- Fixing `np.reshape` in `tensor.ttv` (Issue #37, PR #38)
68+
- Fixing `np.reshape` in remainder of `tensor` (Issue #30, PR #39)
69+
70+
# v1.3.4 (2022-07-12)
71+
- Fixing issues with PyPi uploads
72+
73+
# v1.3.3 (2022-07-11)
74+
- Fixed indexing bug in `tensor.mttkrp` (Issue #35, PR #36)
75+
- Updated LICENSE to compliant format (Issue #33 , PR #34)
76+
- Now using [coveralls.io](https://coveralls.io/github/sandialabs/pyttb) for coverage reporting
77+
- Now using [readthedocs.io](https://pyttb.readthedocs.io/en/latest/) for documentation
78+
79+
# v1.3.2 (2022-07-06)
80+
- Update `tensor.nvecs` to use `tenmat` (Issue #25, PR #31)
81+
- Full implementation of `tensor.collapse` (Issue #2, PR #32)
82+
- Added `CHANGELOG.md`
83+
84+
# v1.3.1 (2022-07-01)
85+
- Using `pyttb.__version__` for specifying package version in code and docs
86+
- Implemented `tenmat.__setitem__` and tests (#23)
87+
- Fix warnings in `cp_apr` associated with divide by zero (#13)
88+
- Several documentation fixes.
89+
90+
# v1.3.0 (2022-07-01)
91+
- Changed package name to `pyttb` (#24)
92+
93+
# v1.2.0 (2022-07-01)
94+
- Added `tenmat` class and associated tests (#8)
95+
- Added `tensor.__rmul__` for preadding scalars (#18)
96+
- Fixed error in `sptensor.__lt__` that led to creation of large boolean tensors when comparing with 0 (#15)
97+
- Matched output of `cp_als` to Matlab (#17)
98+
99+
# v1.1.1 (2022-06-29)
100+
- Fixed `tensor/mttkrp` use of `np.reshape` (#16)
101+
- Now updating version numbers in `setup.py`
102+
103+
# v1.1.0 (2022-06-27)
104+
- Fixed `import_data` method
105+
- New `export_data` method
106+
- More testing
107+
108+
# v1.0.0 (2022-06-27)
109+
- Initial release of Python Tensor Toolbox

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Python Tensor Toolbox Contributor Guide
2+
3+
## Issues
4+
If you are looking to get started or want to propose a change please start by checking
5+
current or filing a new [issue](https://github.com/sandialabs/pyttb/issues).
6+
7+
## Working on PYTTB locally
8+
1. clone your fork and enter the directory
9+
```
10+
$ git clone [email protected]:<your username>/pyttb.git
11+
$ cd pyttb
12+
```
13+
1. setup your desired python environment as appropriate
14+
15+
1. install dependencies
16+
```
17+
$ pip install -e ".[dev]"
18+
$ make install_dev # shorthand for above
19+
```
20+
21+
1. Checkout a branch and make your changes
22+
```
23+
git checkout -b my-new-feature-branch
24+
```
25+
1. Formatters and linting
26+
1. Run autoformatters from root of project (they will change your code)
27+
```commandline
28+
$ isort .
29+
$ black .
30+
```
31+
1. [We](./.pre-commit-config.yaml) optionally support [pre-commit hooks](https://pre-commit.com/) for this
32+
1. Pylint and mypy coverage is work in progress (these only raise errors)
33+
```commandline
34+
mypy pyttb/
35+
pylint pyttb/file_name.py //Today only tensor is compliant
36+
```
37+
38+
1. Run tests (at desired fidelity)
39+
1. Just doctests (enabled by default)
40+
```commandline
41+
pytest
42+
```
43+
1. Functional tests
44+
```commandline
45+
pytest .
46+
```
47+
1. All tests (linting and formatting checks)
48+
```commandline
49+
pytest . --packaging
50+
```
51+
1. With coverage
52+
```commandline
53+
pytest . --cov=pyttb --cov-report=term-missing
54+
```

CONTRIBUTORS.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ U.S. Government retains certain rights in this software.
88

99
## Contributors
1010

11-
**Primary POC:** Danny Dunlavy, [email protected]
11+
**Primary POC:** [Danny Dunlavy](@dmdunla)
1212

13-
**Contributors:**
14-
* Danny Dunlavy - original author, `sptensor`, `ktensor`, `tensor`, `tenmat`, `cp_als`, `cp_apr`
15-
* Nick Johnson - original author, `sptensor`, `ktensor`, `tensor`, `cp_als`, `cp_apr`
16-
* Derek Tucker - `tensor`
13+
**Main Developers:**
14+
15+
- [Danny Dunlavy](@dmdunla) - original author, `sptensor`, `ktensor`, `tensor`, `tenmat`, `cp_als`, `cp_apr`,
16+
[PRs](https://github.com/sandialabs/pyttb/commits?author=dmdunla)
17+
- [Nick Johnson](@ntjohnson1) - original author, `sptensor`, `ktensor`, `tensor`, `ttensor`, `cp_als`, `cp_apr`,
18+
[PRs](https://github.com/sandialabs/pyttb/commits?author=ntjohnson1)
19+
20+
**Other Contributors:**
21+
- [Brian Kelley](@brian_kelley) - `numpy` compatability,
22+
[PRs](https://github.com/sandialabs/pyttb/commits?author=brian-kelley)
23+
- [Derek Tucker](@jdtuck)[#1] - `tensor`,
24+
[PRs](https://github.com/sandialabs/pyttb/commits?author=jdtuck)

LICENSE

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
BSD 2-Clause License
22

3-
Copyright 2022 National Technology & Engineering Solutions of Sandia,
4-
LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
5-
U.S. Government retains certain rights in this software.
3+
Copyright (c) 2022, National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
4+
All rights reserved.
65

76
Redistribution and use in source and binary forms, with or without
87
modification, are permitted provided that the following conditions are met:

Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,24 @@ BUILDDIR = ./docs/build
1414

1515
# Put it first so that "make" without argument is like "make help".
1616
help:
17-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
17+
@echo "install: Install release build"
18+
@echo "install_dev: Install dev build"
19+
@echo "install_docs: Install docs build"
20+
@echo "docs_help: Show additional docs commands"
21+
22+
.PHONY: help install install_dev install_docs Makefile
23+
24+
install:
25+
python -m pip install -e .
1826

19-
.PHONY: help Makefile
27+
install_dev:
28+
python -m pip install -e ".[dev]"
29+
30+
install_docs:
31+
python -m pip install -e ".[doc]"
32+
33+
docs_help:
34+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2035

2136
# Catch-all target: route all unknown targets to Sphinx using the new
2237
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,26 @@ U.S. Government retains certain rights in this software.
66

77
# pyttb: Python Tensor Toolbox
88

9-
## Contributors
10-
* Danny Dunlavy, Nick Johnson, Derek Tucker
9+
Welcome to `pyttb`, a set of Python classes and methods functions for
10+
manipulating dense, sparse, and structured tensors, along with algorithms
11+
for computing low-rank tensor models.
1112

12-
## Quick start
13+
**Tensor Classes:**
14+
* `tensor`: dense tensors
15+
* `sptensor`: sparse tensors
16+
* `ktensor`: Kruskal tensors
17+
* `tenmat`: matricized tensors
18+
* `ttensor`: Tucker tensors
1319

14-
### Install
15-
* User: ```python setup.py install```
16-
* Developer: ```python setup.py develop```
20+
**Tensor Algorithms:**
21+
* `cp_als`, `cp_apr`: Canonical Polyadic (CP) decompositions
22+
* `tucker_als`: Tucker decompostions
1723

18-
### Testing
19-
```
20-
python -m pytest
21-
```
24+
# Getting Started
25+
Check out the [Documentation](https://pyttb.readthedocs.io) to get started.
2226

23-
### Coverage Testing
24-
```
25-
pytest --cov=pyttb tests/ --cov-report=html
26-
# output can be accessed via htmlcov/index.html
27-
```
28-
29-
### Documentation
30-
```
31-
# requires `sphinx`
32-
sphinx-build ./docs/source ./docs/build/html
33-
# output can be accessed via docs/build/html/index.html
34-
```
27+
# Contributing
28+
Check out our [contributing guide](CONTRIBUTING.md).
3529

30+
---
31+
[![Regression tests](https://github.com/sandialabs/pyttb/actions/workflows/regression-tests.yml/badge.svg)](https://github.com/sandialabs/pyttb/actions/workflows/regression-tests.yml) [![Coverage Status](https://coveralls.io/repos/github/sandialabs/pyttb/badge.svg?branch=main)](https://coveralls.io/github/sandialabs/pyttb?branch=main)

0 commit comments

Comments
 (0)