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#[cfg(test)]
20mod probe_1561_locscale_lambda_tests;
21
22// `bail_*` shorthands whose error types were relocated to the neutral
23// `gam-problem` crate. Re-exporting the `#[macro_export]` macros here makes
24// `crate::bail_invalid_estim!` / `crate::bail_dim_custom!` resolve unchanged.
25pub use gam_problem::{bail_dim_custom, bail_invalid_estim};
26
27// ---------------------------------------------------------------------------
28// Facade shims — thin `pub use` re-export modules that reconstruct the
29// pre-carve flat namespace so the relocated families' `crate::X::*` paths
30// resolve to their new homes in the dependency crates. No code is duplicated.
31// ---------------------------------------------------------------------------
32
33/// `crate::probability` → distributional primitives now in `gam-math`.
34pub mod probability {
35 pub use gam_math::probability::*;
36}
37
38/// `crate::util` → progress/span utilities now in `gam-runtime`.
39pub mod util {
40 pub use gam_runtime::{loop_progress, span};
41}
42
43/// `crate::quadrature` → quadrature rules now in `gam-solve`.
44pub mod quadrature {
45 pub use gam_solve::quadrature::*;
46}
47
48/// `crate::seeding` → seed-config carriers now in `gam-problem` (the `seeding`
49/// module is private there; its items are surfaced at the crate root).
50pub mod seeding {
51 pub use gam_problem::{OrderedRhoBounds, SeedConfig, SeedRiskProfile};
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 latent_coordinate;
75pub mod protocol;
76pub mod response_geometry;
77
78pub mod binomial_multi;
79pub mod block_layout;
80pub mod bms;
81pub(crate) mod coefficient_cost;
82pub mod gpu_kernels;
83pub mod custom_family;
84pub mod family_runtime;
85pub(crate) mod fast_channel;
86pub(crate) mod fnv1a;
87pub mod gamlss;
88pub mod joint_penalty;
89pub(crate) mod location_scale_engine;
90pub mod marginal_slope_orthogonal;
91pub mod marginal_slope_shared;
92pub mod multinomial;
93pub mod multinomial_posterior;
94pub(crate) mod multinomial_reml;
95pub use multinomial_reml::{MultinomialFamily, MultinomialLogitRowProgram};
96pub mod outer_subsample;
97pub mod parameter_block;
98pub mod penalized_vector_glm;
99pub(crate) mod row_kernel;
100pub mod spatial_psi_bridge;
101pub mod survival;
102pub mod transformation_normal;
103pub mod vector_response;
104pub mod wiggle;
105
106// The base kernel layer was carved into `gam-model-kernels` under #1521. These
107// re-exports reconstruct the pre-carve flat namespace so every `crate::X::*`
108// call site across the families that stayed here (and external `gam_models::X`
109// consumers) resolves unchanged — no code is duplicated.
110pub use gam_model_kernels::{
111 cell_moment_family, cubic_cell_kernel, inverse_link, monotone_root, penalized_projection,
112 scale_design, sigma_link,
113};
114
115pub use gam_identifiability::families::compiler::{
116 BlockOrder, CompiledBlock, CompiledBlocks, CompilerError, RowHessian, RowJacobianOperator,
117 compile,
118};
119pub use vector_response::{
120 GaussianVectorLikelihood, MultinomialLogitLikelihood, VectorLikelihood, VectorNoise,
121 VectorResponseTarget,
122};