Skip to main content

gam_models/
mod.rs

1// The shared `impl_reason_error_boilerplate!` derive was carved down into the
2// base kernel crate (`gam-model-kernels`) under #1521. `#[macro_use]` brings
3// its `#[macro_export]` macro into crate-wide textual scope so the unqualified
4// `impl_reason_error_boilerplate! { .. }` call sites across the families that
5// stayed here (survival / bms / gamlss / transformation_normal / inference)
6// resolve unchanged.
7#[macro_use]
8extern crate gam_model_kernels;
9
10// Declarative `bail_*` macros whose target error enums live in this crate.
11// `#[macro_export]` places them at the crate root so the `bail_invalid_surv!`
12// call sites across the relocated families resolve unchanged. `#[macro_use]`
13// puts them in textual scope so same-crate call sites use the unqualified name
14// (rustc forbids `crate::`-absolute paths to same-crate `macro_export` macros).
15#[macro_use]
16mod macros;
17
18// `bail_*` shorthands whose error types were relocated to the neutral
19// `gam-problem` crate. Re-exporting the `#[macro_export]` macros here makes
20// `crate::bail_invalid_estim!` / `crate::bail_dim_custom!` resolve unchanged.
21pub use gam_problem::{bail_dim_custom, bail_invalid_estim};
22
23// ---------------------------------------------------------------------------
24// Facade shims — thin `pub use` re-export modules that reconstruct the
25// pre-carve flat namespace so the relocated families' `crate::X::*` paths
26// resolve to their new homes in the dependency crates. No code is duplicated.
27// ---------------------------------------------------------------------------
28
29/// `crate::probability` → distributional primitives now in `gam-math`.
30pub mod probability {
31    pub use gam_math::probability::*;
32}
33
34/// `crate::util` → progress/span utilities now in `gam-runtime`.
35pub mod util {
36    pub use gam_runtime::{loop_progress, span};
37}
38
39/// `crate::quadrature` → quadrature rules now in `gam-solve`.
40pub mod quadrature {
41    pub use gam_solve::quadrature::*;
42}
43
44/// `crate::seeding` → seed-config carriers now in `gam-problem` (the `seeding`
45/// module is private there; its items are surfaced at the crate root).
46pub mod seeding {
47    pub use gam_problem::{
48        SeedConfig, SeedRiskProfile, clamp_seed_rho_to_bounds, normalize_seed_bounds,
49    };
50}
51
52/// `crate::model_types` → fit-result / penalty-spec carriers now in `gam-solve`,
53/// plus the finite-validation helper from `gam-problem` that `gam-solve` only
54/// re-exports crate-internally.
55pub mod model_types {
56    pub use gam_solve::model_types::*;
57    pub(crate) use gam_problem::validate_all_finite_estimation;
58    // Finite-scalar guard consumed as `crate::model_types::ensure_finite_scalar_estimation`
59    // (survival/location_scale); it lives in `gam-problem::finite_validation`.
60    pub use gam_problem::ensure_finite_scalar_estimation;
61}
62
63/// `crate::inference::{quadrature, probability}` → the carved homes of the two
64/// inference submodules that already live in leaf crates. The remaining
65/// `crate::inference::{model, formula_dsl, smooth_test, predict_io, generative}`
66/// submodules are still in the uncarved monolith (see blocker report) and are
67/// intentionally *not* shimmed here — there is no leaf crate to re-export them
68/// from yet.
69pub mod inference;
70
71pub mod fit_orchestration;
72pub mod protocol;
73
74pub mod binomial_multi;
75pub mod block_layout;
76pub mod bms;
77pub(crate) mod coefficient_cost;
78pub mod gpu_kernels;
79pub mod custom_family;
80pub mod family_runtime;
81pub(crate) mod fast_channel;
82pub(crate) mod fnv1a;
83pub mod gamlss;
84pub mod joint_penalty;
85pub(crate) mod location_scale_engine;
86pub mod marginal_slope_orthogonal;
87pub mod marginal_slope_shared;
88pub mod multinomial;
89pub(crate) mod multinomial_reml;
90pub mod outer_subsample;
91pub mod parameter_block;
92pub mod penalized_vector_glm;
93pub(crate) mod row_kernel;
94pub mod spatial_psi_bridge;
95pub mod survival;
96pub mod transformation_normal;
97pub mod vector_response;
98pub mod wiggle;
99
100// The base kernel layer was carved into `gam-model-kernels` under #1521. These
101// re-exports reconstruct the pre-carve flat namespace so every `crate::X::*`
102// call site across the families that stayed here (and external `gam_models::X`
103// consumers) resolves unchanged — no code is duplicated.
104pub use gam_model_kernels::{
105    cell_moment_family, cubic_cell_kernel, inverse_link, monotone_root, penalized_projection,
106    scale_design, sigma_link,
107};
108
109pub use gam_identifiability::families::compiler::{
110    BlockOrder, CompiledBlock, CompiledBlocks, CompilerError, RowHessian, RowJacobianOperator,
111    compile,
112};
113pub use vector_response::{
114    GaussianVectorLikelihood, MultinomialLogitLikelihood, VectorLikelihood, VectorNoise,
115    VectorResponseTarget,
116};