Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
run: |
coverage run --source pyttb -m pytest tests/
coverage run --source pyttb -m pytest tests/ --packaging
coverage report
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
1 change: 1 addition & 0 deletions pyttb/hosvd.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Higher Order SVD Implementation"""
# Copyright 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.
Expand Down
1 change: 1 addition & 0 deletions pyttb/khatrirao.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Khatri-Rao Product Implementation"""
# Copyright 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.
Expand Down
1 change: 1 addition & 0 deletions pyttb/ktensor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Classes and functions for working with Kruskal tensors."""
# Copyright 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.
Expand Down
1 change: 1 addition & 0 deletions pyttb/pyttb_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""PYTTB shared utilities across tensor types"""
# Copyright 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.
Expand Down
3 changes: 2 additions & 1 deletion pyttb/sptensor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Sparse Tensor Implementation"""
# Copyright 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.
Expand Down Expand Up @@ -89,7 +90,7 @@ def tt_from_sparse_matrix(
return sptensorInstance


class sptensor(object):
class sptensor:
"""
SPTENSOR Class for sparse tensors.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyttb/sptensor3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pyttb as ttb


class sptensor3(object):
class sptensor3:
"""
SPTENSOR3 a sparse tensor variant.

Expand Down
2 changes: 1 addition & 1 deletion pyttb/sumtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pyttb as ttb


class sumtensor(object):
class sumtensor:
"""
SUMTENSOR Class for implicit sum of other tensors.

Expand Down
2 changes: 1 addition & 1 deletion pyttb/symktensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .pyttb_utils import *


class symktensor(object):
class symktensor:
"""
SYMKTENSOR Class for symmetric Kruskal tensors (decomposed).

Expand Down
2 changes: 1 addition & 1 deletion pyttb/symtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pyttb as ttb


class symtensor(object):
class symtensor:
"""
SYMTENSOR Class for storing only unique entries of symmetric tensor.

Expand Down
2 changes: 1 addition & 1 deletion pyttb/tenmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .pyttb_utils import *


class tenmat(object):
class tenmat:
"""
TENMAT Store tensor as a matrix.

Expand Down
3 changes: 2 additions & 1 deletion pyttb/tensor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Dense Tensor Implementation"""
# Copyright 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.
Expand All @@ -18,7 +19,7 @@
from pyttb.pyttb_utils import tt_dimscheck, tt_ind2sub


class tensor(object):
class tensor:
"""
TENSOR Class for dense tensors.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyttb/ttensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ALT_CORE_ERROR = "TTensor doesn't support non-tensor cores yet"


class ttensor(object):
class ttensor:
"""
TTENSOR Class for Tucker tensors (decomposed).

Expand Down
9 changes: 6 additions & 3 deletions tests/test_import_export_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,16 @@ def test_import_data_array(sample_array):
@pytest.mark.indevelopment
def test_import_invalid():
# invalid filename
data_filename = os.path.join(
os.path.dirname(__file__), "data", "invalid_filename.tns"
data_filename = os.path.normpath(
os.path.join(os.path.dirname(__file__), "data", "invalid_filename.tns")
)

with pytest.raises(AssertionError) as excinfo:
X = ttb.import_data(data_filename)
assert f"File path {data_filename} does not exist." in str(excinfo)
assert (
f"File path {os.path.normpath(data_filename)} does not exist."
in excinfo.value.args[0]
)

# invalid type
data_filename = os.path.join(os.path.dirname(__file__), "data", "invalid_type.tns")
Expand Down
1 change: 1 addition & 0 deletions tests/test_package.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Testing of general package properties such as linting and formatting"""
# Copyright 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.
Expand Down