Skip to content

Wrap NUTS for non-linear fitting features#635

Merged
hombit merged 9 commits intomainfrom
copilot/add-nuts-support-nonlinear-fitting
Mar 3, 2026
Merged

Wrap NUTS for non-linear fitting features#635
hombit merged 9 commits intomainfrom
copilot/add-nuts-support-nonlinear-fitting

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

  • Add NUTS algorithm support for non-linear fitting features (BazinFit, LinexpFit, VillarFit)
  • Three new algorithms: "nuts", "nuts-ceres", "nuts-lmsder"
  • NUTS enabled unconditionally (no cargo feature flag)
  • Parameters: nuts_ntune and nuts_niter
  • Tests: precision, algorithm membership, custom params, benchmark classes
  • CHANGELOG updated
  • All lints pass (cargo fmt, clippy, ruff)
  • Fix CI: Bump MSRV from 1.85 to 1.88 (required by nuts-derive which uses let chains stabilized in 1.88)
  • Fix clippy collapsible_if lint triggered by MSRV bump enabling let chains
  • Merge main (f4ec272) into branch — proper git merge commit with two parents
Original prompt

This section details on the original issue you should resolve

<issue_title>Wrap NUTS for non-linear fitting features</issue_title>
<issue_description></issue_description>

<agent_instructions>light-curve-feature now supports NUTS for non-linear fit features. We should add its support here, in the same way we support mcmc, e.g. add three new "algorithms" for non-linear features. Please do not forget to add tests, run them, update changelog, and run formatter and linter after you've done.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 24, 2026 13:59
Co-authored-by: hombit <1784493+hombit@users.noreply.github.com>
Co-authored-by: hombit <1784493+hombit@users.noreply.github.com>
Copilot AI changed the title [WIP] Add NUTS support for non-linear fitting features Wrap NUTS for non-linear fitting features Feb 24, 2026
Copilot AI requested a review from hombit February 24, 2026 14:43
Copy link
Member

@hombit hombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Good job.

  1. Let's enable nuts unconditionally, no need in a Cargo feature
  2. I think we should homogenize argument names. Let's keep nuts_ntune, but use nuts_niter instead of nuts_ndraws.

Co-authored-by: hombit <1784493+hombit@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 24, 2026

@copilot Good job.

  1. Let's enable nuts unconditionally, no need in a Cargo feature
  2. I think we should homogenize argument names. Let's keep nuts_ntune, but use nuts_niter instead of `nuts_ndr...

Done in fe1c7c1:

  1. nuts is now enabled unconditionally — removed the cargo feature flag, added nuts directly to light-curve-feature dependency features, removed all #[cfg(feature = "nuts")] guards, and removed _built_with_nuts from lib.rs.
  2. Renamed nuts_ndrawsnuts_niter everywhere (Rust signature, Python tests, changelog).

Copilot AI requested a review from hombit February 24, 2026 17:21
@hombit hombit marked this pull request as ready for review February 24, 2026 17:27
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.78%. Comparing base (f4ec272) to head (388bd6c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
light-curve/src/features.rs 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
+ Coverage   82.70%   82.78%   +0.07%     
==========================================
  Files          10       10              
  Lines        2608     2620      +12     
==========================================
+ Hits         2157     2169      +12     
  Misses        451      451              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 24, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 106 untouched benchmarks


Comparing copilot/add-nuts-support-nonlinear-fitting (045f9dc) with main (098edef)

Open in CodSpeed

@hombit
Copy link
Member

hombit commented Feb 24, 2026

@copilot, please fix CI failures

Co-authored-by: hombit <1784493+hombit@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 24, 2026

@copilot, please fix CI failures

Fixed in 045f9dc. The msrv-build job failed because nuts-derive 0.1.0 uses let chains (if let ... && ...) which were stabilized in Rust 1.88, but the MSRV was 1.85. Bumped MSRV from 1.85 to 1.88 and relaxed the comfy-table version constraint (which was pinned to <7.2 due to the old MSRV).

The publish workflow failure (Build cp310-macosx_x86_64) was a transient homebrew download issue (failed to fetch metis and gsl packages), unrelated to this PR.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/light-curve/light-curve-python/actions/jobs/64721940074/logs
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from hombit February 24, 2026 23:03
@hombit
Copy link
Member

hombit commented Feb 25, 2026

@copilot cargo clippy lint fails

Co-authored-by: hombit <1784493+hombit@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 25, 2026

@copilot cargo clippy lint fails

Fixed in 85e0650. The collapsible_if lint was triggered because the MSRV bump to 1.88 enabled let chains, so clippy now suggests collapsing if let Some(sigma) = sigma { if t.len() != sigma.len() { ... } } into a single if let with &&.

@hombit
Copy link
Member

hombit commented Mar 3, 2026

@copilot solve merge conflicts with main

… 0.17, arrow-* to 58

Co-authored-by: hombit <1784493+hombit@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot solve merge conflicts with main

Resolved in bfd52fd. The conflict was in light-curve/Cargo.toml — main bumped pyo3 to 0.28.2, pyo3-arrow to 0.17, and arrow-* to 58. I applied those version bumps while keeping our comfy-table = "7" (no upper bound needed since MSRV is 1.88). Also brought in the non-conflicting changes from main (upload-artifact v7, download-artifact v8, ruff v0.15.4).

Note: this applies the changes from main on top of our branch rather than a true git merge/rebase, so GitHub may still show conflicts in the PR. If so, you may need to merge main from the GitHub UI or locally.

@hombit
Copy link
Member

hombit commented Mar 3, 2026

@copilot no, you merge/rebase on main

Copilot AI and others added 2 commits March 3, 2026 17:13
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot no, you merge/rebase on main

Done in e7354cc — a proper merge commit with two parents (bfd52fd from our branch and f4ec272 from main). The only conflict was comfy-table in Cargo.toml (kept our "7" without the <7.2 upper bound, since MSRV is 1.88) and a Cargo.lock ordering conflict (kept our version including pulp v0.21.5 required by nuts-rs).

@hombit hombit merged commit 2a53a10 into main Mar 3, 2026
51 of 53 checks passed
@hombit hombit deleted the copilot/add-nuts-support-nonlinear-fitting branch March 3, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrap NUTS for non-linear fitting features

2 participants