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::{
52 SeedConfig, SeedRiskProfile, clamp_seed_rho_to_bounds, normalize_seed_bounds,
53 };
54}
55
56/// `crate::model_types` → fit-result / penalty-spec carriers now in `gam-solve`,
57/// plus the finite-validation helper from `gam-problem` that `gam-solve` only
58/// re-exports crate-internally.
59pub mod model_types {
60 pub use gam_solve::model_types::*;
61 pub(crate) use gam_problem::validate_all_finite_estimation;
62 // Finite-scalar guard consumed as `crate::model_types::ensure_finite_scalar_estimation`
63 // (survival/location_scale); it lives in `gam-problem::finite_validation`.
64 pub use gam_problem::ensure_finite_scalar_estimation;
65}
66
67/// `crate::inference::{quadrature, probability}` → the carved homes of the two
68/// inference submodules that already live in leaf crates. The remaining
69/// `crate::inference::{model, formula_dsl, smooth_test, predict_io, generative}`
70/// submodules are still in the uncarved monolith (see blocker report) and are
71/// intentionally *not* shimmed here — there is no leaf crate to re-export them
72/// from yet.
73pub mod inference;
74
75pub mod fit_orchestration;
76pub mod latent_coordinate;
77pub mod protocol;
78pub mod response_geometry;
79
80pub mod binomial_multi;
81pub mod block_layout;
82pub mod bms;
83pub(crate) mod coefficient_cost;
84pub mod gpu_kernels;
85pub mod custom_family;
86pub mod family_runtime;
87pub(crate) mod fast_channel;
88pub(crate) mod fnv1a;
89pub mod gamlss;
90pub mod joint_penalty;
91pub(crate) mod location_scale_engine;
92pub mod marginal_slope_orthogonal;
93pub mod marginal_slope_shared;
94pub mod multinomial;
95pub mod multinomial_posterior;
96pub(crate) mod multinomial_reml;
97pub mod outer_subsample;
98pub mod parameter_block;
99pub mod penalized_vector_glm;
100pub(crate) mod row_kernel;
101pub mod spatial_psi_bridge;
102pub mod survival;
103pub mod transformation_normal;
104pub mod vector_response;
105pub mod wiggle;
106
107// The base kernel layer was carved into `gam-model-kernels` under #1521. These
108// re-exports reconstruct the pre-carve flat namespace so every `crate::X::*`
109// call site across the families that stayed here (and external `gam_models::X`
110// consumers) resolves unchanged — no code is duplicated.
111pub use gam_model_kernels::{
112 cell_moment_family, cubic_cell_kernel, inverse_link, monotone_root, penalized_projection,
113 scale_design, sigma_link,
114};
115
116pub use gam_identifiability::families::compiler::{
117 BlockOrder, CompiledBlock, CompiledBlocks, CompilerError, RowHessian, RowJacobianOperator,
118 compile,
119};
120pub use vector_response::{
121 GaussianVectorLikelihood, MultinomialLogitLikelihood, VectorLikelihood, VectorNoise,
122 VectorResponseTarget,
123};