Content-Length: 300463 | pFad | http://github.com/mhostetter/galois/pull/511/commits/2e91806ec41c512852287a8c12ec0f42443d4f58

F0 Improve type annotations by mhostetter · Pull Request #511 · mhostetter/galois · GitHub
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

Improve type annotations #511

Open
wants to merge 28 commits into
base: release/0.4.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
acd8f10
Fix equations using `|`
mhostetter Jul 3, 2024
f49b458
Remove hyphens for adverbs ending in "ly"
mhostetter Jul 3, 2024
ff83d5e
Correct the error message for none prime power `order`
MrVeka Jul 5, 2024
5bf5c79
Add multithreading compatibility
Jul 5, 2024
a66828d
Fix typing of overloads
mhostetter May 13, 2023
5dfccd6
Remove `int`/`np.integer` equivalent inputs
mhostetter May 13, 2023
7f9586a
Fix decorators on top of `@property` type error
mhostetter Sep 30, 2023
7e5af63
Fix type annotations for globals
mhostetter Sep 30, 2023
7690a55
Ignore `numba` when static type checking
mhostetter Sep 30, 2023
45743a0
Make separate `berlekamp_decode_jit()` function
mhostetter Sep 30, 2023
7df83e8
Instruct `mypy` to ignore useless arithmetic methods
mhostetter Sep 30, 2023
2e91806
Fix abstract methods in `Function`
mhostetter Sep 30, 2023
a062b5b
Fix type hints for more globals
mhostetter Sep 30, 2023
1094fa4
Fix types for `Poly` classmethods
mhostetter Sep 30, 2023
303dc28
Allow `Function.implementation()` to not be redefined
mhostetter Sep 30, 2023
1be6893
Ignore weird metaclass type conflict
mhostetter Sep 30, 2023
04905a7
Fix types for polynomial arithmetic
mhostetter Sep 30, 2023
c0d1a5a
Fix types of int/str conversions
mhostetter Sep 30, 2023
190b9f3
Type `Array` indexed output
mhostetter Sep 30, 2023
149c901
Add `cast()` to output of NumPy functions
mhostetter Sep 30, 2023
dd6517a
Fix different types with same variable name
mhostetter Sep 30, 2023
93862a7
Fix types for poly conversions
mhostetter Sep 30, 2023
4432a16
Enable NumPy `mypy` plugin
mhostetter Sep 30, 2023
e300817
Use `npt.NDArray`
mhostetter Sep 30, 2023
e090ed8
Fix invalid `EGCD` reference
mhostetter Sep 30, 2023
e72953c
Auto fix in `pre-commit`
mhostetter Nov 4, 2023
0a78ae4
Fix various types with `cast()`
mhostetter Nov 4, 2023
e9fe21b
Fix lint errors
mhostetter Jul 5, 2024
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
Prev Previous commit
Next Next commit
Fix abstract methods in Function
  • Loading branch information
mhostetter committed Jul 5, 2024
commit 2e91806ec41c512852287a8c12ec0f42443d4f58
15 changes: 11 additions & 4 deletions src/galois/_domains/_function.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Callable, Type
from abc import abstractmethod
from typing import TYPE_CHECKING, Callable, Hashable, Type, cast

import numba
import numpy as np
@@ -29,7 +30,8 @@ class Function:
def __init__(self, field: Type[Array]):
self.field = field

def __call__(self):
@abstractmethod
def __call__(self, *args, **kwargs):
"""
Invokes the function, either JIT-compiled or pure-Python, performing necessary input/output conversion.
"""
@@ -48,8 +50,13 @@ def set_globals(self):
_PARALLEL = False
"""Indicates if parallel processing should be performed."""

implementation: Callable
"""The function's implementation in pure Python."""
@abstractmethod
@staticmethod
def implementation(*args, **kwargs):
"""
The function's implementation in pure Python.
"""
raise NotImplementedError

###############################################################################
# Various ufuncs based on implementation and compilation








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mhostetter/galois/pull/511/commits/2e91806ec41c512852287a8c12ec0f42443d4f58

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy