Skip to content

Migration to juliacall#1721

Draft
PaulJonasJost wants to merge 15 commits into
mainfrom
juliacall
Draft

Migration to juliacall#1721
PaulJonasJost wants to merge 15 commits into
mainfrom
juliacall

Conversation

@PaulJonasJost

Copy link
Copy Markdown
Collaborator

As tests for 3.14 are failing, trying to migrate once to juliacall and see whether it fixes it.

PaulJonasJost and others added 13 commits April 1, 2026 10:33
* try to clarify `hessian_update`

* typo

* review; clarify docstring
Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 2 to 3.
- [Release notes](https://github.com/julia-actions/setup-julia/releases)
- [Commits](julia-actions/setup-julia@v2...v3)

---
updated-dependencies:
- dependency-name: julia-actions/setup-julia
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v5...v6)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add low level 2d profile plot function and 2d profile function

* Polish 2D profile visualization

- Fix colorbar layout using constrained_layout (no more overlap)
- Always extend axes to parameter bounds; remove show_bounds parameter
- Auto-generate scale-aware axis labels from problem.x_scales
- Accept optional x_labels override to match 1D profiles API
- Pairplot-style label cleanup: parameter names on edges only, ratio
  label kept on off-edge diagonal subplots
- Reset MaxNLocator on diagonal subplots to avoid dense tick marks
- Add smoke tests for visualize_2d_profile and profile_lowlevel_2d
- Add 2D profile cell to getting_started.ipynb

* Add shared colorbar range and color customization to 2D profile plots

- Compute global vmin/vmax across all off-diagonal panels so the
  colorbar accurately represents all subplots
- Add profile_color parameter for diagonal 1D profile line color
- Add vmin/vmax parameters to profile_lowlevel_2d for external control

* Paul&Daniel review, polish plot

Addresses reviewer feedback on #1652 and polishes the 2D profile
grid so every subplot is legible on its own.

- Self-describing subplots: every panel now carries its own axis
  label and tick labels instead of relying on grid position. Diagonal
  panels show "Log-posterior ratio" / "Objective value"; off-diagonals
  show both parameter labels.
- Off-diagonal scatter points are sorted by color so dense clusters
  reveal actual ratio structure rather than reading as uniformly dark.
  Marker edges removed for the same reason.
- New `_add_bound_lines_1d` / `_add_bound_lines_2d` helpers draw dashed
  lower/upper bound lines on every panel as a cross-plot anchor.
- New `_add_panel_legend` helper adds compact legends on the top-left
  diagonal and the first 2D off-diagonal, explaining the glyphs.
- New `label_fontsize` parameter; labels are rendered bold with a
  larger default, tick labels follow two points smaller, colorbar
  label matches. Tightened gridspec so y-labels hug their own axis
  rather than drifting between columns.
- Tests cover the new styling (fontsize, spines hidden, legend
  presence on the expected panels, dashed bound line count).

* small update of margins

* small fix of layout

---------

Co-authored-by: Doresic <domagoj.doresic@gmail.com>
Co-authored-by: Doresic <85789271+Doresic@users.noreply.github.com>
* Fix remaining AMICI 1.0 calls and extend tests

This updates the remaining AMICI calls in the model-fit visualization code (get_timepoints, set_sensitivity_order, set_timepoints, get_state_names) and aligns related docstrings and error messages with the same naming.

This also expands visualization test coverage by:

directly covering _get_simulation_rdatas(..., simulation_timepoints=None) to exercise default AMICI timepoint handling
extending time_trajectory_model(...) coverage to include hierarchical problems and named-state selection

* Daniel review changes

* fix setting x_guesses in test
* introduce _style.py and rename par_indices

- Add pypesto/visualize/_style.py with shared helpers get_ax and process_deprecated_kwarg. The latter is the canonical pattern for the visualization signature harmonization that follows.
- Drop the module-level cmap global in sampling.py; inline at the single use site.
- Rename par_indices → parameter_indices in sampling_parameter_traces, sampling_1d_marginals, and the internal get_data_to_plot. Public functions accept par_indices as a deprecated alias (DeprecationWarning).

* harmonize type hints across public visualize functions

- ax: canonicalize to `matplotlib.axes.Axes | None = None` everywhere
  (was `plt.Axes | None`, `matplotlib.axes.Axes` without `| None`, or
  untyped `ax=None` in profiles.py)
- size: fix `tuple[float]` → `tuple[float, float]` in
  optimizer_convergence.py and waterfall_lowlevel; bare `tuple` →
  `tuple[float, float]` in optimizer_history_lowlevel
- title/suptitle: `str = None` → `str | None = None` in sampling functions
- Add `import matplotlib.axes` to waterfall.py, optimizer_convergence.py,
  optimizer_history.py, profiles.py

* harmonize single-panel ax handling

- switch remaining single-panel plotters and lowlevel helpers to the
  shared `get_ax` helper
- remove ad hoc pyplot-based axes creation in favor of the shared path
- ensure plots still fully configure passed-in axes, including labels
  and other axis-level metadata
- make `projection_scatter_umap_original` explicitly accept and return
  an axes object
- preserve backward compatibility for
  `optimization_run_properties_one_plot` by keeping positional argument
  order intact
- keep tests broad and figure-focused, with targeted checks only where
  behavior actually changed

