From e09876c7b89eac400eb6b9eda06fbbed989ac8c4 Mon Sep 17 00:00:00 2001 From: Justin Lovinger Date: Wed, 27 Sep 2023 19:01:44 +0000 Subject: [PATCH] Polish for publication --- .hooks/pre-commit | 3 +- Cargo.lock | 30 +++++++++---------- Cargo.toml | 10 +++---- README.md | 10 +++---- README.tpl | 10 +++---- derive-bounded/README.md | 3 -- .../Cargo.toml | 9 ++++-- derive-num-bounded/README.md | 11 ++++++- derive-num-bounded/README.tpl | 1 + .../src/lib.rs | 2 ++ optimal-binary/Cargo.toml | 7 +++-- optimal-binary/README.md | 12 ++++++++ optimal-binary/README.tpl | 1 + optimal-binary/src/lib.rs | 2 ++ optimal-core/Cargo.toml | 7 +++-- optimal-core/README.md | 2 ++ optimal-pbil/Cargo.toml | 11 ++++--- optimal-pbil/README.md | 7 +++++ optimal-pbil/README.tpl | 1 + optimal-pbil/src/types.rs | 4 +-- optimal-steepest/Cargo.toml | 11 ++++--- optimal-steepest/README.md | 7 +++++ optimal-steepest/README.tpl | 1 + .../src/backtracking_steepest/types.rs | 4 +-- optimal-steepest/src/lib.rs | 2 +- 25 files changed, 111 insertions(+), 57 deletions(-) delete mode 100644 derive-bounded/README.md rename {derive-bounded => derive-num-bounded}/Cargo.toml (55%) create mode 120000 derive-num-bounded/README.tpl rename {derive-bounded => derive-num-bounded}/src/lib.rs (99%) create mode 100644 optimal-binary/README.md create mode 120000 optimal-binary/README.tpl create mode 120000 optimal-pbil/README.tpl create mode 120000 optimal-steepest/README.tpl diff --git a/.hooks/pre-commit b/.hooks/pre-commit index 5396a51..eb20d03 100755 --- a/.hooks/pre-commit +++ b/.hooks/pre-commit @@ -1,7 +1,8 @@ #!/bin/sh cargo readme -o README.md -cargo readme -r derive-bounded -o README.md +cargo readme -r derive-num-bounded -o README.md +cargo readme -r optimal-binary -o README.md cargo readme -r optimal-core -o README.md cargo readme -r optimal-pbil -o README.md cargo readme -r optimal-steepest -o README.md diff --git a/Cargo.lock b/Cargo.lock index 37ef771..685276d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -70,14 +70,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "derive-bounded" -version = "0.1.0" -dependencies = [ - "paste", - "thiserror", -] - [[package]] name = "derive-getters" version = "0.3.0" @@ -89,6 +81,14 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-num-bounded" +version = "0.0.0" +dependencies = [ + "paste", + "thiserror", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -188,7 +188,7 @@ dependencies = [ [[package]] name = "optimal" -version = "0.1.0" +version = "0.0.0" dependencies = [ "optimal-core", "optimal-pbil", @@ -198,7 +198,7 @@ dependencies = [ [[package]] name = "optimal-binary" -version = "0.1.0" +version = "0.0.0" dependencies = [ "num-traits", "serde", @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "optimal-core" -version = "0.1.0" +version = "0.0.0" dependencies = [ "blanket", "paste", @@ -219,10 +219,10 @@ dependencies = [ [[package]] name = "optimal-pbil" -version = "0.1.0" +version = "0.0.0" dependencies = [ - "derive-bounded", "derive-getters", + "derive-num-bounded", "derive_more", "num-traits", "optimal-core", @@ -239,10 +239,10 @@ dependencies = [ [[package]] name = "optimal-steepest" -version = "0.1.0" +version = "0.0.0" dependencies = [ - "derive-bounded", "derive-getters", + "derive-num-bounded", "derive_more", "num-traits", "optimal-core", diff --git a/Cargo.toml b/Cargo.toml index cbcd859..b5ebadc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "derive-bounded", + "derive-num-bounded", "optimal-binary", "optimal-core", "optimal-pbil", @@ -9,7 +9,7 @@ members = [ [package] name = "optimal" -version = "0.1.0" +version = "0.0.0" edition = "2021" authors = ["Justin Lovinger"] description = "Mathematical optimization and machine learning framework and algorithms" @@ -23,9 +23,9 @@ license = "MIT" github = { repository = "justinlovinger/optimal-rs", workflow = "build" } [dependencies] -optimal-core = { path = "optimal-core" } -optimal-pbil = { path = "optimal-pbil" } -optimal-steepest = { path = "optimal-steepest" } +optimal-core = { path = "optimal-core", version = "0.0.0" } +optimal-pbil = { path = "optimal-pbil", version = "0.0.0" } +optimal-steepest = { path = "optimal-steepest", version = "0.0.0" } rand_xoshiro = "0.6.0" [dev-dependencies] diff --git a/README.md b/README.md index a615d2e..c3fedc4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ [![Workflow Status](https://github.com/justinlovinger/optimal-rs/workflows/build/badge.svg)](https://github.com/justinlovinger/optimal-rs/actions?query=workflow%3A%22build%22) -Note, -this is currently highly experimental. -Expect frequent breaking changing -without proper versioning. -This notice will change -when stabilization begins. +This package is experimental. +Expect frequent updates to the repository +with breaking changes +and infrequent releases. # optimal diff --git a/README.tpl b/README.tpl index 57d1839..5a223d1 100644 --- a/README.tpl +++ b/README.tpl @@ -1,11 +1,9 @@ {{badges}} -Note, -this is currently highly experimental. -Expect frequent breaking changing -without proper versioning. -This notice will change -when stabilization begins. +This package is experimental. +Expect frequent updates to the repository +with breaking changes +and infrequent releases. # {{crate}} diff --git a/derive-bounded/README.md b/derive-bounded/README.md deleted file mode 100644 index e0e8ea3..0000000 --- a/derive-bounded/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# derive-bounded - -License: MIT diff --git a/derive-bounded/Cargo.toml b/derive-num-bounded/Cargo.toml similarity index 55% rename from derive-bounded/Cargo.toml rename to derive-num-bounded/Cargo.toml index 6de07a8..5f7d8d7 100644 --- a/derive-bounded/Cargo.toml +++ b/derive-num-bounded/Cargo.toml @@ -1,15 +1,18 @@ [package] -name = "derive-bounded" -version = "0.1.0" +name = "derive-num-bounded" +version = "0.0.0" edition = "2021" authors = ["Justin Lovinger"] description = "Macros for implementing bounded number types" -repository = "https://github.com/justinlovinger/optimal-rs" +repository = "https://github.com/justinlovinger/optimal-rs/tree/master/derive-num-bounded" readme = "README.md" keywords = ["macro"] categories = ["rust-patterns"] license = "MIT" +[badges] +github = { repository = "justinlovinger/optimal-rs", workflow = "build" } + [dependencies] paste = "1.0.14" thiserror = "1.0.47" diff --git a/derive-num-bounded/README.md b/derive-num-bounded/README.md index e0e8ea3..c402412 100644 --- a/derive-num-bounded/README.md +++ b/derive-num-bounded/README.md @@ -1,3 +1,12 @@ -# derive-bounded +[![Workflow Status](https://github.com/justinlovinger/optimal-rs/workflows/build/badge.svg)](https://github.com/justinlovinger/optimal-rs/actions?query=workflow%3A%22build%22) + +This package is experimental. +Expect frequent updates to the repository +with breaking changes +and infrequent releases. + +# derive-num-bounded + +Macros for implementing bounded number types. License: MIT diff --git a/derive-num-bounded/README.tpl b/derive-num-bounded/README.tpl new file mode 120000 index 0000000..a8b73cc --- /dev/null +++ b/derive-num-bounded/README.tpl @@ -0,0 +1 @@ +../README.tpl \ No newline at end of file diff --git a/derive-bounded/src/lib.rs b/derive-num-bounded/src/lib.rs similarity index 99% rename from derive-bounded/src/lib.rs rename to derive-num-bounded/src/lib.rs index c47f084..e6e2f68 100644 --- a/derive-bounded/src/lib.rs +++ b/derive-num-bounded/src/lib.rs @@ -1,6 +1,8 @@ #![allow(unused_macros)] #![allow(unused_imports)] +//! Macros for implementing bounded number types. + pub use paste; pub use thiserror; diff --git a/optimal-binary/Cargo.toml b/optimal-binary/Cargo.toml index aaf0b67..8597919 100644 --- a/optimal-binary/Cargo.toml +++ b/optimal-binary/Cargo.toml @@ -1,15 +1,18 @@ [package] name = "optimal-binary" -version = "0.1.0" +version = "0.0.0" edition = "2021" authors = ["Justin Lovinger"] description = "Utilities for working with binary optimizers" -repository = "https://github.com/justinlovinger/optimal-rs" +repository = "https://github.com/justinlovinger/optimal-rs/tree/master/optimal-binary" readme = "README.md" keywords = ["optimization", "binary"] categories = ["science", "mathematics"] license = "MIT" +[badges] +github = { repository = "justinlovinger/optimal-rs", workflow = "build" } + [features] serde = ["dep:serde"] diff --git a/optimal-binary/README.md b/optimal-binary/README.md new file mode 100644 index 0000000..ce13194 --- /dev/null +++ b/optimal-binary/README.md @@ -0,0 +1,12 @@ +[![Workflow Status](https://github.com/justinlovinger/optimal-rs/workflows/build/badge.svg)](https://github.com/justinlovinger/optimal-rs/actions?query=workflow%3A%22build%22) + +This package is experimental. +Expect frequent updates to the repository +with breaking changes +and infrequent releases. + +# optimal-binary + +Utilities for working with binary optimizers. + +License: MIT diff --git a/optimal-binary/README.tpl b/optimal-binary/README.tpl new file mode 120000 index 0000000..a8b73cc --- /dev/null +++ b/optimal-binary/README.tpl @@ -0,0 +1 @@ +../README.tpl \ No newline at end of file diff --git a/optimal-binary/src/lib.rs b/optimal-binary/src/lib.rs index 5677ee9..5d13fcf 100644 --- a/optimal-binary/src/lib.rs +++ b/optimal-binary/src/lib.rs @@ -1,3 +1,5 @@ +//! Utilities for working with binary optimizers. + use num_traits::{pow, One, Zero}; use std::ops::{Add, Div, Mul, RangeInclusive, Sub}; diff --git a/optimal-core/Cargo.toml b/optimal-core/Cargo.toml index 1c65009..3019c7c 100644 --- a/optimal-core/Cargo.toml +++ b/optimal-core/Cargo.toml @@ -1,15 +1,18 @@ [package] name = "optimal-core" -version = "0.1.0" +version = "0.0.0" edition = "2021" authors = ["Justin Lovinger"] description = "Mathematical optimization and machine learning framework" -repository = "https://github.com/justinlovinger/optimal-rs" +repository = "https://github.com/justinlovinger/optimal-rs/tree/master/optimal-core" readme = "README.md" keywords = ["ai", "machine-learning", "optimization"] categories = ["science", "mathematics"] license = "MIT" +[badges] +github = { repository = "justinlovinger/optimal-rs", workflow = "build" } + [dependencies] blanket = "0.3.0" streaming-iterator = "0.1.9" diff --git a/optimal-core/README.md b/optimal-core/README.md index 368eac2..a0104b2 100644 --- a/optimal-core/README.md +++ b/optimal-core/README.md @@ -1,3 +1,5 @@ +[![Workflow Status](https://github.com/justinlovinger/optimal-rs/workflows/build/badge.svg)](https://github.com/justinlovinger/optimal-rs/actions?query=workflow%3A%22build%22) + # optimal-core Core traits and types for Optimal. diff --git a/optimal-pbil/Cargo.toml b/optimal-pbil/Cargo.toml index 8070d08..90c157f 100644 --- a/optimal-pbil/Cargo.toml +++ b/optimal-pbil/Cargo.toml @@ -1,24 +1,27 @@ [package] name = "optimal-pbil" -version = "0.1.0" +version = "0.0.0" edition = "2021" authors = ["Justin Lovinger"] description = "Implementation of population-based incremental learning (PBIL)" -repository = "https://github.com/justinlovinger/optimal-rs" +repository = "https://github.com/justinlovinger/optimal-rs/tree/master/optimal-pbil" readme = "README.md" keywords = ["optimization", "pbil"] categories = ["science", "mathematics"] license = "MIT" +[badges] +github = { repository = "justinlovinger/optimal-rs", workflow = "build" } + [features] serde = ["dep:serde", "rand/serde1", "rand_xoshiro/serde1"] [dependencies] -derive-bounded = { path = "../derive-bounded" } +derive-num-bounded = { path = "../derive-num-bounded", version = "0.0.0" } derive-getters = "0.3.0" derive_more = "0.99.17" num-traits = "0.2.16" -optimal-core = { path = "../optimal-core" } +optimal-core = { path = "../optimal-core", version = "0.0.0" } partial-min-max = "0.4.0" rand = "0.8.5" rand_xoshiro = "0.6.0" diff --git a/optimal-pbil/README.md b/optimal-pbil/README.md index 3c20674..8c83179 100644 --- a/optimal-pbil/README.md +++ b/optimal-pbil/README.md @@ -1,3 +1,10 @@ +[![Workflow Status](https://github.com/justinlovinger/optimal-rs/workflows/build/badge.svg)](https://github.com/justinlovinger/optimal-rs/actions?query=workflow%3A%22build%22) + +This package is experimental. +Expect frequent updates to the repository +with breaking changes +and infrequent releases. + # optimal-pbil Population-based incremental learning (PBIL). diff --git a/optimal-pbil/README.tpl b/optimal-pbil/README.tpl new file mode 120000 index 0000000..a8b73cc --- /dev/null +++ b/optimal-pbil/README.tpl @@ -0,0 +1 @@ +../README.tpl \ No newline at end of file diff --git a/optimal-pbil/src/types.rs b/optimal-pbil/src/types.rs index 4c23c34..dbb66a0 100644 --- a/optimal-pbil/src/types.rs +++ b/optimal-pbil/src/types.rs @@ -1,11 +1,11 @@ use core::convert::TryFrom; use std::f64::EPSILON; -use derive_bounded::{ +use derive_more::{Display, Into}; +use derive_num_bounded::{ derive_from_str_from_try_into, derive_into_inner, derive_new_from_bounded_float, derive_new_from_lower_bounded, derive_try_from_from_new, }; -use derive_more::{Display, Into}; use num_traits::bounds::{LowerBounded, UpperBounded}; use rand::distributions::Bernoulli; diff --git a/optimal-steepest/Cargo.toml b/optimal-steepest/Cargo.toml index c37a9be..1afcc7d 100644 --- a/optimal-steepest/Cargo.toml +++ b/optimal-steepest/Cargo.toml @@ -1,24 +1,27 @@ [package] name = "optimal-steepest" -version = "0.1.0" +version = "0.0.0" edition = "2021" authors = ["Justin Lovinger"] description = "Implementation of steepest descent optimizers" -repository = "https://github.com/justinlovinger/optimal-rs" +repository = "https://github.com/justinlovinger/optimal-rs/tree/master/optimal-steepest" readme = "README.md" keywords = ["optimization", "steepest-descent", "line-search"] categories = ["science", "mathematics"] license = "MIT" +[badges] +github = { repository = "justinlovinger/optimal-rs", workflow = "build" } + [features] serde = ["dep:serde"] [dependencies] -derive-bounded = { path = "../derive-bounded" } +derive-num-bounded = { path = "../derive-num-bounded", version = "0.0.0" } derive-getters = "0.3.0" derive_more = "0.99.17" num-traits = "0.2.16" -optimal-core = { path = "../optimal-core" } +optimal-core = { path = "../optimal-core", version = "0.0.0" } rand = "0.8.5" replace_with = "0.1.7" serde = { version = "1.0.185", features = ["derive"], optional = true } diff --git a/optimal-steepest/README.md b/optimal-steepest/README.md index 0760b42..486ab6d 100644 --- a/optimal-steepest/README.md +++ b/optimal-steepest/README.md @@ -1,3 +1,10 @@ +[![Workflow Status](https://github.com/justinlovinger/optimal-rs/workflows/build/badge.svg)](https://github.com/justinlovinger/optimal-rs/actions?query=workflow%3A%22build%22) + +This package is experimental. +Expect frequent updates to the repository +with breaking changes +and infrequent releases. + # optimal-steepest Steepest descent optimizers. diff --git a/optimal-steepest/README.tpl b/optimal-steepest/README.tpl new file mode 120000 index 0000000..a8b73cc --- /dev/null +++ b/optimal-steepest/README.tpl @@ -0,0 +1 @@ +../README.tpl \ No newline at end of file diff --git a/optimal-steepest/src/backtracking_steepest/types.rs b/optimal-steepest/src/backtracking_steepest/types.rs index 3374567..688e625 100644 --- a/optimal-steepest/src/backtracking_steepest/types.rs +++ b/optimal-steepest/src/backtracking_steepest/types.rs @@ -3,11 +3,11 @@ use std::{ ops::{Div, Mul, Sub}, }; -use derive_bounded::{ +use derive_more::Display; +use derive_num_bounded::{ derive_into_inner, derive_new_from_bounded_partial_ord, derive_new_from_lower_bounded_partial_ord, }; -use derive_more::Display; use num_traits::{ bounds::{LowerBounded, UpperBounded}, real::Real, diff --git a/optimal-steepest/src/lib.rs b/optimal-steepest/src/lib.rs index f3616c5..72ee30d 100644 --- a/optimal-steepest/src/lib.rs +++ b/optimal-steepest/src/lib.rs @@ -8,8 +8,8 @@ pub mod fixed_step_steepest; use std::ops::Mul; -use derive_bounded::{derive_into_inner, derive_new_from_lower_bounded_partial_ord}; use derive_more::Display; +use derive_num_bounded::{derive_into_inner, derive_new_from_lower_bounded_partial_ord}; use num_traits::{bounds::LowerBounded, real::Real}; #[cfg(feature = "serde")]