Skip to content

Commit

Permalink
Merge branch 'tabmat-v4' into column-names
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmart authored Aug 9, 2023
2 parents 1bd940f + d3d3d82 commit b734f60
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/conda-build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
- name: Build conda package
shell: pwsh
run: |
mamba install -n base -y conda-build
conda build -m .ci_support/${{ matrix.CONDA_BUILD_YML }}.yaml conda.recipe
mamba install -n base -y conda-build boa
conda mambabuild -m .ci_support/${{ matrix.CONDA_BUILD_YML }}.yaml conda.recipe
4 changes: 2 additions & 2 deletions .github/workflows/macos-conda-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -exo pipefail

mamba install -y conda-build
mamba install -y conda-build boa

# Don't test cross-compiled result (there is no emulation) and use the latest MacOS SDK.
if grep -q "osx-arm64" .ci_support/${CONDA_BUILD_YML}.yaml; then
Expand All @@ -13,4 +13,4 @@ CONDA_BUILD_SYSROOT:
- "${CONDA_BUILD_SYSROOT}"
EOF
fi
conda build -m .ci_support/${CONDA_BUILD_YML}.yaml conda.recipe ${CONDA_BUILD_ARGS:-}
conda mambabuild -m .ci_support/${CONDA_BUILD_YML}.yaml conda.recipe ${CONDA_BUILD_ARGS:-}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/Quantco/pre-commit-mirrors-black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black-conda
additional_dependencies: [flake8-docstrings, flake8-rst-docstrings]
args:
- --safe
- --target-version=py36
- repo: https://github.com/Quantco/pre-commit-mirrors-flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8-conda
additional_dependencies: [
Expand All @@ -33,7 +33,7 @@ repos:
additional_dependencies:
- python=3.8
- repo: https://github.com/Quantco/pre-commit-mirrors-pyupgrade
rev: 3.7.0
rev: 3.9.0
hooks:
- id: pyupgrade-conda
- repo: https://github.com/Quantco/pre-commit-mirrors-cython-lint
Expand Down
10 changes: 8 additions & 2 deletions src/tabmat/sparse_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ class SparseMatrix(MatrixBase):

def __init__(
self,
arg1,
array,
shape=None,
dtype=None,
copy=False,
column_names=None,
term_names=None,
):
self._array = sps.csc_matrix(arg1, shape, dtype, copy)
if isinstance(input_array, np.ndarray):
if input_array.ndim == 1:
input_array = input_array.reshape(-1, 1)
elif input_array.ndim > 2:
raise ValueError("Input array must be 1- or 2-dimensional")

self._array = sps.csc_matrix(input_array, shape, dtype, copy)

self.idx_dtype = max(self._array.indices.dtype, self._array.indptr.dtype)
if self._array.indices.dtype != self.idx_dtype:
Expand Down

0 comments on commit b734f60

Please sign in to comment.