* harmonize multi-panel axes grid-return contract

- `get_axes_array(axes, nrows, ncols, size)` — create or normalize a 2-D
  axes grid; raises on shape mismatch
- `plot_diagonal_marginal(ax, values, diag_kind)` — KDE/hist marginal
  extracted from `optimization_scatter` so `sampling_scatter` can share it

Functions updated: `optimization_scatter`, `sampling_scatter`,
`sampling_1d_marginals`, `sampling_prediction_trajectories`,
`visualize_estimated_observable_mapping`,
`plot_linear_observable_mappings_from_pypesto_result`,
`plot_splines_from_pypesto_result`, `plot_splines_from_inner_result`,
`ensemble_scatter_lowlevel`, `projection_scatter_umap_original`,
`optimization_run_properties_one_plot`.

Also removes all `sns.set(style="ticks")` calls from `sampling.py` —
these were the root cause of global matplotlib style mutations that made
plots look inconsistent depending on call order.

* rename alpha to confidence_levels

`sampling_parameter_cis` accepted `alpha: Sequence[int]` (e.g. `[95]`)
as a credibility level in integer percentages. This was mis-named (not
matplotlib transparency) and used inconsistent units compared to every
other CI parameter in the codebase (all others use 0–1 fractions).

* add confidence_level convenience par to profiles

`profiles` accepted only `ratio_min` (a likelihood-ratio threshold) to
filter profile points. Users wanting to cut off at a standard confidence
level had to call `chi2_quantile_to_ratio` manually first.

New additive kwarg `confidence_level: float | None = None` — pass e.g.
`confidence_level=0.95` and it is converted to the equivalent `ratio_min`
via `chi2_quantile_to_ratio`. The two parameters are mutually exclusive;
passing both raises `ValueError`. `ratio_min` is unchanged and keeps its
existing meaning and default.

* add return types, remove deprecation test

* Small update of type

* small fix for docs test

* Daniel&Paul&Vincent review adjustments

- move shared visualize helpers from _style.py into misc.py
- add hide_unused_axes and reuse it across plotting functions that trim
  unused subplot panels
- switch internal figure creation to constrained layout and stop forcing
  tight_layout afterwards
- keep deprecated-kwarg handling with _UNSET-based detection of omitted
  vs explicit None
- update observable mapping axes preparation to use the shared helpers
- move helper tests from test_style.py to test_misc.py
- move close_fig to test/conftest.py and ensure figure cleanup also
  happens on test failure

* small additional change

* Document deprecated sampling plot arguments
* Fix PyMC posterior extraction for newer ArviZ

* Fix PyMC outputs with newer ArviZ

* add comment to change when bumped

* Bump arviz>=0.21 and drop old code

* Fix: drop incorrect .dataset access

* require arviz 1.1.0 -- that's the correct one

* Support PyMC posterior extraction across ArviZ versions

- Use Python-version-specific ArviZ requirements so Python 3.11 installs ArviZ 0.x while Python 3.12+ uses ArviZ 1.1+
- Keep PyMC posterior extraction on the common posterior interface shared by old and new ArviZ result objects

* some final cleanups

* add TODOs
* Improve profiling step-size defaults and step-size robustness

* Fix extrapolation trust-region not using resolved

* Fix small bug

We were changing the step size of profiling parameter to 0 by accident.

* Improve profile step-size resolution

- explicit absolute/relative profile step-size options
- deprecated old absolute step-size option names
- per-parameter step-size family resolution from `ub - lb`
- finite-bound validation before profiling
- single upfront step-size resolution before profile walking
- resolved step sizes passed through profiling tasks/proposals
- lightweight many-steps precheck warning/error mode
- focused profile tests for options, resolution, precheck

* Change relative defaults
* Changed Codeowners: Vincent added to sampling, Domagoj replacing Stephan in visualization

* Changed Maintainer from Vincent to Moritz
@PaulJonasJost PaulJonasJost self-assigned this Jun 5, 2026
@codecov-commenter

codecov-commenter commented Jun 5, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 81.58640% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.58%. Comparing base (86a0076) to head (6e6f000).

Files with missing lines Patch % Lines
pypesto/visualize/observable_mapping.py 60.00% 22 Missing ⚠️
pypesto/objective/julia/petabJl.py 0.00% 21 Missing ⚠️
pypesto/visualize/profiles.py 87.17% 20 Missing ⚠️
pypesto/visualize/parameters.py 84.21% 12 Missing ⚠️
pypesto/objective/julia/base.py 0.00% 10 Missing ⚠️
pypesto/visualize/misc.py 87.17% 10 Missing ⚠️
pypesto/visualize/sampling.py 90.00% 8 Missing ⚠️
pypesto/profile/options.py 86.66% 6 Missing ⚠️
pypesto/variational/pymc.py 0.00% 6 Missing ⚠️
pypesto/objective/julia/petab_jl_importer.py 0.00% 5 Missing ⚠️
... and 4 more
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1721      +/-   ##
==========================================
+ Coverage   83.17%   83.58%   +0.40%     
==========================================
  Files         164      164              
  Lines       14345    14766     +421     
==========================================
+ Hits        11932    12342     +410     
- Misses       2413     2424      +11     

☔ View full report in Codecov by Harness.
📢 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.

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.

5 participants