Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python version #20

Merged
merged 7 commits into from
Jul 1, 2024
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
22 changes: 11 additions & 11 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
name: first code check / python-3.8 / ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Python info
run: |
which python
Expand Down Expand Up @@ -49,11 +49,11 @@ jobs:
runs-on: ubuntu-latest
needs: first_check
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.9
- name: Python info
run: |
which python
Expand Down Expand Up @@ -93,16 +93,16 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9']
python-version: ['3.8', '3.9', '3.10', '3.11']
exclude:
- os: ubuntu-latest
python-version: 3.8 # or 3.9 when #240 is fully solved
python-version: 3.9
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Create conda environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9"
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
python_requires='>=3.7',
python_requires='>=3.8',
install_requires=[
"numba",
"numpy",
Expand Down
9 changes: 7 additions & 2 deletions sparsestack/StackedSparseArray.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# -*- coding: utf-8 -*-
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse.sputils import get_index_dtype
from .utils import join_arrays


_slicing_not_implemented_msg = "Wrong slicing, or option not yet implemented"


def get_index_dtype(maxval):
if maxval <= np.iinfo(np.int32).max:
return np.int32
return np.int64


class StackedSparseArray:
""" 2.5D sparse matrix in COO-style with multiple possible entries per i-j-position.

Expand Down Expand Up @@ -51,7 +56,7 @@ class StackedSparseArray:
def __init__(self, n_row, n_col):
self.__n_row = n_row
self.__n_col = n_col
self.idx_dtype = get_index_dtype(maxval=max(n_row, n_col))
self.idx_dtype = get_index_dtype(maxval=n_row * n_col)
self.row = np.array([], dtype=self.idx_dtype)
self.col = np.array([], dtype=self.idx_dtype)
self.data = None
Expand Down
Loading