Skip to content

Commit 9360fa9

Browse files
committed
Removes Array class
1 parent 0f4f824 commit 9360fa9

7 files changed

Lines changed: 16 additions & 223 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,18 @@ jobs:
3535
- name: Test with pytest
3636
run: |
3737
pip install pytest pytest-cov
38-
pytest tests --doctest-modules --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
39-
- name: Upload pytest test results
38+
pytest tests --doctest-modules --junitxml=reports/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
39+
- name: Upload test results
4040
uses: actions/upload-artifact@v4
4141
with:
4242
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
43-
path: junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml
43+
path: reports/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml
4444
# Use always() to always run this step to publish test results when there are test failures
4545
if: ${{ always() }}
46+
- name: Report test results
47+
uses: dorny/test-reporter@v2
48+
if: success() || failure() # run this step even if the previous step failed
49+
with:
50+
name: JEST Tests
51+
path: reports/test-results-*-*.xml
52+
reporter: jest-junit

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
permissions:
99
contents: write
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
- name: Build HTML
1313
uses: ammaraskar/sphinx-action@master
1414
- name: Upload artifacts

src/btensor/array.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/btensor/tensor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ def __getitem__(self, key: slice | Ellipsis | NBasis) -> Self:
245245
key = (key,)
246246

247247
type_error_msg = (f'only instances of Basis, slice(None), and Ellipsis are valid indices for the'
248-
f'{type(self).__name__} class. '
249-
f'Use Array class to index using integers, slices, and integer or boolean arrays')
248+
f'{type(self).__name__} class.')
250249
if not isinstance(key, tuple):
251250
raise TypeError(type_error_msg)
252251
for bas in key:
@@ -323,7 +322,7 @@ def change_basis(self, basis: NBasis) -> Self:
323322
basis: New basis of tensor.
324323
325324
Returns:
326-
Tensor in new basis.
325+
Tensor in the new basis.
327326
"""
328327
basis = BasisTuple.create_from_default(basis, default=self.basis)
329328
if not basis.is_spanning(self._basis):
@@ -340,7 +339,7 @@ def cob(self) -> _ChangeBasisInterface:
340339
return self._cob
341340

342341
def change_basis_at(self, basis: IBasis | Sequence[IBasis], axis: int | Sequence[int]) -> Self:
343-
"""Change basis of tensor along one or more selected axes.
342+
"""Change the basis of tensor along one or more selected axes.
344343
345344
Slice(None) can be used to indicate no transformation.
346345
In contrast to `project`, this function will first test if the tensor can be fully represented in the new basis
@@ -351,7 +350,7 @@ def change_basis_at(self, basis: IBasis | Sequence[IBasis], axis: int | Sequence
351350
axis: One or more axes, along which the basis will be replaced.
352351
353352
Returns:
354-
Tensor in new basis.
353+
Tensor in the new basis.
355354
"""
356355
# Single axis
357356
if not is_sequence(axis):

tests/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
from __future__ import annotations
1616
import operator
17-
from typing import *
1817

19-
import pytest
2018
import itertools
2119
import scipy
2220

tests/test_array.py

Lines changed: 0 additions & 126 deletions
This file was deleted.

tests/test_tensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from conftest import subbasis_definition_to_matrix
2323

2424
from btensor import Tensor
25-
from btensor.exceptions import BTensorError, BasisDependentOperationError
25+
from btensor.exceptions import BTensorError
2626

2727

2828
class TestTensor(TestCase):

0 commit comments

Comments
 (0)