Skip to content

Commit

Permalink
fix some rust doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Dec 30, 2021
1 parent a29f6af commit 27d0a0c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 78 deletions.
2 changes: 1 addition & 1 deletion polars/polars-core/src/chunked_array/strings/json_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn extract_json<'a>(expr: &Compiled, json_str: &'a str) -> Option<Cow<'a, str>>

impl Utf8Chunked {
/// Extract json path, first match
/// Refer to https://goessner.net/articles/JsonPath/
/// Refer to <https://goessner.net/articles/JsonPath/>
#[cfg(feature = "extract_jsonpath")]
pub fn json_path_match(&self, json_path: &str) -> Result<Utf8Chunked> {
match Compiled::compile(json_path) {
Expand Down
4 changes: 2 additions & 2 deletions polars/polars-core/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub enum NullStrategy {
///
/// ## Use declarations
///
/// All the common tools can be found in [`polars_core::prelude`] (or in `polars::prelude`).
/// All the common tools can be found in [`crate::prelude`] (or in `polars::prelude`).
///
/// ```rust
/// use polars_core::prelude::*; // if the crate polars-core is used directly
Expand Down Expand Up @@ -94,7 +94,7 @@ pub enum NullStrategy {
///
/// ## Using a CSV file
///
/// See the [`polars_io::csv::CsvReader`].
/// See the `polars_io::csv::CsvReader`.
///
/// # Indexing
/// ## By a number
Expand Down
8 changes: 4 additions & 4 deletions polars/polars-core/src/series/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ impl Series {
}

/// Apply a rolling mean to a Series. See:
/// [ChunkedArray::rolling_mean](crate::prelude::ChunkWindow::rolling_mean).
/// [ChunkedArray::rolling_mean]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
pub fn rolling_mean(&self, _options: RollingOptions) -> Result<Series> {
#[cfg(feature = "rolling_window")]
Expand All @@ -608,7 +608,7 @@ impl Series {
}
}
/// Apply a rolling sum to a Series. See:
/// [ChunkedArray::rolling_sum](crate::prelude::ChunkWindow::rolling_sum).
/// [ChunkedArray::rolling_sum]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
pub fn rolling_sum(&self, _options: RollingOptions) -> Result<Series> {
#[cfg(feature = "rolling_window")]
Expand All @@ -621,7 +621,7 @@ impl Series {
}
}
/// Apply a rolling min to a Series. See:
/// [ChunkedArray::rolling_min](crate::prelude::ChunkWindow::rolling_min).
/// [ChunkedArray::rolling_min]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
pub fn rolling_min(&self, _options: RollingOptions) -> Result<Series> {
#[cfg(feature = "rolling_window")]
Expand All @@ -634,7 +634,7 @@ impl Series {
}
}
/// Apply a rolling max to a Series. See:
/// [ChunkedArray::rolling_max](crate::prelude::ChunkWindow::rolling_max).
/// [ChunkedArray::rolling_max]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
pub fn rolling_max(&self, _options: RollingOptions) -> Result<Series> {
#[cfg(feature = "rolling_window")]
Expand Down
12 changes: 6 additions & 6 deletions polars/polars-lazy/src/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ pub struct WhenThen {

/// Intermediate state of chain when then exprs.
///
/// ```ignore
/// ```text
/// when(..).then(..)
/// when(..).then(..)
/// when(..).then(..)
Expand Down Expand Up @@ -860,7 +860,7 @@ impl Expr {
}
}

/// Sort in increasing order. See [the eager implementation](polars_core::series::SeriesTrait::sort).
/// Sort in increasing order. See [the eager implementation](Series::sort).
pub fn sort(self, reverse: bool) -> Self {
Expr::Sort {
expr: Box::new(self),
Expand Down Expand Up @@ -1510,7 +1510,7 @@ impl Expr {
}

/// Apply a rolling min See:
/// [ChunkedArray::rolling_min](polars::prelude::ChunkWindow::rolling_min).
/// [ChunkedArray::rolling_min]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
#[cfg(feature = "rolling_window")]
pub fn rolling_min(self, options: RollingOptions) -> Expr {
Expand All @@ -1521,7 +1521,7 @@ impl Expr {
}

/// Apply a rolling max See:
/// [ChunkedArray::rolling_max](polars::prelude::ChunkWindow::rolling_max).
/// [ChunkedArray::rolling_max]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
#[cfg(feature = "rolling_window")]
pub fn rolling_max(self, options: RollingOptions) -> Expr {
Expand All @@ -1532,7 +1532,7 @@ impl Expr {
}

/// Apply a rolling mean See:
/// [ChunkedArray::rolling_mean](polars::prelude::ChunkWindow::rolling_mean).
/// [ChunkedArray::rolling_mean]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
#[cfg(feature = "rolling_window")]
pub fn rolling_mean(self, options: RollingOptions) -> Expr {
Expand All @@ -1543,7 +1543,7 @@ impl Expr {
}

/// Apply a rolling sum See:
/// [ChunkedArray::rolling_sum](polars::prelude::ChunkWindow::rolling_sum).
/// [ChunkedArray::rolling_sum]
#[cfg_attr(docsrs, doc(cfg(feature = "rolling_window")))]
#[cfg(feature = "rolling_window")]
pub fn rolling_sum(self, options: RollingOptions) -> Expr {
Expand Down
62 changes: 0 additions & 62 deletions polars/src/docs/eager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,68 +427,6 @@
//! # Ok(())
//! # }
//! ```
//! ### Downsample
//!
//! Downsample the DataFrame given some frequency/ downsample rule
//!
//! ```
//! use polars::prelude::*;
//! use polars::df;
//! use polars::frame::groupby::resample::SampleRule;
//!
//! # fn example(df: &DataFrame) -> Result<()> {
//! // given an input dataframe
//!
//! // ╭─────────────────────┬─────╮
//! // │ ms ┆ i │
//! // │ --- ┆ --- │
//! // │ datetime(ms) ┆ u8 │
//! // ╞═════════════════════╪═════╡
//! // │ 2000-01-01 00:00:00 ┆ 0 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:01:00 ┆ 1 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:02:00 ┆ 2 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:03:00 ┆ 3 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ ... ┆ ... │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:15:00 ┆ 15 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:16:00 ┆ 16 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:17:00 ┆ 17 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:18:00 ┆ 18 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
//! // │ 2000-01-01 00:19:00 ┆ 19 │
//! // ╰─────────────────────┴─────╯
//!
//!
//! let downsampled = df.downsample("datetime", SampleRule::Minute(5))?
//! .first()?
//! .sort("datetime", false)?;
//!
//! // downsampled:
//!
//! // ╭─────────────────────┬─────────╮
//! // │ ms ┆ i_first │
//! // │ --- ┆ --- │
//! // │ datetime(ms) ┆ u8 │
//! // ╞═════════════════════╪═════════╡
//! // │ 2000-01-01 00:00:00 ┆ 0 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
//! // │ 2000-01-01 00:05:00 ┆ 5 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
//! // │ 2000-01-01 00:10:00 ┆ 10 │
//! // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
//! // │ 2000-01-01 00:15:00 ┆ 15 │
//! // ╰─────────────────────┴─────────╯
//! # Ok(())
//! # }
//!
//! ```
//!
//! ## Melt
//!
Expand Down
6 changes: 3 additions & 3 deletions polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@
//! - `reinterpret` - Utility to reinterpret bits to signed/unsigned
//! - `take_opt_iter` - Take from a Series with `Iterator<Item=Option<usize>>`
//! - `mode` - [Return the most occurring value(s)](crate::chunked_array::ops::ChunkUnique::mode)
//! - `cum_agg` - [cumsum, cummin, cummax aggregation](crate::chunked_array::ops::CumAgg)
//! - `rolling_window` [rolling window functions, like rolling_mean](crate::chunked_array::ops::ChunkWindow)
//! - `cum_agg` - cumsum, cummin, cummax aggregation.
//! - `rolling_window` - rolling window functions, like rolling_mean
//! - `interpolate` [interpolate None values](crate::chunked_array::ops::Interpolate)
//! - `extract_jsonpath` - [Run jsonpath queries on Utf8Chunked](https://goessner.net/articles/JsonPath/)
//! - `list` - [List utils](crate::chunked_array::list::namespace)
//! - `list` - List utils.
//! - `rank` - Ranking algorithms.
//! - `moment` - kurtosis and skew statistics
//! - `ewma` - Exponential moving average windows
Expand Down

0 comments on commit 27d0a0c

Please sign in to comment.