Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d5eefb9
update to latest version
HugoMVale Jun 18, 2025
5700f0b
change to head while working
HugoMVale Jun 18, 2025
f942588
update function names + signatures to match new release of odrpack95
HugoMVale Jun 19, 2025
7c9fd66
update message
HugoMVale Jun 19, 2025
4dc3c62
bump version
HugoMVale Jun 19, 2025
1695c7d
deactivate pypi publish
HugoMVale Jun 19, 2025
d290d48
rename nq to q, and move arg position
HugoMVale Jun 21, 2025
0b3fbc3
update q name/position; add test implicit
HugoMVale Jun 21, 2025
81a4b9b
add example from odrpack95
HugoMVale Jun 21, 2025
205819e
rename nq to q; fix delta non-contiguous
HugoMVale Jun 21, 2025
ba0b3ec
change y value
HugoMVale Jun 21, 2025
4e33c6d
regenerate stubs
HugoMVale Jun 21, 2025
1351ca9
add separate test for nb functions
HugoMVale Jun 21, 2025
f17c1e3
rename files
HugoMVale Jun 21, 2025
a4b605c
rename rwork and lrwork
HugoMVale Jun 21, 2025
601b345
rename lrwkmn, rworkidx_t
HugoMVale Jun 22, 2025
cfe003c
move interpret_info
HugoMVale Jun 22, 2025
5a701b8
add file clean up after test
HugoMVale Jun 22, 2025
0c94be7
change to odr_fit
HugoMVale Jun 22, 2025
327a4b8
integrate message logic in dataclass
HugoMVale Jun 22, 2025
6ccb3c0
rename file
HugoMVale Jun 22, 2025
8626903
add scipy style interface
HugoMVale Jun 22, 2025
6d40511
add scipy style interface
HugoMVale Jun 22, 2025
412a725
rename files
HugoMVale Jun 22, 2025
d9de9b2
rename files
HugoMVale Jun 23, 2025
f13d28e
allow one-sided bounds
HugoMVale Jun 23, 2025
639bf71
add tests for odr_fit
HugoMVale Jun 23, 2025
d494116
add deprecation warning
HugoMVale Jun 23, 2025
deba132
change to odr_fit
HugoMVale Jun 23, 2025
171b248
replace odr by odr_fit
HugoMVale Jun 23, 2025
e916165
rename file
HugoMVale Jun 23, 2025
dbcdb86
change bounds on example
HugoMVale Jun 23, 2025
577143b
update docstring
HugoMVale Jun 23, 2025
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
32 changes: 16 additions & 16 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ jobs:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
# upload_pypi:
# name: Publish to PyPI
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# environment:
# name: pypi
# permissions:
# id-token: write
# # if: github.event_name == 'release' && github.event.action == 'published'
# steps:
# - uses: actions/download-artifact@v4
# with:
# pattern: cibw-*
# path: dist
# merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
# - uses: pypa/gh-action-pypi-publish@release/v1

# upload_test_pypi:
# name: Publish to TestPyPI
Expand Down
22 changes: 12 additions & 10 deletions docs/examples/explicit-model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from odrpack import odr"
"from odrpack import odr_fit"
]
},
{
Expand All @@ -45,19 +45,19 @@
"metadata": {},
"outputs": [],
"source": [
"x = np.array([0.100, 0.300, 0.400, 0.500, 0.600, 0.700, 0.800])\n",
"y = np.array([0.059, 0.243, 0.364, 0.486, 0.583, 0.721, 0.824])"
"xdata = np.array([0.100, 0.300, 0.400, 0.500, 0.600, 0.700, 0.800])\n",
"ydata = np.array([0.059, 0.243, 0.364, 0.486, 0.583, 0.721, 0.824])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def f(beta: np.ndarray, x: np.ndarray) -> np.ndarray:\n",
" b1, b2 = beta\n",
" return (b1*x**2 + x*(1-x))/(b1*x**2 + 2*x*(1-x) + b2*(1-x)**2)"
" return (b1*x**2 + x*(1 - x))/(b1*x**2 + 2*x*(1 - x) + b2*(1 - x)**2)"
]
},
{
Expand Down Expand Up @@ -95,15 +95,15 @@
"sigma_x = 0.01\n",
"sigma_y = 0.05\n",
"\n",
"wd = 1/sigma_x**2\n",
"we = 1/sigma_y**2"
"weight_x = 1/sigma_x**2\n",
"weight_y = 1/sigma_y**2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can now launch the regression! If you want to see a brief computation report, set `iprint=1001`."
"We can now launch the regression! If you want to see a brief computation report, set `report='short'`."
]
},
{
Expand All @@ -112,7 +112,9 @@
"metadata": {},
"outputs": [],
"source": [
"sol = odr(f, beta0, y, x, lower=lower, upper=upper, we=we, wd=wd)"
"sol = odr_fit(f, xdata, ydata, beta0,\n",
" bounds=(lower, upper),\n",
" weight_x=weight_x, weight_y=weight_y)"
]
},
{
Expand Down Expand Up @@ -199,7 +201,7 @@
"_, ax = plt.subplots()\n",
"\n",
"# Plot experimental data\n",
"ax.plot(x, y, 'o')\n",
"ax.plot(xdata, ydata, 'o')\n",
"\n",
"# Plot fitted model\n",
"xm = np.linspace(0.0, 1.0, 100)\n",
Expand Down
25 changes: 14 additions & 11 deletions docs/examples/implicit-model.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:::odrpack
options:
members:
- odr
- odr_fit
- OdrResult
- OdrStop
7 changes: 4 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'odrpack',
['cpp'],
version : '0.2.0',
version : '0.3.0',
meson_version: '>=1.5.0',
default_options: [
'buildtype=release',
Expand Down Expand Up @@ -36,11 +36,12 @@ nanobind_ext = python.extension_module(
python.install_sources(
[
'src/odrpack/__init__.py',
'src/odrpack/driver.py',
'src/odrpack/__odrpack.pyi',
'src/odrpack/odr_fortran.py',
'src/odrpack/odr_scipy.py',
'src/odrpack/exceptions.py',
'src/odrpack/result.py',
'src/odrpack/py.typed',
'src/odrpack/__odrpack.pyi',
],
subdir: 'odrpack'
)
Expand Down
5 changes: 3 additions & 2 deletions src/odrpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
to the observations of the dependent variable.
"""

__version__ = '0.2.0'
__version__ = '0.3.0'

from odrpack.driver import *
from odrpack.exceptions import *
from odrpack.odr_fortran import *
from odrpack.odr_scipy import *
from odrpack.result import *
Loading