1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! # pvlib-rust
//!
//! A Rust port of [pvlib-python](https://github.com/pvlib/pvlib-python), the
//! open-source solar photovoltaic modeling library. The crate covers the full
//! PV simulation pipeline: solar position, clear-sky irradiance, transposition,
//! incidence-angle modifier, cell temperature, and DC/AC power.
//!
//! ## Feature flags
//!
//! - `pvgis` (default) — enables network I/O for PVGIS and NREL SAM helpers
//! in [`iotools`]. Pulls in `reqwest` with `rustls-tls`. Disable with
//! `default-features = false` to build the pure-compute parts of the
//! library on targets where blocking HTTP is not available
//! (e.g. `wasm32-unknown-unknown`).
//!
//! ## Quick start — batch simulation
//!
//! ```no_run
//! use chrono::TimeZone;
//! use chrono_tz::US::Mountain;
//! use pvlib::batch::{BatchModelChain, WeatherSeries};
//! use pvlib::irradiance::DiffuseModel;
//! use pvlib::Location;
//!
//! let location = Location::try_new(39.74, -105.18, Mountain, 1830.0, "Golden, CO").unwrap();
//!
//! let mc = BatchModelChain::pvwatts(location, 30.0, 180.0, 5000.0)
//! .with_gamma_pdc(-0.004)
//! .with_inverter(5000.0, 0.96)
//! .with_albedo(0.2)
//! .with_transposition(DiffuseModel::Perez)
//! .with_auto_decomposition(true)
//! .with_system_losses(0.14);
//!
//! # let times = Vec::<chrono::DateTime<chrono_tz::Tz>>::new();
//! # let zeros = vec![0.0_f64; times.len()];
//! let weather = WeatherSeries {
//! times,
//! ghi: zeros.clone(), dni: zeros.clone(), dhi: zeros.clone(),
//! temp_air: zeros.clone(), wind_speed: zeros.clone(),
//! albedo: None,
//! };
//!
//! let results = mc.run(&weather).unwrap();
//! println!("Annual energy: {:.0} kWh", results.total_energy_wh() / 1000.0);
//! ```
//!
//! See the [README](https://github.com/p-vbordei/pvlib-rust) for the full
//! Quick Start, step-by-step usage, and the comparison with pvlib-python.
//!
//! ## Algorithm notes
//!
//! - [`irradiance::dirint`] and [`irradiance::dirint_series`] are faithful
//! ports of `pvlib.irradiance.dirint`, including the full 6×6×7×5
//! coefficient tensor. The scalar version uses the `delta_kt' = -1`
//! fallback bin; call the series version for time-aware persistence.
//! - [`clearsky::detect_clearsky`] is a faithful port of the Reno–Hansen
//! (2016) windowed 5-criterion algorithm with iterative α rescaling.
//! - [`bifacial`] exposes the real 2-D view-factor primitives
//! (`vf_row_sky_2d`, `vf_row_sky_2d_integ`, `vf_row_ground_2d`,
//! `vf_row_ground_2d_integ`, `unshaded_ground_fraction`,
//! `solar_projection_tangent`) used inside
//! `pvlib.bifacial.infinite_sheds`, plus a composed rear-irradiance
//! helper [`bifacial::rear_irradiance_sheds`]. The front-face /
//! shadow-fraction pipeline of the full `get_irradiance_poa` is
//! tracked in `ROADMAP.md`.
// Private data tables for algorithms that require large coefficient sets.
// ---------------------------------------------------------------------------
// Crate-root re-exports for the common entry points. Users can write
// `pvlib::Location` instead of `pvlib::location::Location`, etc.
// ---------------------------------------------------------------------------
pub use ;
pub use ;
pub use ;
pub use ;