start using semver, fix doc.rs issue

This commit is contained in:
w.pomp
2026-02-23 19:54:58 +01:00
parent d2c725440c
commit 705ca16379
5 changed files with 17 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))]
mod bioformats;

View File

@@ -15,7 +15,7 @@ impl Metadata for Ome {
fn get_image(&self) -> Option<&Image> {
if let Some(image) = &self.image.first() {
Some(&image)
Some(image)
} else {
None
}

View File

@@ -19,7 +19,7 @@ use std::sync::Arc;
impl From<crate::error::Error> for PyErr {
fn from(err: crate::error::Error) -> PyErr {
PyErr::new::<PyValueError, _>(err.to_string())
color_eyre::eyre::Report::from(err).into()
}
}
@@ -49,7 +49,7 @@ impl ViewConstructor {
}
}
#[pyclass(subclass, module = "ndbioimage.ndbioimage_rs")]
#[pyclass(subclass, from_py_object, module = "ndbioimage.ndbioimage_rs")]
#[pyo3(name = "View")]
#[derive(Clone, Debug, Serialize, Deserialize)]
struct PyView {
@@ -982,6 +982,7 @@ fn py_download_bioformats(gpl_formats: bool) -> PyResult<()> {
#[pymodule]
#[pyo3(name = "ndbioimage_rs")]
fn ndbioimage_rs(m: &Bound<PyModule>) -> PyResult<()> {
color_eyre::install()?;
m.add_class::<PyView>()?;
m.add_class::<ViewConstructor>()?;
m.add_function(wrap_pyfunction!(py_download_bioformats, m)?)?;