scikit-misc 0.5.2__tar.gz → 0.5.3__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 (99) hide show
  1. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/PKG-INFO +1 -1
  2. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/pyproject.toml +9 -1
  3. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/_version.py +1 -1
  4. scikit_misc-0.5.3/tools/wheels/f2c_runtime.c +50 -0
  5. scikit_misc-0.5.3/tools/wheels/pyodide_f2c_patch.py +188 -0
  6. scikit_misc-0.5.3/uv.lock +1763 -0
  7. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/.gitattributes +0 -0
  8. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/.gitignore +0 -0
  9. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/.pre-commit-config.yaml +0 -0
  10. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/.spin/cmds.py +0 -0
  11. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/LICENSE +0 -0
  12. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/Makefile +0 -0
  13. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/README.rst +0 -0
  14. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/Makefile +0 -0
  15. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/_static/copybutton.js +0 -0
  16. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/_static/custom.css +0 -0
  17. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/_templates/cython_class.rst +0 -0
  18. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/_templates/layout.html +0 -0
  19. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/api.rst +0 -0
  20. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/changelog.rst +0 -0
  21. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/conf.py +0 -0
  22. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/index.rst +0 -0
  23. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/installation.rst +0 -0
  24. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/loess.rst +0 -0
  25. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/sphinxext/__init__.py +0 -0
  26. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/sphinxext/inline_code_highlight.py +0 -0
  27. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/globaltoc.html +0 -0
  28. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/layout.html +0 -0
  29. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/localtoc.html +0 -0
  30. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/navbar-2.html +0 -0
  31. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/navbar.html +0 -0
  32. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/navbarsearchbox.html +0 -0
  33. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/navbartoc.html +0 -0
  34. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/relations.html +0 -0
  35. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/search.html +0 -0
  36. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/searchbox.html +0 -0
  37. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/searchresults.html +0 -0
  38. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/sourcelink.html +0 -0
  39. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/static/bootstrap-3.4.1/css/bootstrap.min.css +0 -0
  40. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/static/bootstrap-3.4.1/js/bootstrap.min.js +0 -0
  41. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/static/bootstrap-sphinx.css_t +0 -0
  42. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/static/bootstrap-sphinx.js_t +0 -0
  43. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/static/js/jquery-1.12.4.min.js +0 -0
  44. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/static/js/jquery-fix.js +0 -0
  45. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/doc/theme/theme.conf +0 -0
  46. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/examples/loess-basic-usage.ipynb +0 -0
  47. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/examples/requirements-examples.txt +0 -0
  48. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/meson.build +0 -0
  49. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/meson_options.txt +0 -0
  50. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/requirements/build.txt +0 -0
  51. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/requirements/ci_requirements.txt +0 -0
  52. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/requirements/dev.txt +0 -0
  53. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/requirements/docs.txt +0 -0
  54. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/requirements/openblas.txt +0 -0
  55. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/requirements/release.txt +0 -0
  56. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/__config__.py.in +0 -0
  57. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/__init__.py +0 -0
  58. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/_build_utils/copy_version_to_dist.py +0 -0
  59. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/_build_utils/gcc_build_bitness.py +0 -0
  60. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/_build_utils/version_please.py +0 -0
  61. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/_distributor_init.py +0 -0
  62. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/_version.py.in +0 -0
  63. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/LICENSE.txt +0 -0
  64. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/__init__.py +0 -0
  65. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/meson.build +0 -0
  66. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/S.h +0 -0
  67. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/_loess.pyx +0 -0
  68. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/blas_lite.f +0 -0
  69. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/c_loess.pxd +0 -0
  70. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/linpack_lite.f +0 -0
  71. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/loess.c +0 -0
  72. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/loess.h +0 -0
  73. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/loessc.c +0 -0
  74. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/loessf.f +0 -0
  75. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/misc.c +0 -0
  76. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/src/predict.c +0 -0
  77. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/__init__.py +0 -0
  78. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/co2_data +0 -0
  79. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/co2_results_double +0 -0
  80. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/co2_results_real +0 -0
  81. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/gas_data +0 -0
  82. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/gas_result +0 -0
  83. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/madeup_data +0 -0
  84. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/madeup_result +0 -0
  85. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/meson.build +0 -0
  86. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/loess/tests/test_loess.py +0 -0
  87. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/skmisc/meson.build +0 -0
  88. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/spin +0 -0
  89. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/build_theme.sh +0 -0
  90. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/deploy_documentation.sh +0 -0
  91. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/LICENSE_linux.txt +0 -0
  92. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/LICENSE_osx.txt +0 -0
  93. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/LICENSE_win32.txt +0 -0
  94. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/check_license.py +0 -0
  95. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/cibw_before_build.sh +0 -0
  96. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/cibw_test_command.sh +0 -0
  97. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/howto.txt +0 -0
  98. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/repair_windows.sh +0 -0
  99. {scikit_misc-0.5.2 → scikit_misc-0.5.3}/tools/wheels/test.f +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scikit-misc
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: Miscellaneous tools for scientific computing.
5
5
  Author-Email: Hassan Kibirige <has2k1@gmail.com>
