diff --git a/Cargo.toml b/Cargo.toml index 8cfdfc5..7d44305 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,11 +11,15 @@ keywords = ["genetic", "machine-learning", "ai", "algorithm", "evolution"] categories = ["algorithms", "science", "simulation"] license = "MIT" +[package.metadata.docs.rs] +features = ["serde"] +rustdoc-args = ["--cfg", "docsrs"] + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] default = ["max-index"] -crossover = ["genetic-rs/crossover"] +#crossover = ["genetic-rs/crossover"] rayon = ["genetic-rs/rayon", "dep:rayon"] max-index = [] serde = ["dep:serde", "dep:serde-big-array"] diff --git a/src/lib.rs b/src/lib.rs index 5b96fc9..7bdd42d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,11 +2,13 @@ //! ### Feature Roadmap: //! - [x] base (single-core) crate //! - [x] rayon +//! - [x] serde //! - [ ] crossover //! //! You can get started by looking at [genetic-rs docs](https://docs.rs/genetic-rs) and checking the examples for this crate. #![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_cfg))] /// A module containing the [`NeuralNetworkTopology`] struct. This is what you want to use in the DNA of your agent, as it is the thing that goes through nextgens and suppors mutation. pub mod topology; diff --git a/src/runnable.rs b/src/runnable.rs index 5bdb82d..53d69e0 100644 --- a/src/runnable.rs +++ b/src/runnable.rs @@ -8,7 +8,7 @@ use rayon::prelude::*; #[cfg(feature = "rayon")] use std::sync::{Arc, RwLock}; -/// A runnable, stated Neural Network generated from a [NeuralNetworkToplogy]. Use [`NeuralNetwork::from`] to go from stateles to runnable. +/// A runnable, stated Neural Network generated from a [NeuralNetworkTopology]. Use [`NeuralNetwork::from`] to go from stateles to runnable. /// Because this has state, you need to run [`NeuralNetwork::flush_state`] between [`NeuralNetwork::predict`] calls. #[derive(Debug)] #[cfg(not(feature = "rayon"))] diff --git a/src/topology.rs b/src/topology.rs index 20181dc..ef7df33 100644 --- a/src/topology.rs +++ b/src/topology.rs @@ -11,13 +11,14 @@ use rand::prelude::*; use serde::{Deserialize, Deserializer, Serialize, Serializer}; /// Contains useful structs for serializing/deserializing a [`NeuronTopology`] +#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] #[cfg(feature = "serde")] pub mod nnt_serde { use super::*; use serde::{Deserialize, Serialize}; use serde_big_array::BigArray; - /// A serializable wrapper for [`NeuronToplogy`]. See [`NNTSerde::from`] for conversion. + /// A serializable wrapper for [`NeuronTopology`]. See [`NNTSerde::from`] for conversion. #[derive(Serialize, Deserialize)] pub struct NNTSerde { #[serde(with = "BigArray")]