Skip to content

Commit

Permalink
Fixed the doctests import name
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Feb 13, 2024
1 parent 9894f6f commit efad997
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sirius.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ jobs:
SIRIUS_PASSWORD: ${{secrets.SIRIUS_PASSWORD}}
run: |
export SIRIUS_PATH=${{vars.SIRIUS_PATH}}
cargo test --test test_sirius
cargo test
10 changes: 5 additions & 5 deletions bindings/sirius-bindings/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sirius
[![Build status](https://github.com/earth-metabolome-initiative/sirius-bindings/actions/workflows/sirius.yml/badge.svg)](https://github.com/earth-metabolome-initiative/sirius-bindings/actions)
[![Build status](https://github.com/earth-metabolome-initiative/emi-monorepo/actions/workflows/sirius.yml/badge.svg)](https://github.com/earth-metabolome-initiative/emi-monorepo/actions)
[![Crates.io](https://img.shields.io/crates/v/sirius-bindings.svg)](https://crates.io/crates/sirius-bindings)
[![Documentation](https://docs.rs/sirius-bindings/badge.svg)](https://docs.rs/sirius-bindings)

Expand Down Expand Up @@ -30,7 +30,7 @@ sirius = "0.1"
```
and this to your crate root:
```rust
use sirius::prelude::*;
use sirius_bindings::prelude::*;
```

## Examples
Expand All @@ -41,7 +41,7 @@ sirius -i tests/data/input_sirius.mgf --output tests/data/output_sirius_default

The equivalent Rust code is:
```rust
use sirius::prelude::*;
use sirius_bindings::prelude::*;
use std::path::Path;
let sirius = SiriusBuilder::<Version5>::default()
.maximal_mz_default().unwrap()
Expand Down Expand Up @@ -84,7 +84,7 @@ config --IsotopeSettings.filter=true --FormulaSearchDB=BIO --Timeout.secondsPerT

The equivalent Rust code is:
```rust
use sirius::prelude::*;
use sirius_bindings::prelude::*;
use std::path::Path;
let sirius = SiriusBuilder::default()
.maximal_mz(800.0).unwrap()
Expand Down Expand Up @@ -161,7 +161,7 @@ This binding also provides error handling before running the Sirius CLI.

The following example will throw an error because the `maximal_mz` is added twice:
```should_panic
use sirius::prelude::*;
use sirius_bindings::prelude::*;
use std::path::Path;
let sirius = SiriusBuilder::<Version5>::default()
.maximal_mz_default().unwrap()
Expand Down
2 changes: 1 addition & 1 deletion bindings/sirius-bindings/fuzz/fuzz_targets/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use libfuzzer_sys::fuzz_target;
use rand::rngs::SmallRng;
use rand::Rng;
use rand::SeedableRng;
use sirius::prelude::*;
use sirius_bindings::prelude::*;

#[derive(Arbitrary, Debug)]
struct FuzzCase {
Expand Down
20 changes: 10 additions & 10 deletions bindings/sirius-bindings/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl SiriusBuilder<Version5> {
/// # Example
///
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
///
/// let sirius = SiriusBuilder::default()
/// .maximal_mz(1000.0).unwrap()
Expand Down Expand Up @@ -61,7 +61,7 @@ impl SiriusBuilder<Version5> {
/// * `n_cores` - The number of cores to use.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::default()
/// .max_cpus(4).unwrap()
/// .build();
Expand All @@ -77,7 +77,7 @@ impl SiriusBuilder<Version5> {
///
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::default()
/// .isotope_settings_filter(true).unwrap()
/// .build();
Expand All @@ -96,7 +96,7 @@ impl SiriusBuilder<Version5> {
/// * `formula_search_db` - The database to be used for formula search.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::default()
/// .formula_search_db(DBVector::from(vec![SearchDB::Hmdb])).unwrap()
/// .build();
Expand All @@ -117,7 +117,7 @@ impl SiriusBuilder<Version5> {
/// * `structure_search_db` - The database to be used for the structure search.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::default()
/// .structure_search_db(DBVector::from(vec![SearchDB::Zincbio])).unwrap()
/// .build();
Expand All @@ -136,7 +136,7 @@ impl SiriusBuilder<Version5> {
/// * `timeout_seconds_per_tree` - The timeout seconds for each tree.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::default()
/// .timeout_seconds_per_tree(100).unwrap()
/// .build();
Expand Down Expand Up @@ -515,7 +515,7 @@ impl SiriusBuilder<Version5> {
/// * `zodiac_library_scoring_min_cosine` - The minimal cosine value.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::default()
/// .zodiac_library_scoring_min_cosine(0.5).unwrap()
/// .build();
Expand All @@ -524,7 +524,7 @@ impl SiriusBuilder<Version5> {
/// If the value is not in the range 0 and 1.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// assert!(SiriusBuilder::default().zodiac_library_scoring_min_cosine(1.1).is_err());
/// assert!(SiriusBuilder::default().zodiac_library_scoring_min_cosine(-0.1).is_err());
/// ```
Expand Down Expand Up @@ -1070,7 +1070,7 @@ impl<V: Version> SiriusBuilder<V> {
/// Build the Sirius instance from the configuration.
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let sirius = SiriusBuilder::<Version5>::default().build();
/// ```
pub fn build(self) -> Sirius<V> {
Expand All @@ -1084,7 +1084,7 @@ impl SiriusBuilder<Version5> {
/// # Example
///
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
///
/// let sirius = SiriusBuilder::default()
/// .maximal_mz_default().unwrap()
Expand Down
12 changes: 6 additions & 6 deletions bindings/sirius-bindings/src/sirius_types/mass_deviation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ impl MassDeviation {
/// If the value is negative
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let ppm = MassDeviation::ppm(10.0);
/// ```
/// # Panics
/// If the value is negative
/// ```should_panic
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let ppm = MassDeviation::ppm(-10.0);
/// ```
pub fn ppm(value: f32) -> Self {
Expand All @@ -39,13 +39,13 @@ impl MassDeviation {
/// If the value is negative
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let da = MassDeviation::da(0.1);
/// ```
/// # Panics
/// If the value is negative
/// ```should_panic
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let x = MassDeviation::da(-0.1);
/// ```
pub fn da(value: f32) -> Self {
Expand All @@ -61,14 +61,14 @@ impl MassDeviation {
/// If the value is negative
/// # Example
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let ppm = MassDeviation::ppm(10.0);
/// assert_eq!(ppm.must_be_positive().unwrap(), MassDeviation::Ppm(10.0));
/// ```
/// # Errors
/// If the value is negative
/// ```
/// use sirius::prelude::*;
/// use sirius_bindings::prelude::*;
/// let ppm = MassDeviation::Ppm(-10.0);
/// assert!(ppm.must_be_positive().is_err());
/// ```
Expand Down

0 comments on commit efad997

Please sign in to comment.