-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: pr #19 from joshua-auchincloss/v0.3.0
v0.3.0
- Loading branch information
Showing
15 changed files
with
385 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ dist/ | |
.coverage* | ||
.coverage | ||
*.html | ||
*.ipynb | ||
.vscode/settings.json | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
| Name | Stmts | Miss | Branch | BrPart | Cover | | ||
| --------------------------------------- | ------: | -----: | ------: | -----: | ------: | | ||
| src/hatch_cython/\_\_init\_\_.py | 2 | 0 | 0 | 0 | 100% | | ||
| src/hatch_cython/config/\_\_init\_\_.py | 2 | 0 | 0 | 0 | 100% | | ||
| src/hatch_cython/config/autoimport.py | 9 | 0 | 4 | 0 | 100% | | ||
| src/hatch_cython/config/config.py | 138 | 12 | 58 | 7 | 89% | | ||
| src/hatch_cython/config/defaults.py | 6 | 0 | 0 | 0 | 100% | | ||
| src/hatch_cython/config/files.py | 22 | 1 | 12 | 2 | 91% | | ||
| src/hatch_cython/config/flags.py | 70 | 1 | 26 | 0 | 99% | | ||
| src/hatch_cython/config/includes.py | 15 | 1 | 8 | 1 | 91% | | ||
| src/hatch_cython/config/macros.py | 12 | 0 | 7 | 0 | 100% | | ||
| src/hatch_cython/config/platform.py | 71 | 2 | 28 | 2 | 96% | | ||
| src/hatch_cython/constants.py | 11 | 0 | 0 | 0 | 100% | | ||
| src/hatch_cython/devel.py | 5 | 0 | 0 | 0 | 100% | | ||
| src/hatch_cython/hooks.py | 5 | 1 | 2 | 0 | 86% | | ||
| src/hatch_cython/plugin.py | 212 | 10 | 160 | 8 | 95% | | ||
| src/hatch_cython/temp.py | 11 | 0 | 0 | 0 | 100% | | ||
| src/hatch_cython/utils.py | 27 | 1 | 12 | 1 | 95% | | ||
| **TOTAL** | **618** | **29** | **317** | **21** | **94%** | | ||
| Name | Stmts | Miss | Branch | BrPart | Cover | | ||
|----------------------------------------- | -------: | -------: | -------: | -------: | ------: | | ||
| src/hatch\_cython/\_\_init\_\_.py | 2 | 0 | 0 | 0 | 100% | | ||
| src/hatch\_cython/config/\_\_init\_\_.py | 2 | 0 | 0 | 0 | 100% | | ||
| src/hatch\_cython/config/autoimport.py | 9 | 0 | 4 | 0 | 100% | | ||
| src/hatch\_cython/config/config.py | 143 | 12 | 60 | 7 | 90% | | ||
| src/hatch\_cython/config/defaults.py | 6 | 0 | 0 | 0 | 100% | | ||
| src/hatch\_cython/config/files.py | 22 | 1 | 12 | 2 | 91% | | ||
| src/hatch\_cython/config/flags.py | 70 | 1 | 26 | 0 | 99% | | ||
| src/hatch\_cython/config/includes.py | 15 | 1 | 8 | 1 | 91% | | ||
| src/hatch\_cython/config/macros.py | 12 | 0 | 7 | 0 | 100% | | ||
| src/hatch\_cython/config/platform.py | 71 | 2 | 28 | 2 | 96% | | ||
| src/hatch\_cython/config/templates.py | 62 | 7 | 34 | 3 | 90% | | ||
| src/hatch\_cython/constants.py | 11 | 0 | 0 | 0 | 100% | | ||
| src/hatch\_cython/devel.py | 5 | 0 | 0 | 0 | 100% | | ||
| src/hatch\_cython/hooks.py | 5 | 1 | 2 | 0 | 86% | | ||
| src/hatch\_cython/plugin.py | 215 | 10 | 160 | 8 | 95% | | ||
| src/hatch\_cython/temp.py | 11 | 0 | 0 | 0 | 100% | | ||
| src/hatch\_cython/utils.py | 38 | 1 | 16 | 1 | 96% | | ||
| **TOTAL** | **699** | **36** | **357** | **24** | **94%** | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# DO NOT EDIT. | ||
# Autoformatted by hatch-cython. | ||
# Version: 0.3.0 | ||
# Cython: 3.0.2 | ||
# Platform: darwin | ||
# Architecture: x86_64 | ||
# Keywords: {'supported': ['int', 'float']} | ||
|
||
# int C adder (int) | ||
def ciadd(a: int, b: int) -> int: | ||
""" | ||
Takes `a` `int` plus `b` `int` | ||
""" | ||
... | ||
|
||
# int C mul (int) | ||
def cimul(a: int, b: int) -> int: | ||
""" | ||
Takes `a` `int` times `b` `int` | ||
""" | ||
... | ||
|
||
def cipow(a: int, b: int) -> int: | ||
""" | ||
Takes `a` `int` to the power of `b` `int` | ||
""" | ||
... | ||
|
||
# float C adder (float) | ||
def cfadd(a: float, b: float) -> float: | ||
""" | ||
Takes `a` `float` plus `b` `float` | ||
""" | ||
... | ||
|
||
# float C mul (float) | ||
def cfmul(a: float, b: float) -> float: | ||
""" | ||
Takes `a` `float` times `b` `float` | ||
""" | ||
... | ||
|
||
def cfpow(a: float, b: float) -> float: | ||
""" | ||
Takes `a` `float` to the power of `b` `float` | ||
""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# DO NOT EDIT. | ||
# Autoformatted by hatch-cython. | ||
# Version: 0.3.0 | ||
# Cython: 3.0.2 | ||
# Platform: darwin | ||
# Architecture: x86_64 | ||
# Keywords: {'supported': ['int', 'float']} | ||
|
||
# int C adder (int) | ||
cpdef int ciadd(int a, int b): | ||
return a + b | ||
|
||
# int C mul (int) | ||
cpdef int cimul(int a, int b): | ||
return a * b | ||
|
||
# int C pow (int) | ||
cpdef int cipow(int a, int b): | ||
return a ** b | ||
|
||
# float C adder (float) | ||
cpdef float cfadd(float a, float b): | ||
return a + b | ||
|
||
# float C mul (float) | ||
cpdef float cfmul(float a, float b): | ||
return a * b | ||
|
||
# float C pow (float) | ||
cpdef float cfpow(float a, float b): | ||
return a ** b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
from example_lib.templated import cfpow, ciadd, cipow | ||
from platform import system | ||
|
||
from example_lib.templated import ciadd, cipow | ||
|
||
PLAT = system().lower() | ||
|
||
|
||
def test_template_ops(): | ||
assert ciadd(1, 2) == 3 | ||
assert cipow(2, 2) == 4 | ||
assert cfpow(5.5, 2) == 30.25 | ||
|
||
if PLAT in ("windows", "darwin"): | ||
from example_lib.templated import cfpow | ||
|
||
assert cfpow(5.5, 2) == 30.25 | ||
if PLAT == "windows": | ||
from example_lib.templated import ccadd | ||
|
||
assert ccadd(complex(real=4, imag=2), complex(real=2, imag=0)) == complex(real=6, imag=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2023-present joshua-auchincloss <joshua.auchincloss@proton.me> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
__version__ = "0.2.6" | ||
__version__ = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.