fn string_to_sw_extrapolation(s: &str) -> Result<space_weather::SpaceWeatherExtrapolation, RustBraheError> {
match s {
"Hold" => Ok(space_weather::SpaceWeatherExtrapolation::Hold),
"Zero" => Ok(space_weather::SpaceWeatherExtrapolation::Zero),
"Error" => Ok(space_weather::SpaceWeatherExtrapolation::Error),
_ => Err(RustBraheError::Error(format!(
"Unknown Space Weather Extrapolation string \"{}\". Valid values: Hold, Zero, Error",
s
))),
}
}
fn sw_extrapolation_to_string(extrapolation: space_weather::SpaceWeatherExtrapolation) -> String {
match extrapolation {
space_weather::SpaceWeatherExtrapolation::Hold => String::from("Hold"),
space_weather::SpaceWeatherExtrapolation::Zero => String::from("Zero"),
space_weather::SpaceWeatherExtrapolation::Error => String::from("Error"),
}
}
fn sw_type_to_string(sw_type: space_weather::SpaceWeatherType) -> String {
match sw_type {
space_weather::SpaceWeatherType::CssiSpaceWeather => String::from("CssiSpaceWeather"),
space_weather::SpaceWeatherType::Unknown => String::from("Unknown"),
space_weather::SpaceWeatherType::Static => String::from("Static"),
}
}
#[pyclass(module = "brahe._brahe")]
#[pyo3(name = "StaticSpaceWeatherProvider")]
pub(crate) struct PyStaticSpaceWeatherProvider {
obj: space_weather::StaticSpaceWeatherProvider,
}
#[pymethods]
impl PyStaticSpaceWeatherProvider {
pub fn __repr__(&self) -> String {
format!("{:?}", self.obj)
}
pub fn __str__(&self) -> String {
self.obj.to_string()
}
#[new]
pub fn new() -> Self {
PyStaticSpaceWeatherProvider {
obj: space_weather::StaticSpaceWeatherProvider::new(),
}
}
#[classmethod]
pub fn from_zero(_cls: &Bound<'_, PyType>) -> Self {
PyStaticSpaceWeatherProvider {
obj: space_weather::StaticSpaceWeatherProvider::from_zero(),
}
}
#[classmethod]
pub fn from_values(
_cls: &Bound<'_, PyType>,
kp: f64,
ap: f64,
f107: f64,
f107a: f64,
s: u32,
) -> Self {
PyStaticSpaceWeatherProvider {
obj: space_weather::StaticSpaceWeatherProvider::from_values(kp, ap, f107, f107a, s),
}
}
pub fn is_initialized(&self) -> bool {
self.obj.is_initialized()
}
pub fn len(&self) -> usize {
self.obj.len()
}
pub fn sw_type(&self) -> String {
sw_type_to_string(self.obj.sw_type())
}
pub fn extrapolation(&self) -> String {
sw_extrapolation_to_string(self.obj.extrapolation())
}
pub fn mjd_min(&self) -> f64 {
self.obj.mjd_min()
}
pub fn mjd_max(&self) -> f64 {
self.obj.mjd_max()
}
pub fn mjd_last_observed(&self) -> f64 {
self.obj.mjd_last_observed()
}
pub fn mjd_last_daily_predicted(&self) -> f64 {
self.obj.mjd_last_daily_predicted()
}
pub fn mjd_last_monthly_predicted(&self) -> f64 {
self.obj.mjd_last_monthly_predicted()
}
pub fn get_kp(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_kp(mjd)
}
pub fn get_kp_all(&self, mjd: f64) -> Result<[f64; 8], RustBraheError> {
self.obj.get_kp_all(mjd)
}
pub fn get_kp_daily(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_kp_daily(mjd)
}
pub fn get_ap(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_ap(mjd)
}
pub fn get_ap_all(&self, mjd: f64) -> Result<[f64; 8], RustBraheError> {
self.obj.get_ap_all(mjd)
}
pub fn get_ap_daily(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_ap_daily(mjd)
}
pub fn get_f107_observed(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_observed(mjd)
}
pub fn get_f107_adjusted(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_adjusted(mjd)
}
pub fn get_f107_obs_avg81(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_obs_avg81(mjd)
}
pub fn get_f107_adj_avg81(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_adj_avg81(mjd)
}
pub fn get_sunspot_number(&self, mjd: f64) -> Result<u32, RustBraheError> {
self.obj.get_sunspot_number(mjd)
}
pub fn get_last_kp(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_kp(mjd, n)
}
pub fn get_last_ap(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_ap(mjd, n)
}
pub fn get_last_daily_kp(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_daily_kp(mjd, n)
}
pub fn get_last_daily_ap(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_daily_ap(mjd, n)
}
pub fn get_last_f107(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_f107(mjd, n)
}
pub fn get_last_kpap_epochs(&self, mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
self.obj.get_last_kpap_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
pub fn get_last_daily_epochs(&self, mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
self.obj.get_last_daily_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
}
#[pyclass(module = "brahe._brahe")]
#[pyo3(name = "FileSpaceWeatherProvider")]
pub(crate) struct PyFileSpaceWeatherProvider {
obj: space_weather::FileSpaceWeatherProvider,
}
#[pymethods]
impl PyFileSpaceWeatherProvider {
pub fn __repr__(&self) -> String {
format!("{:?}", self.obj)
}
pub fn __str__(&self) -> String {
self.obj.to_string()
}
#[new]
pub fn new() -> Self {
PyFileSpaceWeatherProvider {
obj: space_weather::FileSpaceWeatherProvider::new(),
}
}
#[classmethod]
pub fn from_file(
_cls: &Bound<'_, PyType>,
filepath: &str,
extrapolate: &str,
) -> Result<Self, RustBraheError> {
Ok(PyFileSpaceWeatherProvider {
obj: space_weather::FileSpaceWeatherProvider::from_file(
Path::new(filepath),
string_to_sw_extrapolation(extrapolate)?,
)?,
})
}
#[classmethod]
pub fn from_default_file(_cls: &Bound<'_, PyType>) -> Result<Self, RustBraheError> {
Ok(PyFileSpaceWeatherProvider {
obj: space_weather::FileSpaceWeatherProvider::from_default_file()?,
})
}
pub fn is_initialized(&self) -> bool {
self.obj.is_initialized()
}
pub fn len(&self) -> usize {
self.obj.len()
}
pub fn sw_type(&self) -> String {
sw_type_to_string(self.obj.sw_type())
}
pub fn extrapolation(&self) -> String {
sw_extrapolation_to_string(self.obj.extrapolation())
}
pub fn mjd_min(&self) -> f64 {
self.obj.mjd_min()
}
pub fn mjd_max(&self) -> f64 {
self.obj.mjd_max()
}
pub fn mjd_last_observed(&self) -> f64 {
self.obj.mjd_last_observed()
}
pub fn mjd_last_daily_predicted(&self) -> f64 {
self.obj.mjd_last_daily_predicted()
}
pub fn mjd_last_monthly_predicted(&self) -> f64 {
self.obj.mjd_last_monthly_predicted()
}
pub fn get_kp(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_kp(mjd)
}
pub fn get_kp_all(&self, mjd: f64) -> Result<[f64; 8], RustBraheError> {
self.obj.get_kp_all(mjd)
}
pub fn get_kp_daily(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_kp_daily(mjd)
}
pub fn get_ap(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_ap(mjd)
}
pub fn get_ap_all(&self, mjd: f64) -> Result<[f64; 8], RustBraheError> {
self.obj.get_ap_all(mjd)
}
pub fn get_ap_daily(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_ap_daily(mjd)
}
pub fn get_f107_observed(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_observed(mjd)
}
pub fn get_f107_adjusted(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_adjusted(mjd)
}
pub fn get_f107_obs_avg81(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_obs_avg81(mjd)
}
pub fn get_f107_adj_avg81(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_adj_avg81(mjd)
}
pub fn get_sunspot_number(&self, mjd: f64) -> Result<u32, RustBraheError> {
self.obj.get_sunspot_number(mjd)
}
pub fn get_last_kp(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_kp(mjd, n)
}
pub fn get_last_ap(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_ap(mjd, n)
}
pub fn get_last_daily_kp(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_daily_kp(mjd, n)
}
pub fn get_last_daily_ap(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_daily_ap(mjd, n)
}
pub fn get_last_f107(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_f107(mjd, n)
}
pub fn get_last_kpap_epochs(&self, mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
self.obj.get_last_kpap_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
pub fn get_last_daily_epochs(&self, mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
self.obj.get_last_daily_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
}
#[pyclass(module = "brahe._brahe")]
#[pyo3(name = "CachingSpaceWeatherProvider")]
pub(crate) struct PyCachingSpaceWeatherProvider {
obj: space_weather::CachingSpaceWeatherProvider,
}
#[pymethods]
impl PyCachingSpaceWeatherProvider {
pub fn __repr__(&self) -> String {
format!(
"CachingSpaceWeatherProvider(type={}, len={}, auto_refresh={})",
sw_type_to_string(self.obj.sw_type()),
self.obj.len(),
self.obj.auto_refresh
)
}
pub fn __str__(&self) -> String {
format!(
"CachingSpaceWeatherProvider with {} data points (auto_refresh: {})",
self.obj.len(),
self.obj.auto_refresh
)
}
#[new]
#[pyo3(signature = (max_age_seconds, auto_refresh, extrapolate, cache_dir=None))]
pub fn new(
max_age_seconds: u64,
auto_refresh: bool,
extrapolate: &str,
cache_dir: Option<&str>,
) -> Result<Self, RustBraheError> {
Ok(PyCachingSpaceWeatherProvider {
obj: space_weather::CachingSpaceWeatherProvider::new(
cache_dir.map(PathBuf::from),
max_age_seconds,
auto_refresh,
string_to_sw_extrapolation(extrapolate)?,
)?,
})
}
#[classmethod]
#[pyo3(signature = (url, max_age_seconds, auto_refresh, extrapolate, cache_dir=None))]
pub fn with_url(
_cls: &Bound<'_, PyType>,
url: &str,
max_age_seconds: u64,
auto_refresh: bool,
extrapolate: &str,
cache_dir: Option<&str>,
) -> Result<Self, RustBraheError> {
Ok(PyCachingSpaceWeatherProvider {
obj: space_weather::CachingSpaceWeatherProvider::with_url(
url,
cache_dir.map(PathBuf::from),
max_age_seconds,
auto_refresh,
string_to_sw_extrapolation(extrapolate)?,
)?,
})
}
pub fn refresh(&self) -> Result<(), RustBraheError> {
self.obj.refresh()
}
pub fn file_epoch(&self) -> PyEpoch {
PyEpoch {
obj: self.obj.file_epoch(),
}
}
pub fn file_age(&self) -> f64 {
self.obj.file_age()
}
pub fn is_initialized(&self) -> bool {
self.obj.is_initialized()
}
pub fn len(&self) -> usize {
self.obj.len()
}
pub fn sw_type(&self) -> String {
sw_type_to_string(self.obj.sw_type())
}
pub fn extrapolation(&self) -> String {
sw_extrapolation_to_string(self.obj.extrapolation())
}
pub fn mjd_min(&self) -> f64 {
self.obj.mjd_min()
}
pub fn mjd_max(&self) -> f64 {
self.obj.mjd_max()
}
pub fn mjd_last_observed(&self) -> f64 {
self.obj.mjd_last_observed()
}
pub fn mjd_last_daily_predicted(&self) -> f64 {
self.obj.mjd_last_daily_predicted()
}
pub fn mjd_last_monthly_predicted(&self) -> f64 {
self.obj.mjd_last_monthly_predicted()
}
pub fn get_kp(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_kp(mjd)
}
pub fn get_kp_all(&self, mjd: f64) -> Result<[f64; 8], RustBraheError> {
self.obj.get_kp_all(mjd)
}
pub fn get_kp_daily(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_kp_daily(mjd)
}
pub fn get_ap(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_ap(mjd)
}
pub fn get_ap_all(&self, mjd: f64) -> Result<[f64; 8], RustBraheError> {
self.obj.get_ap_all(mjd)
}
pub fn get_ap_daily(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_ap_daily(mjd)
}
pub fn get_f107_observed(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_observed(mjd)
}
pub fn get_f107_adjusted(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_adjusted(mjd)
}
pub fn get_f107_obs_avg81(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_obs_avg81(mjd)
}
pub fn get_f107_adj_avg81(&self, mjd: f64) -> Result<f64, RustBraheError> {
self.obj.get_f107_adj_avg81(mjd)
}
pub fn get_sunspot_number(&self, mjd: f64) -> Result<u32, RustBraheError> {
self.obj.get_sunspot_number(mjd)
}
pub fn get_last_kp(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_kp(mjd, n)
}
pub fn get_last_ap(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_ap(mjd, n)
}
pub fn get_last_daily_kp(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_daily_kp(mjd, n)
}
pub fn get_last_daily_ap(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_daily_ap(mjd, n)
}
pub fn get_last_f107(&self, mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
self.obj.get_last_f107(mjd, n)
}
pub fn get_last_kpap_epochs(&self, mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
self.obj.get_last_kpap_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
pub fn get_last_daily_epochs(&self, mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
self.obj.get_last_daily_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
}
#[pyfunction]
#[pyo3(text_signature = "(provider)")]
#[pyo3(name = "set_global_space_weather_provider")]
pub fn py_set_global_space_weather_provider(provider: &Bound<'_, PyAny>) -> PyResult<()> {
if let Ok(static_provider) = provider.extract::<PyRef<PyStaticSpaceWeatherProvider>>() {
space_weather::set_global_space_weather_provider(static_provider.obj.clone());
Ok(())
} else if let Ok(file_provider) = provider.extract::<PyRef<PyFileSpaceWeatherProvider>>() {
space_weather::set_global_space_weather_provider(file_provider.obj.clone());
Ok(())
} else if let Ok(caching_provider) = provider.extract::<PyRef<PyCachingSpaceWeatherProvider>>() {
space_weather::set_global_space_weather_provider(caching_provider.obj.clone());
Ok(())
} else {
Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
"Provider must be StaticSpaceWeatherProvider, FileSpaceWeatherProvider, or CachingSpaceWeatherProvider"
))
}
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_kp")]
pub fn py_get_global_kp(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_kp(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_kp_all")]
pub fn py_get_global_kp_all(mjd: f64) -> Result<[f64; 8], RustBraheError> {
space_weather::get_global_kp_all(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_kp_daily")]
pub fn py_get_global_kp_daily(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_kp_daily(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_ap")]
pub fn py_get_global_ap(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_ap(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_ap_all")]
pub fn py_get_global_ap_all(mjd: f64) -> Result<[f64; 8], RustBraheError> {
space_weather::get_global_ap_all(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_ap_daily")]
pub fn py_get_global_ap_daily(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_ap_daily(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_f107_observed")]
pub fn py_get_global_f107_observed(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_f107_observed(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_f107_adjusted")]
pub fn py_get_global_f107_adjusted(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_f107_adjusted(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_f107_obs_avg81")]
pub fn py_get_global_f107_obs_avg81(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_f107_obs_avg81(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_f107_adj_avg81")]
pub fn py_get_global_f107_adj_avg81(mjd: f64) -> Result<f64, RustBraheError> {
space_weather::get_global_f107_adj_avg81(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd)")]
#[pyo3(name = "get_global_sunspot_number")]
pub fn py_get_global_sunspot_number(mjd: f64) -> Result<u32, RustBraheError> {
space_weather::get_global_sunspot_number(mjd)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_kp")]
pub fn py_get_global_last_kp(mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
space_weather::get_global_last_kp(mjd, n)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_ap")]
pub fn py_get_global_last_ap(mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
space_weather::get_global_last_ap(mjd, n)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_daily_kp")]
pub fn py_get_global_last_daily_kp(mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
space_weather::get_global_last_daily_kp(mjd, n)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_daily_ap")]
pub fn py_get_global_last_daily_ap(mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
space_weather::get_global_last_daily_ap(mjd, n)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_f107")]
pub fn py_get_global_last_f107(mjd: f64, n: usize) -> Result<Vec<f64>, RustBraheError> {
space_weather::get_global_last_f107(mjd, n)
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_kpap_epochs")]
pub fn py_get_global_last_kpap_epochs(mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
space_weather::get_global_last_kpap_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
#[pyfunction]
#[pyo3(text_signature = "(mjd, n)")]
#[pyo3(name = "get_global_last_daily_epochs")]
pub fn py_get_global_last_daily_epochs(mjd: f64, n: usize) -> Result<Vec<PyEpoch>, RustBraheError> {
space_weather::get_global_last_daily_epochs(mjd, n).map(|epochs| {
epochs.into_iter().map(|e| PyEpoch { obj: e }).collect()
})
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_initialization")]
pub fn py_get_global_sw_initialization() -> bool {
space_weather::get_global_sw_initialization()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_len")]
pub fn py_get_global_sw_len() -> usize {
space_weather::get_global_sw_len()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_type")]
pub fn py_get_global_sw_type() -> String {
sw_type_to_string(space_weather::get_global_sw_type())
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_extrapolation")]
pub fn py_get_global_sw_extrapolation() -> String {
sw_extrapolation_to_string(space_weather::get_global_sw_extrapolation())
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_mjd_min")]
pub fn py_get_global_sw_mjd_min() -> f64 {
space_weather::get_global_sw_mjd_min()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_mjd_max")]
pub fn py_get_global_sw_mjd_max() -> f64 {
space_weather::get_global_sw_mjd_max()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_mjd_last_observed")]
pub fn py_get_global_sw_mjd_last_observed() -> f64 {
space_weather::get_global_sw_mjd_last_observed()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_mjd_last_daily_predicted")]
pub fn py_get_global_sw_mjd_last_daily_predicted() -> f64 {
space_weather::get_global_sw_mjd_last_daily_predicted()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "get_global_sw_mjd_last_monthly_predicted")]
pub fn py_get_global_sw_mjd_last_monthly_predicted() -> f64 {
space_weather::get_global_sw_mjd_last_monthly_predicted()
}
#[pyfunction]
#[pyo3(text_signature = "()")]
#[pyo3(name = "initialize_sw")]
pub fn py_initialize_sw() -> Result<(), RustBraheError> {
space_weather::initialize_sw()
}