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