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

Updates #1

Merged
merged 10 commits into from
May 27, 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
30 changes: 30 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. macOS]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
38 changes: 29 additions & 9 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,55 @@ name: Python package

on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]

types: [opened, reopened, converted_to_draft, ready_for_review, synchronize]
branches:
- master
jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest

- name: Install pytest
run: |
python -m pip install pytest

- name: Install pytest-cov
run: python -m pip install pytest-cov

- name: Run tests with Python ${{ matrix.python-version }}
run: |
pytest
python${{ matrix.python-version }} -m pytest --cov=tinynumpy/matrices --cov-report=xml tinynumpy/tests

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Added local files
*.sublime-*
.*
setup-ex.py
*.egg-info/*
*.tar
Expand Down Expand Up @@ -28,3 +27,4 @@ __pychache__
*.dll
*.dylib

Pipfile
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Python package](https://github.com/Bchass/tinynumpy/actions/workflows/python-package.yml/badge.svg)](https://github.com/Bchass/tinynumpy/actions/workflows/python-package.yml)

tinynumpy
=========

Expand Down
2 changes: 1 addition & 1 deletion tinynumpy/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self):

def getmem():
process = psutil.Process(os.getpid())
return process.get_memory_info()[0]
return process.memory_info()[0]

M0 = getmem()
%s
Expand Down
Empty file added tinynumpy/tests/__init__.py
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ def test_repr():
for l1, l2 in zip(repr(a).splitlines(), repr(b).splitlines()):
l1, l2 = l1.rstrip(), l2.rstrip()
l1, l2 = l1.split('dtype=')[0], l2.split('dtype=')[0]
l1 = l1.replace(' ', '').replace('\t', '').rstrip(',)')
l2 = l2.replace(' ', '').replace('\t', '').rstrip(',)')
assert l1 == l2
charscompared += len(l1)
assert charscompared > (3 * b.size)
assert charscompared > (3 * b.size) - 2


def test_dtype():
Expand Down
2 changes: 1 addition & 1 deletion tinynumpy/tinynumpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

from math import sqrt
from copy import copy, deepcopy
from collections import Iterable
from collections.abc import Iterable
import operator

import tinynumpy.tinylinalg as linalg
Expand Down
Loading