pythonic-fp-numpy 1.0.0__tar.gz → 6.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. pythonic_fp_numpy-6.0.0/PKG-INFO +51 -0
  2. pythonic_fp_numpy-6.0.0/README.md +27 -0
  3. {pythonic_fp_numpy-1.0.0 → pythonic_fp_numpy-6.0.0}/pyproject.toml +37 -23
  4. {pythonic_fp_numpy-1.0.0 → pythonic_fp_numpy-6.0.0}/src/pythonic_fp/numpy/hashable_wrapped_ndarray.py +5 -4
  5. pythonic_fp_numpy-1.0.0/.github/workflows/static.yml +0 -64
  6. pythonic_fp_numpy-1.0.0/.gitignore +0 -9
  7. pythonic_fp_numpy-1.0.0/CHANGELOG.rst +0 -84
  8. pythonic_fp_numpy-1.0.0/PKG-INFO +0 -62
  9. pythonic_fp_numpy-1.0.0/README.rst +0 -36
  10. pythonic_fp_numpy-1.0.0/docs/Makefile +0 -78
  11. pythonic_fp_numpy-1.0.0/docs/gen_conf.py +0 -110
  12. pythonic_fp_numpy-1.0.0/docs/requirements.txt +0 -2
  13. pythonic_fp_numpy-1.0.0/docs/source/_static/.gitkeep +0 -0
  14. pythonic_fp_numpy-1.0.0/docs/source/_static/custom.css +0 -3
  15. pythonic_fp_numpy-1.0.0/docs/source/_templates/.gitkeep +0 -0
  16. pythonic_fp_numpy-1.0.0/docs/source/api/hashable_wrapped_ndarray.rst +0 -6
  17. pythonic_fp_numpy-1.0.0/docs/source/api/index.rst +0 -13
  18. pythonic_fp_numpy-1.0.0/docs/source/changelog.rst +0 -7
  19. pythonic_fp_numpy-1.0.0/docs/source/description.rst +0 -7
  20. pythonic_fp_numpy-1.0.0/docs/source/index.rst +0 -30
  21. pythonic_fp_numpy-1.0.0/docs/source/releases.rst +0 -18
  22. pythonic_fp_numpy-1.0.0/docs/source/usage.rst +0 -32
  23. pythonic_fp_numpy-1.0.0/src/pythonic_fp/numpy/__init__.pyi +0 -0
  24. pythonic_fp_numpy-1.0.0/src/pythonic_fp/numpy/hashable_wrapped_ndarray.pyi +0 -48
  25. pythonic_fp_numpy-1.0.0/tests/hashable_wrapped_ndarray/test_HWrapNDArrayNumber.py +0 -140
  26. {pythonic_fp_numpy-1.0.0 → pythonic_fp_numpy-6.0.0}/LICENSE +0 -0
  27. {pythonic_fp_numpy-1.0.0 → pythonic_fp_numpy-6.0.0}/src/pythonic_fp/numpy/__init__.py +0 -0
  28. {pythonic_fp_numpy-1.0.0 → pythonic_fp_numpy-6.0.0}/src/pythonic_fp/numpy/py.typed +0 -0
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: pythonic-fp-numpy
3
+ Version: 6.0.0
4
+ Summary: FP tools for Numpy
5
+ Keywords: numpy,ndarray,hashable,wrap
6
+ Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
+ Requires-Python: >=3.14
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Framework :: Pytest
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Classifier: Typing :: Typed
17
+ License-File: LICENSE
18
+ Requires-Dist: numpy>=2.3.4
19
+ Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-numpy/blob/main/CHANGELOG.md
20
+ Project-URL: Documentation, https://grscheller.github.io/pythonic-fp-numpy
21
+ Project-URL: Homepage, https://grscheller.github.io/pythonic-fp
22
+ Project-URL: Source, https://github.com/grscheller/pythonic-fp-numpy
23
+
24
+ # Pythonic FP - FP Numpy
25
+
26
+ Python package implementing functional programming tools for NumPy.
27
+
28
+ PyPI project
29
+ [pythonic-fp-numpy](https://pypi.org/project/pythonic-fp-numpy).
30
+ Part of the
31
+ [pythonic-fp](https://grscheller.github.io/pythonic-fp)
32
+ PyPI projects.
33
+
34
+ ## Documentation
35
+
36
+ Documentation and other links for this project are hosted on
37
+ [GitHub Pages](https://grscheller.github.io/pythonic-fp-numpy).
38
+
39
+ ### Modules
40
+
41
+ #### Module hashable_wrapped_ndarray
42
+
43
+ - wrap readonly NDArrays to make them hashable
44
+ - prioritize performance over safety
45
+ - see PyPI project boring-math-abstract-algebra for a use case
46
+
47
+ ## Copyright and License
48
+
49
+ Copyright (c) 2025-2026 Geoffrey R. Scheller. Licensed under the Apache
50
+ License, Version 2.0. See the LICENSE file for details.
51
+
@@ -0,0 +1,27 @@
1
+ # Pythonic FP - FP Numpy
2
+
3
+ Python package implementing functional programming tools for NumPy.
4
+
5
+ PyPI project
6
+ [pythonic-fp-numpy](https://pypi.org/project/pythonic-fp-numpy).
7
+ Part of the
8
+ [pythonic-fp](https://grscheller.github.io/pythonic-fp)
9
+ PyPI projects.
10
+
11
+ ## Documentation
12
+
13
+ Documentation and other links for this project are hosted on
14
+ [GitHub Pages](https://grscheller.github.io/pythonic-fp-numpy).
15
+
16
+ ### Modules
17
+
18
+ #### Module hashable_wrapped_ndarray
19
+
20
+ - wrap readonly NDArrays to make them hashable
21
+ - prioritize performance over safety
22
+ - see PyPI project boring-math-abstract-algebra for a use case
23
+
24
+ ## Copyright and License
25
+
26
+ Copyright (c) 2025-2026 Geoffrey R. Scheller. Licensed under the Apache
27
+ License, Version 2.0. See the LICENSE file for details.
@@ -4,9 +4,10 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "pythonic-fp-numpy"
7
- version = "1.0.0"
8
- readme = "README.rst"
9
- requires-python = ">=3.13"
7
+ version = "6.0.0"
8
+ description = "FP tools for Numpy"
9
+ readme = "README.md"
10
+ requires-python = ">=3.14" # floor: PEP 649/749 deferred annotations — class-level self-reference NameErrors on <3.14
10
11
  authors = [
11
12
  { name = "Geoffrey R. Scheller", email = "geoffrey@scheller.com" },
12
13
  ]
@@ -23,53 +24,67 @@ classifiers = [
23
24
  "License :: OSI Approved :: Apache Software License",
24
25
  "Operating System :: OS Independent",
25
26
  "Programming Language :: Python :: 3.14",
27
+ "Programming Language :: Python :: 3.15",
26
28
  "Typing :: Typed",
27
29
  ]
28
30
  dependencies = [
29
31
  "numpy>=2.3.4",
30
32
  ]
31
- dynamic = ["description"]
32
33
 
33
34
  [project.urls]
34
- Changelog = "https://github.com/grscheller/pythonic-fp-numpy/blob/main/CHANGELOG.rst"
35
- Documentation = "https://grscheller.github.io/pythonic-fp/projects/numpy.html"
36
- Homepage = "https://grscheller.github.io/pythonic-fp/"
35
+ Changelog = "https://github.com/grscheller/pythonic-fp-numpy/blob/main/CHANGELOG.md"
36
+ Documentation ="https://grscheller.github.io/pythonic-fp-numpy"
37
+ Homepage = "https://grscheller.github.io/pythonic-fp"
37
38
  Source = "https://github.com/grscheller/pythonic-fp-numpy"
38
39
 
39
- [project.optional-dependencies]
40
+ [dependency-groups]
41
+ docs = [
42
+ "furo>=2025.12.19",
43
+ "sphinx>=9.1",
44
+ ]
40
45
  test = [
41
- "boring-math-abstract-algebra>=1.1.0",
42
46
  "pytest>=8.4.1",
47
+ "boring-math-abstract-algebra",
43
48
  ]
44
49
 
45
50
  [tool.flit.module]
46
51
  name = "pythonic_fp.numpy"
47
52
 
53
+ [tool.flit.sdist]
54
+ exclude = [
55
+ "docs/",
56
+ "tests/",
57
+ "**/.mypy_cache/",
58
+ "**/.ruff_cache/",
59
+ "**/.pytest_cache/",
60
+ "**/__pycache__/",
61
+ "**/.dmypy.json",
62
+ ]
63
+
64
+ [tool.pytest]
65
+ addopts = ["-ra"]
66
+ consider_namespace_packages = true
67
+ testpaths = ["tests/"]
68
+
48
69
  [tool.mypy]
49
70
  explicit_package_bases = true
50
71
  local_partial_types = true
51
72
  namespace_packages = true
73
+ strict = true
52
74
  warn_redundant_casts = true
53
75
  warn_return_any = true
54
76
  warn_unused_configs = true
55
77
 
56
- [tool.pylsp-mypy]
57
- enabled = true
58
- live-mode = true
59
- dmypy = false
60
- strict = true
61
- report_progress = true
62
-
63
- [tool.pytest]
64
- addopts = [
65
- "-ra",
66
- ]
67
- consider_namespace_packages = true
68
- testpaths = ["tests/"]
78
+ [[tool.mypy.overrides]]
79
+ module = ["tests.*"]
80
+ strict_equality = false
69
81
 
70
82
  [tool.ruff]
71
83
  target-version = "py314"
72
84
 
85
+ [tool.ruff.lint]
86
+ ignore = ["RUF022", "E741"]
87
+
73
88
  [tool.ruff.lint.flake8-quotes]
74
89
  docstring-quotes = "double"
75
90
 
@@ -78,7 +93,6 @@ docstring-quotes = "double"
78
93
  "E731",
79
94
  "C901",
80
95
  ]
81
- "**/*.py" = ["E741"]
82
96
 
83
97
  [tool.ruff.format]
84
98
  quote-style = "single"
@@ -13,7 +13,8 @@
13
13
  # limitations under the License.
14
14
 
15
15
  from abc import ABC, abstractmethod
16
- from enum import auto, Enum
16
+ from enum import Enum, auto
17
+
17
18
  import numpy as np
18
19
  import numpy.typing as npt
19
20
 
@@ -75,7 +76,7 @@ class HWrapNDArray(ABC):
75
76
 
76
77
  """
77
78
 
78
- __slots__ = '_ndarray', '_type', '_shape', '_hash'
79
+ __slots__ = '_hash', '_ndarray', '_shape', '_type'
79
80
 
80
81
  def __init__(self, ndarray: npt.NDArray[np.generic]) -> None:
81
82
  """
@@ -127,7 +128,7 @@ class HWrapNDArray(ABC):
127
128
  - Never make the underlying NDArray writable!!!
128
129
 
129
130
  """
130
- return np.array(self._ndarray)
131
+ return np.array(iter(self._ndarray))
131
132
 
132
133
  def __hash__(self) -> int:
133
134
  """
@@ -185,7 +186,7 @@ class HWrapNDArray(ABC):
185
186
  Return a copy of the wrapped NDArray.
186
187
 
187
188
  """
188
- return np.array(self._ndarray, copy=True)
189
+ return np.array(iter(self._ndarray), copy=True)
189
190
 
190
191
 
191
192
  class HWrapNDArrayNumber(HWrapNDArray):
@@ -1,64 +0,0 @@
1
- name: Build and Deploy Furo Themed Sphinx Documentation
2
-
3
- on:
4
- push:
5
- branches: ["main"]
6
- workflow_dispatch:
7
-
8
- env:
9
- RELEASE: '1.0.0'
10
- DEVEL: '1.0.1'
11
- PYTHON: '3.14'
12
-
13
- permissions:
14
- contents: read
15
- pages: write
16
- id-token: write
17
-
18
- concurrency:
19
- group: "pages"
20
- cancel-in-progress: false
21
-
22
- jobs:
23
- deploy:
24
- runs-on: ubuntu-latest
25
- environment:
26
- name: github-pages
27
- url: ${{ steps.deployment.outputs.page_url }}
28
- steps:
29
- - name: Checkout
30
- uses: actions/checkout@v6
31
-
32
- - name: Select Python
33
- uses: actions/setup-python@v6
34
- with:
35
- python-version: '3.14'
36
-
37
- - name: Install Sphinx Dependencies
38
- run: |
39
- pip install -r docs/requirements.txt
40
- sudo apt-get install -y graphviz
41
-
42
- - name: Build Release Docs
43
- run: |
44
- pip install pythonic-fp-numpy
45
- docs/gen_conf.py release ${{ env.RELEASE }} Numpy numpy > docs/source/conf.py
46
- sphinx-build -M html docs/source docs/build/release
47
-
48
- - name: Build Development Docs
49
- run: |
50
- pip install -e .
51
- docs/gen_conf.py devel ${{ env.DEVEL }} Numpy numpy > docs/source/conf.py
52
- sphinx-build -M html docs/source docs/build/development
53
-
54
- - name: Setup Pages
55
- uses: actions/configure-pages@v6
56
-
57
- - name: Upload Artifact
58
- uses: actions/upload-pages-artifact@v5
59
- with:
60
- path: docs/build
61
-
62
- - name: Deploy to GitHub Pages
63
- uses: actions/deploy-pages@v5
64
- id: deployment
@@ -1,9 +0,0 @@
1
- # Minimal version - only add to when necessary
2
- **/__pycache__/
3
- dist/
4
- docs/build/
5
- docs/source/conf.py
6
- **/.dmypy.json
7
- **/.mypy_cache/
8
- **/.pytest_cache/
9
- **/.ruff_cache
@@ -1,84 +0,0 @@
1
- CHANGELOG
2
- =========
3
-
4
- PyPI pythonic-fp-numpy project.
5
-
6
- Semantic Versioning
7
- -------------------
8
-
9
- Strict 3 digit semantic versioning
10
-
11
- - **MAJOR** version incremented for incompatible API changes
12
- - **MINOR** version incremented for backward compatible added functionality
13
- - **PATCH** version incremented for backward compatible bug fixes
14
-
15
- See `Semantic Versioning 2.0.0 <https://semver.org>`_.
16
-
17
- Releases and Important Milestones
18
- ---------------------------------
19
-
20
- PyPI v1.0.0 - 2026-05-14
21
- ~~~~~~~~~~~~~~~~~~~~~~~~
22
-
23
- Now repr() produces something you can eval() to reproduce a ``HWrapNDArray``.
24
-
25
- ```python
26
-
27
- import numpy as np
28
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayNumber
29
-
30
- foo = HWrapNDArrayNumber(
31
- np.array(
32
- [[2, -3, 6],
33
- [1, -1, 2],
34
- [17, 18, -11],
35
- [2, 1, 11]],
36
- dtype=np.int32,
37
- )
38
- )
39
-
40
- assert foo == eval(repr(foo))
41
-
42
- ```
43
-
44
- Development Status Reappraisal - 2026-05-05
45
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46
-
47
- Maintainer appraised the Development Status for
48
- pythonic-fp-numpy to be ``"3 - Alpha"``.
49
-
50
- PyPI v0.1.2 - 2026-01-16
51
- ~~~~~~~~~~~~~~~~~~~~~~~~
52
-
53
- Fixed some documentation rough edges. Added *.pyi stub files. Updated __repr__
54
- behavior for HWrapNDArray derived classes. Eliminated spaces.
55
-
56
- Future directions.
57
-
58
- - define ``+``, ``*``, and ``@`` on wrapped arrays.
59
- - more tests
60
-
61
-
62
- PyPI v0.1.1 - 2025-12-01
63
- ~~~~~~~~~~~~~~~~~~~~~~~~
64
-
65
- Fixed problem with the extra test dependencies.
66
-
67
-
68
- PyPI v0.1.0 - 2025-11-30
69
- ~~~~~~~~~~~~~~~~~~~~~~~~
70
-
71
- Initial PyPI release.
72
-
73
- Update - 2025-11-26
74
- ~~~~~~~~~~~~~~~~~~~
75
-
76
- Created GitHub repo for this new effort.
77
-
78
- Previously wrote a hashable wrapper for NumPy NDArray for the test suite
79
- of my boring-math-abstract-algebra PyPI project.
80
-
81
- Makes an NDArray readonly and hashable.
82
-
83
- Will need to drop the "only requires the Python std library" requirement
84
- for pythonic-fp projects.
@@ -1,62 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pythonic-fp-numpy
3
- Version: 1.0.0
4
- Summary: NumPy Tools
5
- Keywords: numpy,ndarray,hashable,wrap
6
- Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
- Requires-Python: >=3.13
8
- Description-Content-Type: text/x-rst
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Framework :: Pytest
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3.14
15
- Classifier: Typing :: Typed
16
- License-File: LICENSE
17
- Requires-Dist: numpy>=2.3.4
18
- Requires-Dist: boring-math-abstract-algebra>=1.1.0 ; extra == "test"
19
- Requires-Dist: pytest>=8.4.1 ; extra == "test"
20
- Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-numpy/blob/main/CHANGELOG.rst
21
- Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/projects/numpy.html
22
- Project-URL: Homepage, https://grscheller.github.io/pythonic-fp/
23
- Project-URL: Source, https://github.com/grscheller/pythonic-fp-numpy
24
- Provides-Extra: test
25
-
26
- Pythonic FP - FP Numpy
27
- ======================
28
-
29
- PyPI project
30
- `pythonic-fp-numpy
31
- <https://pypi.org/project/pythonic-fp-numpy>`_.
32
-
33
- Python package implementing functional programming for NumPy.
34
-
35
- Part of the
36
- `pythonic-fp
37
- <https://grscheller.github.io/pythonic-fp/>`_
38
- PyPI projects.
39
-
40
- Modules
41
- -------
42
-
43
- Module hashable_wrapped_ndarray
44
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
-
46
- - wrap readonly NDArrays to make them hashable
47
- - prioritize performance over safety
48
- - see PyPI project boring-math-abstract-algebra for a use case
49
-
50
- Documentation
51
- -------------
52
-
53
- Documentation and other links for this project are hosted on
54
- `GitHub Pages
55
- <https://grscheller.github.io/pythonic-fp/projects/numpy.html>`_.
56
-
57
- Copyright and License
58
- ---------------------
59
-
60
- Copyright (c) 2025-2026 Geoffrey R. Scheller. Licensed under the Apache
61
- License, Version 2.0. See the LICENSE file for details.
62
-
@@ -1,36 +0,0 @@
1
- Pythonic FP - FP Numpy
2
- ======================
3
-
4
- PyPI project
5
- `pythonic-fp-numpy
6
- <https://pypi.org/project/pythonic-fp-numpy>`_.
7
-
8
- Python package implementing functional programming for NumPy.
9
-
10
- Part of the
11
- `pythonic-fp
12
- <https://grscheller.github.io/pythonic-fp/>`_
13
- PyPI projects.
14
-
15
- Modules
16
- -------
17
-
18
- Module hashable_wrapped_ndarray
19
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
-
21
- - wrap readonly NDArrays to make them hashable
22
- - prioritize performance over safety
23
- - see PyPI project boring-math-abstract-algebra for a use case
24
-
25
- Documentation
26
- -------------
27
-
28
- Documentation and other links for this project are hosted on
29
- `GitHub Pages
30
- <https://grscheller.github.io/pythonic-fp/projects/numpy.html>`_.
31
-
32
- Copyright and License
33
- ---------------------
34
-
35
- Copyright (c) 2025-2026 Geoffrey R. Scheller. Licensed under the Apache
36
- License, Version 2.0. See the LICENSE file for details.
@@ -1,78 +0,0 @@
1
- # Makefile for Sphinx documentation
2
-
3
- # Last and future releases
4
- # - former needs to agree with PyPI
5
- # - later needs to agree with pyproject.toml
6
- PROJECT_NAME = Numpy
7
- PYPI_NAME = numpy
8
- RELEASE_VERSION = 1.0.0
9
- DEVEL_VERSION = 1.0.1
10
- CUSTOM_VERSION = 0.0.0
11
-
12
- SPHINXOPTS ?=
13
- SPHINXBUILD ?= sphinx-build
14
- SOURCEDIR = source
15
- BUILDDIR = build
16
-
17
- STATICDIR = source/_static
18
- TEMPLATEDIR = source/_templates
19
-
20
- # Put help first so that "make" without argument is like "make help".
21
- help:
22
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
23
-
24
- clean_source:
25
- @rm -f "$(SOURCEDIR)"/conf.py
26
-
27
- clean_devel:
28
- @rm -rf "$(BUILDDIR)"/development
29
-
30
- clean_release:
31
- @rm -rf "$(BUILDDIR)"/release
32
-
33
- clean_custom:
34
- @rm -rf "$(BUILDDIR)"/custom
35
-
36
- clean: clean_devel clean_release clean_custom clean_source
37
- @rm -rf $(BUILDDIR)
38
- @echo Removed all doc build artifacts.
39
-
40
- setup_devel: clean_devel
41
- @./gen_conf.py devel "$(DEVEL_VERSION)" "$(PROJECT_NAME)" "$(PYPI_NAME)" > "$(SOURCEDIR)"/conf.py
42
-
43
- setup_release: clean_release
44
- @./gen_conf.py release "$(RELEASE_VERSION)" "$(PROJECT_NAME)" "$(PYPI_NAME)" > "$(SOURCEDIR)"/conf.py
45
-
46
- setup_custom: clean_custom
47
- @./gen_conf.py custom "$(CUSTOM_VERSION)" "$(PROJECT_NAME)" "$(PYPI_NAME)" > "$(SOURCEDIR)"/conf.py
48
-
49
- setup_redo: clean_custom
50
- @echo Redoing custom build with a possibly reeditted conf.py
51
- @./gen_conf.py redo "" "" ""
52
-
53
- # Build development labeled html docs.
54
- devel: Makefile setup_devel
55
- @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"/development $(SPHINXOPTS)
56
-
57
- # Build release labeled html docs.
58
- release: Makefile setup_release
59
- @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"/release $(SPHINXOPTS)
60
-
61
- # Build custom labeled html docs.
62
- custom: Makefile setup_custom
63
- @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"/custom $(SPHINXOPTS)
64
-
65
- # Build HTML docs with previous generated (possibly hand edited) source/conf.py,
66
- # put results in $(BUILDDIR)/custom.
67
- redo: Makefile setup_redo
68
- @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"/custom $(SPHINXOPTS)
69
-
70
- # Catch-all target: route all unknown targets to Sphinx and save to $(BUILDDIR)/custom.
71
- # Reuse a previously generated source/conf.py.
72
- %: Makefile setup_redo
73
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)"/custom $(SPHINXOPTS)
74
-
75
- .PHONY: help Makefile
76
- .PHONY: setup_devel setup_release setup_custom
77
- .PHONY: devel release
78
- .PHONY: clean_source clean_devel clean_release clean_custom clean
@@ -1,110 +0,0 @@
1
- #!/usr/bin/env python
2
- # Generate conf.py Sphinx configuration executable
3
-
4
- import sys
5
- import os
6
-
7
- project_prefix = 'Pythonic FP'
8
- pypi_prefix = 'pythonic-fp'
9
- author = 'Geoffrey R. Scheller'
10
- copyright = f'2023-2026, {author}'
11
-
12
- args = sys.argv[1:]
13
- num_args = len(args)
14
-
15
- if num_args == 4:
16
- build_type, version, project_name, pypi_name = args
17
- project = project_prefix + ' - ' + project_name
18
- pypi_project_repo = pypi_prefix + '-' + pypi_name
19
- project_url_rst = f'`{project} <https://pypi.org/project/{pypi_project_repo}/>`_'
20
- homepage_url_rst = f'`{project_prefix} <https://grscheller.github.io/{pypi_prefix}/>`_'
21
-
22
- else:
23
- sys.exit('Error: gen_conf.py takes exactly 4 arguments')
24
-
25
- match build_type:
26
- case 'custom':
27
- release = f'{version}'
28
- release_string = f'**Custom PyPI Non-release version {release}**'
29
- case 'devel':
30
- release = f'{version}'
31
- release_string = f'**Proposed PyPI release version {release}**'
32
- case 'release':
33
- release = f'{version}'
34
- release_string = f'**PyPI release version {release}**'
35
- case 'redo':
36
- if not os.path.isfile('source/conf.py'):
37
- sys.exit('Error: cannot redo without source/conf.py')
38
- sys.exit()
39
- case _:
40
- sys.exit(f'Error: unknown built_type {build_type} given')
41
-
42
- print(f'''# Generated conf.py Sphinx configuration executable
43
-
44
- from typing import Any
45
- from sphinx.application import Sphinx
46
-
47
- project = '{project}'
48
- author = '{author}'
49
- copyright = '{copyright}'
50
- release = '{release}'
51
- release_string = '{release_string}'
52
-
53
- def skip_abc_methods(
54
- app: Any, what: str, name: str, obj: Any, skip: bool, options: Any
55
- ) -> bool:
56
- if name in [
57
- '__init_subclass__',
58
- '__subclasshook__',
59
- '__class_getitem__',
60
- '__weakref__',
61
- ]:
62
- return True # Skip these members
63
- return skip
64
-
65
-
66
- def setup(app: Sphinx) -> None:
67
- app.connect('autodoc-skip-member', skip_abc_methods)
68
-
69
-
70
- extensions = [
71
- 'sphinx.ext.autodoc',
72
- 'sphinx.ext.graphviz',
73
- ]
74
-
75
- autodoc_default_options = {{
76
- 'members': True,
77
- 'private-members': True,
78
- 'special-members': True,
79
- 'inherited-members': False,
80
- 'show-inheritance': True,
81
- }}
82
- autodoc_member_order = 'bysource'
83
- autoclass_content = 'class'
84
- autodoc_class_signature = 'separated'
85
- autodoc_typehints_format = 'short'
86
- autodoc_use_type_comments = True
87
- autodoc_docstring_signature = False
88
- autodoc_preserve_defaults = True
89
- autodoc_warningiserror = False
90
-
91
- templates_path = ['_templates']
92
- exclude_patterns: list[str] = []
93
-
94
- html_theme_options = {{
95
- 'light_css_variables': {{
96
- 'color-link--visited': 'var(--color-link)',
97
- }},
98
- 'dark_css_variables': {{
99
- 'color-link--visited': 'var(--color-link)',
100
- }},
101
- }}
102
- html_theme = 'furo'
103
- html_static_path = ['_static']
104
- html_css_files = ['custom.css']
105
-
106
- rst_epilog = """
107
- .. |RELEASE_STRING| replace:: {release_string}
108
-
109
- """
110
- ''')
@@ -1,2 +0,0 @@
1
- sphinx>=9.1
2
- furo
File without changes
@@ -1,3 +0,0 @@
1
- dl.field-list > dt {
2
- text-transform: none !important;
3
- }
File without changes
@@ -1,6 +0,0 @@
1
- hashable_wrapped_ndarray
2
- ------------------------
3
-
4
- .. automodule:: pythonic_fp.numpy.hashable_wrapped_ndarray
5
- :show-inheritance:
6
- :exclude-members: __weakref__
@@ -1,13 +0,0 @@
1
- FP Numpy
2
- ========
3
-
4
- .. automodule:: pythonic_fp.iterables
5
- :no-members:
6
- :ignore-module-all:
7
- :no-index:
8
-
9
- .. toctree::
10
- :caption: Wrapprd Hashable NDArray
11
- :maxdepth: 1
12
-
13
- hashable_wrapped_ndarray
@@ -1,7 +0,0 @@
1
- changelog
2
- ---------
3
-
4
- Changelog for the
5
- `pythonic-fp-numpy
6
- <https://github.com/grscheller/pythonic-fp-numpy/blob/main/CHANGELOG.rst>`_
7
- PyPI project.
@@ -1,7 +0,0 @@
1
- Description
2
- -----------
3
-
4
- .. automodule:: pythonic_fp.numpy
5
- :synopsis:
6
- :noindex:
7
-
@@ -1,30 +0,0 @@
1
- pythonic-fp-numpy
2
- =================
3
-
4
- Project
5
- `Pythonic FP - Numpy <https://pypi.org/project/pythonic-fp-numpy/>`_
6
- one of the
7
- `Pythonic FP <https://grscheller.github.io/pythonic-fp/>`_
8
- PyPI projects.
9
-
10
- |RELEASE_STRING|
11
-
12
- .. toctree::
13
- :caption: Overview
14
- :hidden:
15
-
16
- self
17
-
18
- .. toctree::
19
- :caption: User Documentation
20
-
21
- description
22
- usage
23
- releases
24
- changelog
25
-
26
- .. toctree::
27
- :caption: API Documentation
28
- :maxdepth: 1
29
-
30
- api/index
@@ -1,18 +0,0 @@
1
- PyPI releases
2
- =============
3
-
4
- **pythonic-fp-numpy:** pythonic_fp.numpy
5
-
6
- +-----------------------------------------------------------------------------------+--------------+
7
- | PyPI Release | Release date |
8
- +===================================================================================+==============+
9
- | `development <https://grscheller.github.io/pythonic-fp-numpy/development/html/>`_ | |
10
- +-----------------------------------------------------------------------------------+--------------+
11
- | `v1.0.0 <https://grscheller.github.io/pythonic-fp-numpy/release/html/>`_ | 2026-05-14 |
12
- +-----------------------------------------------------------------------------------+--------------+
13
- | v0.1.2 | 2026-01-16 |
14
- +-----------------------------------------------------------------------------------+--------------+
15
- | v0.1.1 | 2025-12-01 |
16
- +-----------------------------------------------------------------------------------+--------------+
17
- | v0.1.0 | 2025-11-30 |
18
- +-----------------------------------------------------------------------------------+--------------+
@@ -1,32 +0,0 @@
1
- Usage
2
- =====
3
-
4
- How to install the package
5
- --------------------------
6
-
7
- Install the project into your Python environment:
8
-
9
- .. code:: console
10
-
11
- $ pip install pythonic-fp.numpy
12
-
13
- Importing the package
14
- ---------------------
15
-
16
- Import the modules.
17
-
18
- .. code:: python
19
-
20
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayNumber
21
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayString
22
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayBytes
23
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayVoid
24
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayObject
25
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayDateTime
26
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayTimeDelta
27
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayBool
28
-
29
- Use case examples
30
- -----------------
31
-
32
- TODO:
@@ -1,48 +0,0 @@
1
- import abc
2
- import numpy as np
3
- import numpy.typing as npt
4
- from abc import ABC
5
- from enum import Enum
6
-
7
- __all__ = ['DTypes', 'HWrapNDArray', 'HWrapNDArrayNumber', 'HWrapNDArrayString', 'HWrapNDArrayBytes', 'HWrapNDArrayVoid', 'HWrapNDArrayObject', 'HWrapNDArrayDateTime', 'HWrapNDArrayTimeDelta', 'HWrapNDArrayBool']
8
-
9
- class DTypes(Enum):
10
- number = ...
11
- str_ = ...
12
- bytes = ...
13
- void = ...
14
- object_ = ...
15
- datetime64 = ...
16
- timedelta64 = ...
17
- bool_ = ...
18
-
19
- class HWrapNDArray(ABC, metaclass=abc.ABCMeta):
20
- def __init__(self, ndarray: npt.NDArray[np.generic]) -> None: ...
21
- def __call__(self) -> npt.NDArray[np.number]: ...
22
- def __hash__(self) -> int: ...
23
- def __eq__(self, other: object) -> bool: ...
24
- def copy(self) -> npt.NDArray[np.number]: ...
25
-
26
- class HWrapNDArrayNumber(HWrapNDArray):
27
- def __init__(self, ndarray: npt.NDArray[np.number]) -> None: ...
28
-
29
- class HWrapNDArrayString(HWrapNDArray):
30
- def __init__(self, ndarray: npt.NDArray[np.str_]) -> None: ...
31
-
32
- class HWrapNDArrayBytes(HWrapNDArray):
33
- def __init__(self, ndarray: npt.NDArray[np.bytes_]) -> None: ...
34
-
35
- class HWrapNDArrayVoid(HWrapNDArray):
36
- def __init__(self, ndarray: npt.NDArray[np.void]) -> None: ...
37
-
38
- class HWrapNDArrayObject(HWrapNDArray):
39
- def __init__(self, ndarray: npt.NDArray[np.object_]) -> None: ...
40
-
41
- class HWrapNDArrayDateTime(HWrapNDArray):
42
- def __init__(self, ndarray: npt.NDArray[np.datetime64]) -> None: ...
43
-
44
- class HWrapNDArrayTimeDelta(HWrapNDArray):
45
- def __init__(self, ndarray: npt.NDArray[np.timedelta64]) -> None: ...
46
-
47
- class HWrapNDArrayBool(HWrapNDArray):
48
- def __init__(self, ndarray: npt.NDArray[np.bool_]) -> None: ...
@@ -1,140 +0,0 @@
1
- # Copyright 2025 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- import numpy as np
16
- import numpy.typing as npt
17
- from boring_math.abstract_algebra.algebras.semigroup import Semigroup
18
- from pythonic_fp.numpy.hashable_wrapped_ndarray import HWrapNDArrayNumber
19
-
20
- type I32_2x2 = HWrapNDArrayNumber[npt.NDArray[np.int32]]
21
-
22
-
23
- def matrix_mult(left: I32_2x2, right: I32_2x2) -> I32_2x2:
24
- return HWrapNDArrayNumber(left() @ right())
25
-
26
-
27
- m2x2 = Semigroup[I32_2x2](mult=matrix_mult)
28
-
29
- np_eye = HWrapNDArrayNumber(np.eye(2, dtype=np.int32))
30
- np_zero = HWrapNDArrayNumber(np.zeros((2, 2), dtype=np.int32))
31
- np_A = HWrapNDArrayNumber(np.array([[5, -1], [0, 2]], dtype=np.int32))
32
- np_B = HWrapNDArrayNumber(np.array([[2, -1], [-1, 2]], dtype=np.int32))
33
- np_C = HWrapNDArrayNumber(np.array([[1, 1], [1, 1]], dtype=np.int32))
34
- np_D = HWrapNDArrayNumber(np.array([[0, 1], [1, 0]], dtype=np.int32))
35
- np_E = HWrapNDArrayNumber(np.array([[11, -7], [-2, 4]], dtype=np.int32))
36
-
37
-
38
- Eye = m2x2(np_eye)
39
- Zero = m2x2(np_zero)
40
- A = m2x2(np_A)
41
- B = m2x2(np_B)
42
- C = m2x2(np_C)
43
- D = m2x2(np_D)
44
- E = m2x2(np_E)
45
-
46
-
47
- class Test_number_with_int32:
48
- def test_equality(self) -> None:
49
- assert Eye * Eye == Eye
50
- assert Eye * A == A
51
- assert B * Eye == B
52
- assert E * Zero == Zero
53
- assert Zero * E == Zero
54
- assert (A * B) * C == A * (B * C)
55
- assert D * D == Eye
56
- assert A * B == E
57
-
58
- def test_identity(self) -> None:
59
- assert Eye * Eye is Eye
60
- assert Eye * A is A
61
- assert B * Eye is B
62
- assert E * Zero is Zero
63
- assert Zero * E is Zero
64
- assert (A * B) * C is A * (B * C)
65
- assert D * D is Eye
66
- assert A * B is E
67
-
68
- def test_pow(self) -> None:
69
- Eye**5 == Eye
70
- Eye**5 is Eye
71
-
72
- def test_str(self) -> None:
73
- assert str(A()) == '<< [[ 5 -1]\n [ 0 2]] >>'
74
- assert str(np_A) == '<< [[ 5 -1]\n [ 0 2]] >>'
75
- assert str(B()) == '<< [[ 2 -1]\n [-1 2]] >>'
76
- assert str(np_B) == '<< [[ 2 -1]\n [-1 2]] >>'
77
- assert str(C()) == '<< [[1 1]\n [1 1]] >>'
78
- assert str(np_C) == '<< [[1 1]\n [1 1]] >>'
79
- assert str(D()) == '<< [[0 1]\n [1 0]] >>'
80
- assert str(np_D) == '<< [[0 1]\n [1 0]] >>'
81
- assert str(E()) == '<< [[11 -7]\n [-2 4]] >>'
82
- assert str(np_E) == '<< [[11 -7]\n [-2 4]] >>'
83
-
84
- def test_repr(self) -> None:
85
- assert repr(Eye()) == "HWrapNDArrayNumber(np.array([[1,0],[0,1]],dtype=np.int32))"
86
- assert repr(np_eye) == "HWrapNDArrayNumber(np.array([[1,0],[0,1]],dtype=np.int32))"
87
- assert repr(Zero()) == "HWrapNDArrayNumber(np.array([[0,0],[0,0]],dtype=np.int32))"
88
- assert repr(np_zero) == "HWrapNDArrayNumber(np.array([[0,0],[0,0]],dtype=np.int32))"
89
- assert repr(A()) == "HWrapNDArrayNumber(np.array([[5,-1],[0,2]],dtype=np.int32))"
90
- assert repr(np_A) == "HWrapNDArrayNumber(np.array([[5,-1],[0,2]],dtype=np.int32))"
91
- assert repr(B()) == "HWrapNDArrayNumber(np.array([[2,-1],[-1,2]],dtype=np.int32))"
92
- assert repr(np_B) == "HWrapNDArrayNumber(np.array([[2,-1],[-1,2]],dtype=np.int32))"
93
-
94
- assert B() == np_B
95
- assert B() is np_B
96
-
97
- np_mult = HWrapNDArrayNumber(np_A() @ np_B())
98
- assert repr(np_mult) == "HWrapNDArrayNumber(np.array([[11,-7],[-2,4]],dtype=np.int32))"
99
- np_mult_copy = eval(repr(np_mult))
100
- assert np_mult == np_mult_copy
101
- assert np_mult is not np_mult_copy
102
-
103
- def test_create(self) -> None:
104
- np_see = HWrapNDArrayNumber(np.array([[1, 1], [1, 1]], dtype=np.int32))
105
- See = m2x2(np_see)
106
- assert See == C
107
- assert See is C
108
- assert repr(np_see) == "HWrapNDArrayNumber(np.array([[1,1],[1,1]],dtype=np.int32))"
109
-
110
- moo1 = HWrapNDArrayNumber(
111
- np.array(
112
- [[2, -3, 6],
113
- [1, -1, 2],
114
- [17, 18, -11],
115
- [2, 1, 11]],
116
- dtype=np.int32,
117
- )
118
- )
119
- moo2 = HWrapNDArrayNumber(
120
- np.array(
121
- [[2, -3, 6],
122
- [1, -1, 2],
123
- [17, 18, -11],
124
- [2, 1, 11]],
125
- dtype='int32',
126
- )
127
- )
128
- moo3 = HWrapNDArrayNumber(
129
- np.array(
130
- [[2, -3, 6],
131
- [1, -1, 2],
132
- [17, 18, -11],
133
- [2, 1, 11]],
134
- np.dtype('int32'),
135
- )
136
- )
137
- moo1 == moo2 == moo3
138
- moo1 is not moo2
139
- moo1 is not moo3
140
- moo2 is not moo3