6
6
  License: Copyright (c) 2016, Hassan Kibirige
@@ -153,7 +153,6 @@ Environments = [
153
153
  # Note: the below skip command doesn't do much currently, the platforms to
154
154
  # build wheels for in CI are controlled in `.github/workflows/wheels.yml` and
155
155
  # `tools/ci/cirrus_wheels.yml`.
156
- build-frontend = "build"
157
156
  before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
158
157
  test-command = "bash {project}/tools/wheels/cibw_test_command.sh {project}"
159
158
  test-requires = [
@@ -170,6 +169,15 @@ manylinux-aarch64-image = "manylinux_2_28"
170
169
  RUNNER_OS="Linux"
171
170
 
172
171
 
172
+ [tool.cibuildwheel.pyodide]
173
+ before-build = [
174
+ "bash {project}/tools/wheels/cibw_before_build.sh {project}",
175
+ "python {project}/tools/wheels/pyodide_f2c_patch.py {project}",
176
+ ]
177
+
178
+ [tool.cibuildwheel.pyodide.environment]
179
+ RUNNER_OS="Linux"
180
+
173
181
  [tool.cibuildwheel.macos]
174
182
  # universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
175
183
  # note that universal2 wheels are not built, they're listed in the tool.cibuildwheel.skip
@@ -1,4 +1,4 @@
1
1
  # This file is dynamically generated by the build system to support
2
2
  # versioning with source control. Do not edit by hand
3
3
 
4
- __version__ = "0.5.2"
4
+ __version__ = "0.5.3"
@@ -0,0 +1,50 @@
1
+ /*
2
+ * The few libf2c routines that the C translation of the Fortran sources
3
+ * calls. They are only needed when building for Emscripten (Pyodide), where
4
+ * the Fortran is translated with f2c and there is no libf2c to link against.
5
+ * Each follows the behaviour of the netlib libf2c routine of the same name.
6
+ */
7
+ #include <math.h>
8
+
9
+ double
10
+ pow_dd(double *ap, double *bp)
11
+ {
12
+ return pow(*ap, *bp);
13
+ }
14
+
15
+ int
16
+ pow_ii(int *ap, int *bp)
17
+ {
18
+ int x = *ap, n = *bp, result = 1;
19
+ unsigned int u;
20
+
21
+ if (n <= 0) {
22
+ if (n == 0 || x == 1)
23
+ return 1;
24
+ if (x != -1)
25
+ return x == 0 ? 1 / x : 0;
26
+ n = -n;
27
+ }
28
+ for (u = n; ; ) {
29
+ if (u & 01)
30
+ result *= x;
31
+ if (u >>= 1)
32
+ x *= x;
33
+ else
34
+ break;
35
+ }
36
+ return result;
37
+ }
38
+
39
+ double
40
+ d_sign(double *a, double *b)
41
+ {
42
+ double x = (*a >= 0 ? *a : -*a);
43
+ return (*b >= 0 ? x : -x);
44
+ }
45
+
46
+ int
47
+ i_len(char *s, int n)
48
+ {
49
+ return n;
50
+ }
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ Adapt the loess C sources to the f2c translation of the Fortran sources
4
+
5
+ Pyodide translates Fortran to C with f2c. Compared with gfortran, f2c
6
+ makes every subroutine return `int` and passes a hidden length argument
7
+ after the arguments of a routine that has a `CHARACTER` argument.
8
+ WebAssembly checks function signatures at link time, so the C
9
+ declarations and definitions of the Fortran routines must agree with
10
+ that translation.
11
+
12
+ The script edits the sources in place and is safe to run repeatedly. It
13
+ raises if a source no longer has the text it rewrites.
14
+
15
+ Usage: pyodide_f2c_patch.py [PROJECT_DIR]
16
+ """
17
+ from __future__ import annotations
18
+
19
+ import re
20
+ import sys
21
+ from pathlib import Path
22
+
23
+ LOESS_SRC = Path("skmisc/loess/src")
24
+
25
+ # The libf2c routines that the translated Fortran calls, next to this script
26
+ RUNTIME_SOURCE = "f2c_runtime.c"
27
+
28
+ # C routines that the Fortran calls back into
29
+ CALLBACKS = ("ehg182", "ehg183a", "ehg184a")
30
+
31
+ # Callbacks that take a `CHARACTER` argument, with the last argument
32
+ # before the hidden length that f2c adds
33
+ CHARACTER_CALLBACKS = {"ehg183a": "inc", "ehg184a": "inc"}
34
+
35
+
36
+ def rewrite(text: str, pattern: str, repl: str, expected: int) -> str:
37
+ """
38
+ Replace every match of a pattern, requiring an exact number of matches
39
+
40
+ Parameters
41
+ ----------
42
+ text
43
+ Source text to rewrite.
44
+ pattern
45
+ Regular expression, matched per line.
46
+ repl
47
+ Replacement text.
48
+ expected
49
+ Number of matches the source must contain.
50
+
51
+ Returns
52
+ -------
53
+ str
54
+ The rewritten text.
55
+
56
+ Raises
57
+ ------
58
+ RuntimeError
59
+ If the number of matches differs from `expected`.
60
+ """
61
+ result, n = re.subn(pattern, repl, text, flags=re.MULTILINE)
62
+ if n != expected:
63
+ raise RuntimeError(
64
+ f"Expected {expected} matches of {pattern!r}, found {n}"
65
+ )
66
+ return result
67
+
68
+
69
+ def return_int_from_declarations(text: str, expected: int) -> str:
70
+ """
71
+ Declare the Fortran routines as returning `int`
72
+
73
+ Parameters
74
+ ----------
75
+ text
76
+ Source text of a C file.
77
+ expected
78
+ Number of declarations and definitions starting with `void`.
79
+
80
+ Returns
81
+ -------
82
+ str
83
+ The rewritten text.
84
+ """
85
+ return rewrite(text, r"^void( F77_SUB)", r"int\1", expected)
86
+
87
+
88
+ def patch_loess_c(text: str) -> str:
89
+ """
90
+ Rewrite `loess.c`
91
+
92
+ Parameters
93
+ ----------
94
+ text
95
+ Source text of `loess.c`.
96
+
97
+ Returns
98
+ -------
99
+ str
100
+ The rewritten text.
101
+ """
102
+ return return_int_from_declarations(text, expected=2)
103
+
104
+
105
+ def patch_loessc_c(text: str) -> str:
106
+ """
107
+ Rewrite `loessc.c`
108
+
109
+ Parameters
110
+ ----------
111
+ text
112
+ Source text of `loessc.c`.
113
+
114
+ Returns
115
+ -------
116
+ str
117
+ The rewritten text.
118
+ """
119
+ # Prototypes of 12 routines, and the definitions of 2 callbacks
120
+ text = return_int_from_declarations(text, expected=14)
121
+ # The definition of ehg182 has its return type on a line of its own
122
+ text = rewrite(text, r"^void(\nF77_SUB\(ehg182\))", r"int\1", 1)
123
+
124
+ # Callbacks are called from Fortran and the value is never used, but
125
+ # a function that returns `int` must still return.
126
+ for name in CALLBACKS:
127
+ text = rewrite(
128
+ text,
129
+ rf"(F77_SUB\({name}\)\([^;{{]*\)\n\{{(?:.|\n)*?)\n\}}\n",
130
+ r"\1\n return 0;\n}\n",
131
+ 1,
132
+ )
133
+
134
+ for name, last in CHARACTER_CALLBACKS.items():
135
+ text = rewrite(
136
+ text,
137
+ rf"(F77_SUB\({name}\)\([^)]*\*{last})\)",
138
+ r"\1, int s_len)",
139
+ 2,
140
+ )
141
+ return text
142
+
143
+
144
+ def is_patched(text: str) -> bool:
145
+ """
146
+ Report whether `loessc.c` has already been rewritten
147
+
148
+ Parameters
149
+ ----------
150
+ text
151
+ Source text of `loessc.c`.
152
+
153
+ Returns
154
+ -------
155
+ bool
156
+ `True` if no Fortran routine is declared as returning `void`.
157
+ """
158
+ return re.search(r"^void F77_SUB", text, flags=re.MULTILINE) is None
159
+
160
+
161
+ def main(project_dir: Path) -> None:
162
+ """
163
+ Patch the loess sources under a project directory
164
+
165
+ Parameters
166
+ ----------
167
+ project_dir
168
+ Root of the scikit-misc source tree.
169
+ """
170
+ loessc = project_dir / LOESS_SRC / "loessc.c"
171
+ loess = project_dir / LOESS_SRC / "loess.c"
172
+ runtime = Path(__file__).with_name(RUNTIME_SOURCE)
173
+
174
+ if is_patched(loessc.read_text()):
175
+ print("loess sources already patched for f2c")
176
+ return
177
+
178
+ # Pyodide has no libf2c, so compile the routines the translation calls
179
+ # into the extension module that contains the Fortran callers.
180
+ loessc.write_text(
181
+ patch_loessc_c(loessc.read_text()) + "\n" + runtime.read_text()
182
+ )
183
+ loess.write_text(patch_loess_c(loess.read_text()))
184
+ print("patched loess sources for f2c")
185
+
186
+
187
+ if __name__ == "__main__":
188
+ main(Path(sys.argv[1] if len(sys.argv) > 1 else "."))